/dev/ttyUSB0 spontaneously changes to /dev/ttyUSB1

Chris Adams cmadams at hiwaay.net
Wed Jun 6 00:56:29 UTC 2012


Once upon a time, Jonathan Ryshpan <jonrysh at pacbell.net> said:
> I have a system with a device (a Davis VantagePro2 weather console)
> attached to a USB port.  When the system starts, the device is visible
> as /dev/ttyUSB0.  A wview server attaches to /dev/ttyUSB0 and runs fine
> till suddenly the device disappears from /dev/ttyUSB0 and appears
> as /dev/ttyUSB1, at which time the server fails.  

I've had this happen on occasion (not often) with a GPS receiver used
for NTP.  The reason the reconnected USB device gets a different
node/name is that your service is still connected to the old device
node, so it can't be reused.

Your service should notice that the serial device went away and exit.
I'm not sure if there's a way to have udev run a script or send a signal
when a device goes away.

-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.


More information about the users mailing list