I use twisted.internet.serialport so that my program is constantly connected to the device on the serial port.
Unfortunately, my serial port is just a USB device, which means that it can be turned off or reset the OS at any time (port 2 is disabled by the hub (EMI?), Re-enabled ...). I see that pyserial has been supporting this for several weeks and is throwing a SerialException.
What I would like to do is try to connect to a serial port that just disappears every few seconds.
So, is there a way, how can I say that I apologized to notify me of the disconnection? Or should I go ahead and write a thread wrapper for pyserial?
thank
Chris source
share