Hi fellow wire workers,
Goal: to establish serial comms between RPi Zero 2 W and Windows (Putty or LabVIEW)
Error Desc: LabVIEW code on RPi gives timeout when attempting to write data to serial port 1
Details: I have made headway in causing the RPi Zero 2 W to appear as a serial device under device manager under Windows 10. However when I attempt to write characters to the RPi ASRL1 from LabVIEW to be Rx by a Putty Terminal I get a timeout error . I have been using this RPi with much LabVIEW code including digital IO, so I know I have the main build/deploy/run processes figured out. I do not want to use the GPIO pins on the RPi I want to use the USB data connector withi RPi configured as a USB Device connected to my PC via a USB-micro cable (I think I have configured the RPi serial port OK to that end per other help pages )
Any suggestions as to debugging steps ?
Here is a snapshot of the state(s) of my system:
 Error -1073807339 occurred at VISA Write in Main.lvlib:Main.vi
Possible reason(s): VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.
 I turned my RPi into a serial gadget per the following
main changes were to :
Solved! Go to Solution.
I am making some progress - at least no timeout and the 14 bytes appear written from the RPi's perspective.
but PuTTy is still to Rx them, I';ll report back when I have progress...
I discovered there are two serial ports setup on the RPi serial0 is for bluetooth (using the H/W UART) and serial1 is the one I am trying to connect to (whihc uses a S/W UART and I might swap them around once I make more progres per here )
Good to hear that you're making progress with the RPi Zero 2 W. I don't have access to a Rpi at the moment, but here are a few things to try.
The two visa devices you mentioned may be the UART's on the RPi Zero 2 W. They are not used for the USB serial gadget device.
Did you run the visa find device vi to update the visaconf.ini file with the USB device?
I think the USB serial gadget device is mapped in Linux as /dev/ttyGS0
You can check using dmesg on a shell to the Rpi. The USB serial gadget device name should be listed in the output.
You may be able to test the connection from the Rpi to PC using the minicom terminal program on the Rpi and puTTy on the PC.
If it's not installed by default you may need to enter
sudo apt-get install minicom
I think the command line to start the program is
sudo minicom -D /dev/ttyGS0
Characters entered into minicom should be echoed in the puTTy terminal program on the PC and vice versa.
If this works OK you may need to create a manual entry for /dev/ttyGS0 in the visaconf.ini file on the Rpi.
You should then see the new visa alias from LabVIEW on the Rpi.
The USB Ethernet gadget device also works with LabVIEW on the Rpi 🙂
It can be used as a way of deploying LabVIEW programs to the RPi Zero 2 W without a WiFi connection.
You can connect to the Rpi using the host name
thank you so much for chiming in to assist me !
The USB Ethernet gadget device also works with LabVIEW on the Rpi
I will enable the ethernet gadget if for some reason the WiFi method I use proves inconvenient as that is how I have been establishing a connection reliably for now. It just turned out there is a separate requirement for this project to use serial comms.
I was able to locate the visaconf.ini file and edited it manually, adding in the last section for the USB serial gadget device per here:
pi@raspberrypi:/srv/chroot/labview/etc/ni-visa $ sudo nano visaconf.ini
pi@raspberrypi:/srv/chroot/labview/etc/ni-visa $ cat visaconf.ini
If that doesn't work I will go back and try out the minicom option you suggested.
I will keep you posted.
Hi Andy, I'm happy to declare success !!
Thank you very much.
I have two followup questions if that is OK.
To note some typos I had in the prior visaconf.ini file above, here are the correct settings:
With regards to your questions
1) It is a device driver that provides a USB serial device and a Linux serial device. I don't think it uses SW UARTS internally and so changing the baud rate would have no effect on transfer rates.
2) The find device vi checks the entries in visaconf.ini to see if they are online. It's not finding /dev/ttyGS0. You could try setting the static parameter to 1 in visaconf.ini
Thanks again Andy.
I can confirm setting
causes it to come up in the find resource list,
I'm glad it is likely to be a physical UART as they are more robust than the software UART (which I read that one of /dev/serial0 /dev/serial1 may well be in the RPi zero).