rpi4 Serial Issues

I have been having some troubles getting the TX/RX pins on the rasberry pi4 to behave as the documentation suggests they ought to. I have read the docs, and seen a number of somewhat conflicting reports as to the right way get stuff rolling. Here are some of the things I have looked at:

I am trying to integrate the fairly standard uBlox GPS devices specifically. So, very concretely, I am curious about the right way to get the norrmal TX/RX pins on the pi4b to act as a 9600 baud serial port. I expect that cat /dev/someSerialIdentifier will just do the right thing for some group of settings/dtoverlays, but I don’t know what those are based on trying most of the stuff featured above…

Hello, which version of balenaOS are you using, and is it a development or production variant?

I have tried several permutations of things on 3 devices:

All with similar results. They are on the “production” variant.

I’m trying to reproduce on production v. 2.115.7+rev2 - I assume you already enabled UART in the balena Cloud configuration screen or set enable_uart=1 in config.txt?

I have toggled that flag and tried things variously. It is a bit unclear to me whether that corresponds with enabling the serial port, vs. enabling a terminal on the serial port (getty). It would be kind of odd to me that the serial port pins were explicitly disabled by default.

I believe in my limited read as well, that the changes to config.txt must be made before first run of the device? In this case we will be retrofitting devices in the field with a added peripheral as they come up for service, so I would prefer not to have to completely re-flash.

In reference to enabling the serial port itself (the mini UART on /dev/ttyS0) it is disabled by default for production images (and also by the way on a stock Raspberry Pi per Raspberry Pi Documentation - Configuration) and enabled by default for development images.
You are correct about config.txt, it will only work if you edit the file before the device’s first boot.

So somewhat interestingly, the only device I have managed to make the serial interface work on explicitly has that flag -unset- which is part of my confusion. I sent the UUID in the private support chat

For the device that is working, did you set and then unset the “enable UART” flag in the dashboard (I see enable_uart=1 in the config.txt) or anything else since flashing the device to get the serial working? Also, just to clarify, you are using pins 8 and 10 (GPIO 14 and 15) to confirm serial communications?

Apologies, I am coming back to this from a couple months away.
I may have set the enable_uart=1 in the config.txt before I realized that that would only help if it were there before the first boot.

Confirmed on the pinout, those are the pins I am using.

1 Like