When I run the example 'serialport.py' the cpu usage goes up to 100%. I imagine this is because in 'devices.py' the serial port is opened with "timeout=0" which makes the serial.read() non blocking. There is even a note in 'devices.py' that says "Timeout = non-blocking to match pyftdi"
Is there any reason that this is like this? If I set the timeout to "none" then the read() command blocks and the cpu usage drops to 0 and only goes up a bit when the ad2pi receives serial traffic. The only issue is that you have to force quit the python thread because the serial port will stay open forever waiting on data. This shouldn't be an issue because I will eventually be running a custom version of serialport.py as a daemon but it would be nice if it would quit pretty.
If I set timeout=5 then it appears to block for 5 seconds and then move on. The thread will also die pretty, after 5 seconds or so. I have run it like this for a while and haven't noticed any issues.
Would anyone like to chime in? Is it safe to set a timeout > 0 for a serialport device?
Thanks