
nad at acm
Nov 8, 2009, 12:21 PM
Post #2 of 2
(44 views)
Permalink
|
|
Re: pyserial vs. Linux power save hibernate/resume - program hangs
[In reply to]
|
|
In article <4af71b7e$0$1645$742ec2ed[at]news.sonic.net>, John Nagle <nagle[at]animats.com> wrote: > 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. If your Linux is new enough, you should be able to create a permanent device name for the serial converter using a udev rule. Then your code won't need to be dependent on the /dev/ttyUSBx device name. -- Ned Deily, nad[at]acm.org -- http://mail.python.org/mailman/listinfo/python-list
|