Changes between Initial Version and Version 1 of OpenWrt/GPS

10/22/2017 05:28:45 AM (5 years ago)



  • OpenWrt/GPS

    v1 v1  
     3'''For a more general overview of our GPS modules, please see our [wiki:gps Main GPS Page] for more information.'''
     5= Hardware Mappings =
     6Please see [wiki:gps this] page for which serial port the GPS is on
     9= OpenWrt GPS configuration and GPSD =
     10OpenWrt supports the popular opensource {{{gpsd}}} application:
     12The configuration for gpsd is stored in {{{/etc/config/gpsd}}} and accessible via {{{uci}}}:
     14uci show gpsd
     17One must configure the following.
     18 1. The port is typically 2947 but can be changed if desired
     19 2. device is where the GPS chip is mapped on the board, please see the [wiki:OpenWrt/GPS#HardwareMappings Hardware Mappings] above
     20 3. To test {{{gpsd}}} from an external computer, you will need to set the {{{listen_globally}}} variable to {{{true}}}. Modify it using a editor like {{{vi}}} or {{{uci}}} commands.
     22Example output:
     24root@OpenWrt:/# uci show gpsd
     32{{{gpsd}}} is a '''service''' and therefore can be started and stopped with the standard commands.
     34/etc/init.d/gpsd start
     37To verify the GPS data output, you can {{{cat}}} the serial port that the GPS is mapped on. For example, on the GW2388, the GPS is mapped to COM2 port (ttyS2): '''Please view product manual for correct port or [wiki:OpenWrt/GPS#HardwareMappings Hardware Mappings] above'''
     39'''Note''': ''Ventana may spit out binary OSP mode''
     42root@OpenWrt:/# stty -F /dev/ttyS2 4800 ;# set baudrate to 4800bps, also possibly 9600
     43root@OpenWrt:/# cat /dev/ttyS2
     52You can also install a {{{gpsd}}} client such as {{{xgps}}} and test it via an external PC.
     54Example shown below has a Gateworks board at on the network.  A Linux Desktop PC is running at and has {{{xgps}}} installed:
     60For a '''Windows''' client, please search on Google and refer to the gpsd page where it lists:
     62Applications that presently use gpsd include pyGPS, gpsdrive, Kismet, GPSdrive, gpeGPS, position, roadmap, roadnav, navit, viking, tangogps, foxtrot, opencpn, obdgpslogger, geohist, LiveGPS, geoclue, qlandkartegt, gpredict, OpenCPN, gpsd-navigator, gpsd-ais-viewer, and firefox/mozilla.
     66= Hardware-specific init scripts =
     67Some hardware may require configuration each time you boot that you likely want place in an init-script.  For example:
     68 * specific AT commands to enable/configure NMEA mode
     69 * software controlled USB steering (for boards that route USB to front-panel by default but need to have USB routed to PCIe slot for a PCIe USB modem with GPS support)
     72== Option Globetrotter GTM671WFS ==
     73The Option Globetrotter modules combine multiple features into a single device.  The GPS module on supported devices has a serial port to control/configure the GPS and another serial port to obtain data from the GPS.  By default the data port does not display NMEA messages and must be enabled with the following AT commands:
     79An OpenWrt init script can be created for performing this on bootup.  Here we add a UCI configuration {{{ctrl_device}}} to the gpsd configuration to describe the configuration serial port:
     80 * create and enable a gps init script
     82cat << EOF > /etc/init.d/option_gps_init
     83#!/bin/sh /etc/rc.common
     84# Copyright (C) 2009
     87boot() {
     88    config_load gpsd
     89    config_get ctrl_device core ctrl_device
     90    [ "\$ctrl_device" ] || exit
     91    logger -t "gps" "Initializing GPS on \$ctrl_device"
     92    echo -e -n "AT_OGPSMODE=1\015" > \$ctrl_device
     93    echo -e -n "AT_OGPS=2\015" > \$ctrl_device
     96chmod +x /etc/init.d/option_gps_init
     97/etc/init.d/option_gps_init enable
     99 * specify UCI config used by the init script above:
     101uci set gpsd.core.device=/dev/ttyHS1
     102uci set gpsd.core.ctrl_device=/dev/ttyHS2
     103uci set gpsd.core.enabled=true
     104uci commit
     106 * and make sure gpsd is enabled on boot:
     108/etc/init.d/gpsd enable