[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] cleaning up dead FDs
From: |
Brian T (gmail) |
Subject: |
[gpsd-dev] cleaning up dead FDs |
Date: |
Fri, 29 May 2015 11:41:08 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
Hi,
Using GPSd 3.14, if it is told to read TTY device, and then a USB GPS
device is added, and then the USB device is removed, GPSd exits. I had
seen others talk about this but never found an answer. The work around
I found was the attached patch. I had it as a new command line
option, but removed that part after reading the hacking guidelines.
Tested this way:
Device on /dev/ttyS4
gpsdctl add /dev/ttyUSB1
GPSd can be seen polling both devices
Physically remove USB device
GPSd continues processing ttyS4, removes ttyUSB1
Device on /dev/ttyS4
Add device on /dev/ttyUSB1
gpsdctl remove /dev/ttyS4
Physically remove USB device
GPSd waits on select()
gpsdctl add /dev/ttyS4
GPSd starts processing ttyS4, removes ttyUSB1
Insert USB device
gpsdctl add /dev/ttyUSB1
GPSd polls both devices
I did notice that if USB1 is the last device left in the list, and the
USB is pulled, GPSd does not syslog the message it was removed until a
new device (like ttyS4) is added back in. Then the syslog message shows up.
Other than that, is there anything wrong with doing this? I could not
get it to break.
The reason for this is some embedded cellular modules have embedded
GPS. Sometimes the modules reset without notice, so the device is gone
from the USB stack before a udev script can catch it and send a "gpsdctl
remove xxxx", and then GPSd exits.
Thanks!
-Brian
gpsd314_cleanup_fds.patch
Description: Text Data
- [gpsd-dev] cleaning up dead FDs,
Brian T (gmail) <=