Hi there,
Following the UART script node example here all works well on the OAK-FFC-4P.
To make this useful in my pipeline I need a high baud rate. Trying to change the baud rate seems to not work. If changing to a non-standard baud the example errors out as expected in-line with the pySerial docs.
When trying to set a standard baud rate above 115200, like 230400, 460800, 576000 or 921600, the example runs implying these baud rates are supported by the platform, however, there is nothing on the data line. When the pipeline starts I see some activity on RX, however looking at the TX line on a logic analyser the TX just sits high at 1.8V.
Is a higher baud rate supported with UART? How can I configure this?
I assume I need to change the speed of a UART clock somewhere?
115200 Bauds: ser = serial.Serial("/dev/ttyS0", baudrate=115200)
230400 Bauds: ser = serial.Serial("/dev/ttyS0", baudrate=230400)
EDIT: Also tried with tty with no luck:
script.setScript("""
import os, tty
import time
# time.sleep(50)
msg = 'hello world from tty'
node.warn(f'Sending message to UART: {msg}')
# Open UART0 port, set raw and baudrate
fd = os.open("/dev/ttyS0", os.O_RDWR | os.O_NOCTTY)
tty.setraw(fd)
mode = tty.tcgetattr(fd)
mode[tty.ISPEED] = mode[tty.OSPEED] = tty.B460800
tty.tcsetattr(fd, tty.TCSANOW, mode)
while True:
# Send hello message and print back received message
os.write(fd, msg.encode())
#node.warn(f'Read: {os.read(fd, 16)}')
time.sleep(1)
""")