Serial Connection

Hi, I am kind of new to this version of Xojo. I used to use realbasic up to version 2009. I came back and I am trying to create a small serial app to read rp pico or arduino.

I have been able to see the devices on my tty devices list and I can connect. But I can not read the data. I was successfully able to read the data once out of maybe 30 times I tried. Even with the same setup I was not able to read data coming from the rp pico. Anyone facing the same issue? Is there a bug on the serial connection class?

Thanks for your guys help.

It’s been at least a couple of years since I used Xojo’s serial class. I was using it on both Mac and Windows. The Mac version was a bit more reliable than the Windows version, but still problematic. It appeared to be a VCP (virtual com port) driver problem, not a Xojo problem. Since I was using FTDI USB/serial hardware, I went to their site and downloaded their VCP driver. That solved the problems on the Mac, and many but not all of the problems on Windows.
I think this is why many people are moving away from serial, and starting to work with wifi capable Arduinos.

When you say that you’re able to connect, but not transfer data, does that mean that you get no data at all, or do you get gibberish?

Unsure about the rp pico, but here’s what I’ve done to read from Arduino connected to RPi 3 via USB…

After successful connection, I use this in the Serial.DataReceived event…

Var s As String

While Me.BytesAvailable > 0
  s = s + Me.ReadAll
Wend

If s <> "" Then
  s = s.ReplaceAll(EndOfLine.UNIX, "").Trim
  Me.BuildDeviceMessage(s) // my own method that adds date/time, etc
End If 

Since all this is running as a console app on the relatively slow RPi 3, I also added App.DoEventsI(500) to the App.Run main loop to force the Pi to pause every half-second and allow the serial port to be read.

Yes, I am able to connect to both but i can only get the arduino working (reading the data) the rp pico, there no data…blank screen. The rp pico connects but no data so now i am starting to think this is NOT a xojo issue. I tried multiple baud speeds and also different configs. I have been trying to look online to see the options to connect to rp pico but so far i have not been able to find it. I can connect to both micros via screen (terminal).

Also the arduino connects and i can see the text in my xojo app but something weird happened. The computer shut down… one of the usb ports (where i connected the arduino) acted like it was burned out then all my usb c ports would not work and i could not charge the mac book.

I was about to buy two usb ports to replace the ones in my mac book pro, but before i bought the usb c ports, i opened the computer and disconnected the battery. After a while i tried to connect my mac to power and it looks like the ports started to work again. it is so weird since i zapped the pram and reset the config.

thank for your reply.

Yes Bryan, i have the same code… just the arduino works but not the rp pico. thanks fo your response.