Anyone know roughly how long it might takes to open and close a Pi virtual serial port (eg ttyUSB0) with PySerial? I'm guessing a few miiliseconds, but are there circumstances when it might take much longer?
I want to query a serial port every 2-3 seconds to read eg 100 bytes from the port (@19200), so the read process ought never to take more than eg a few ms. Probably the most robust programming approach is to open and then close the port for each query. But if the open/close process is ever going to take more than eg 1-2 secs then it could, at the least, start to desynchronise any timing loops and it could be better to hold the port open. But that really doesn't feel like good programming technique.