pyserial vs. Linux power save hibernate/resume - program hangs

John Nagle nagle at animats.com
Sun Nov 8 20:36:33 CET 2009


    I have an application running with pyserial talking to a USB to serial
converter on a Linux EeePC 2G Surf.  This works.  Until the lid on the PC is
closed and the device suspends.

    The application has /dev/ttyUSB0 open, and has a read pending
with a 1 second timeout.   When the device comes out of suspend,
the USB devices are enumerated again.  The serial device moves
to /dev/ttyUSB1, and the application continues to poll /dev/ttyUSB0.
No error results from polling the removed device.  So the
application is stuck and doesn't know it.

    An attempt to write to the disconnected serial port produces
an IOError exception, but the read side doesn't seem to notice.

    Any ideas?

					John Nagle



More information about the Python-list mailing list