I have a persisting latency between my arduino and pyserial. Consider the following code:
import serial import time port_usb_serie = serial.Serial(port ="COM3",baudrate =115200) def read_port(): port_usb_serie.write(b'i') # port_usb_serie.flush() time.sleep(.1) a = port_usb_serie.in_waiting b = port_usb_serie.read(a) b = b.decode() b = b.split('\r\n') return b c = read_port() print(c)
I I don't put at least a 100ms time sleep, the serial port does not return anything. I tried to modify the latency timer of the COM port, as indicated here (How to set the serial port latency timer for faster response in Windows) but I don't have access to it (advanced settings just show the standard FIFO menu). I wonder whether the problem could be my usb cable that connects the arduino to my computer (I do not use a certified high speed usb cable, just a standard one).
Thank you for your help