GPS daemon
About
From gpsd website: gpsd is a service daemon that monitors one or more GPSes or AIS receivers attached to a host computer through serial or USB ports, making all data on the location/course/velocity of the sensors available to be queried on TCP port 2947 of the host computer. With gpsd, multiple location-aware client applications (such as navigational and wardriving software) can share access to receivers without contention or loss of data. Also, gpsd responds to queries with a format that is substantially easier to parse than the NMEA 0183 emitted by most GPSes. The gpsd distribution includes a linkable C service library, a C++ wrapper class, and a Python module that developers of gpsd-aware applications can use to encapsulate all communication with gpsd.
Installation
$ make menuconfig
Package Selection for the target ---> Hardware handling / blockdevices and filesystem maintenance ---> [*] gpsd devices/protocol support ---> gpsd features --->
- Let default devices/features if you don't know what they mean.
$ make
- reflash your rootfs
Usage
- gpsd is automatically launched at startup by /etc/init.d/S50gpsd. At first startup you may need to add the following line in the start() method of this script:
# nano /etc/init.d/S50gpsd start() { stty -F /dev/ttySMX4 raw -echo -echoe -echok 38400 <<<<<<<<<<<<-------------- echo -n "Starting $NAME: " start-stop-daemon -S -q -p $PIDFILE --exec $DAEMON -- -P $PIDFILE $DEVICES && echo "OK" || echo "Failed" }
Manual access
- gpsd is a daemon running in background and waiting for client to connect to its TCP port 2947. To check it is well running, you can connect to it with telnet:
# telnet localhost 2947
- then you can give it some commands (more infos here):
?VERSION; {"class":"VERSION","release":"2.94","rev":"2010-06-09T13:27:04","proto_major":3,"proto_minor":2} ?DEVICES; {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttySMX4","activated":1276183248.47,"flags":1,"driver":"Generic NMEA","native":0,"bps":0,"parity":"N","stopbits":1,"cycle":1.00}]} ?POLL; {"class":"POLL","timestamp":1276183453.266,"active":1,"fixes":[{"class":"TPV","tag":"GLL","device":"/dev/ttySMX4","time":1276176096.000,"ept":0.005,"lat":47.239685500,"lon":6.019204667,"alt":268.100,...
Graphical clients
- cgps (ncurses based), installed by default:
# cgps ┌───────────────────────────────────────────┐┌─────────────────────────────────┐ │ Time: 2010-06-10T13:41:26.0Z ││PRN: Elev: Azim: SNR: Used: │ │ Latitude: 47.238710 N ││ 8 07 079 00 N │ │ Longitude: 6.018278 E ││ 9 47 282 29 Y │ │ Altitude: 1055.4 ft ││ 12 10 216 00 N │ │ Speed: 0.7 mph ││ 15 79 194 39 Y │ │ Heading: 265.5 deg (true) ││ 17 00 000 22 N │ │ Climb: 0.0 ft/min ││ 18 00 000 22 N │ │ Status: 3D FIX (43 secs) ││ 26 84 265 25 Y │ │ GPS Type: Generic NMEA ││ 27 61 291 33 Y │ │ Horizontal Err: +/- 83 ft ││ │ │ Vertical Err: +/- 75 ft ││ │ │ Course Err: n/a ││ │ │ Speed Err: +/- 114 mph ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ └───────────────────────────────────────────┘└─────────────────────────────────┘
- Navit, etc....