Go to advanced search

by sgb27
Fri Aug 07, 2020 12:17 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Serial comms to Arduino only work after using screen command
Replies: 8
Views: 278

Re: Serial comms to Arduino only work after using screen command

Thanks, that's exactly what I have been doing over the last day or two. I think I've found the issue. The key for me was that going through my code by typing it in "live" to the python interpreter worked, even without using screen first, so I figured this must be some kind of timing issue. This is w...
by sgb27
Thu Aug 06, 2020 8:45 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Serial comms to Arduino only work after using screen command
Replies: 8
Views: 278

Re: Serial comms to Arduino only work after using screen command

I understood from the docs that timeout=0 means non-blocking mode? https://pyserial.readthedocs.io/en/latest/pyserial_api.html Anyway, the code does work, albeit after I've had to run the screen command. My question is, what could the screen command be doing regarding the serial port that then makes...
by sgb27
Wed Aug 05, 2020 9:50 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Serial comms to Arduino only work after using screen command
Replies: 8
Views: 278

Re: Serial comms to Arduino only work after using screen command

Sorry, here's the rest of the code in my main(), up until it blocks in the sendCommand function.

Code: Select all

ser = serial.Serial('/dev/ttyUSB0', 9600, 8, 'N', 1, timeout=0)
v = sendCommand(ser, 65)
v = v.split(",")
by sgb27
Wed Aug 05, 2020 6:17 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Serial comms to Arduino only work after using screen command
Replies: 8
Views: 278

Serial comms to Arduino only work after using screen command

I've got a strange problem that took a while to figure out, but I don't understand what is going on. I have an arduino gathering some data, and it also waits for very simple commands (a single character) on the serial port, and replies back on the serial port with some numbers sandwiched between the...

Go to advanced search