The RPi 4 uart port (BCM14_TXD, BCM15_RXD) is connected to another device that is streaming uart chars at 115200 baud.
The following python script is manually launched from an ssh terminal, and it prints any chars that are available at uart RX:
import serial serPort = serial.Serial(args["port"], args["baudRate"], timeout=100, parity='N', stopbits=1) while True: resp = serPort.readline() print(resp, flush=True)
The script is able to get a connection to the uart and print chars, but after some variable time (approx 5s) the connection is lost:
Traceback (most recent call last): File "./commRead.py", line 56, in <module> resp = serPort.readline() File "/usr/local/lib/python3.6/site-packages/serial/serialposix.py", line 596, in read 'device reports readiness to read but returned no data ' serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
My config and symptoms are very similar to:
I switched from the development OS to the production OS, enabled the UART in the Device Config, and now the uart link appears to work perfectly.
This is great, but how do I get the uart working without dropouts when using the development image?