====== GPS Feature ====== The GPS Signal can be obtained and used via different ways: * Webinterface * GPS over IP * cli status interface * inside of SDK Skripts * SNMP ====== Webinterface ====== The Webinterface gives you access to the GPS Data. This can be suitable to have a quick look on the current status of a vehicle. ===== Status Page ===== Via Status->GNSS you will see this Overview {{ :configuration:screenshot_-_130516_-_13_57_52.png?nolink |}} ===== Interface Page ===== Via Interfaces->GNSS you will see this Map {{ :configuration:screenshot_-_130516_-_13_51_36.png?nolink |}} ====== Data format NMEA-0183 ====== source: http://freenmea.net/docs **NMEA-0183 prefixes (Talker IDs)** NMEA protocol can be sent by different equipment. It can be identified by so called Talker Id. Most known one is, of course $GP_ - GPS. * GA - Galileo * GL - GLONASS Receiver * GP - Global Positioning System (GPS) * GN - Global Navigation Satellite System (GNSS), combined services ====== GPS over IP ====== We use version 3.9 of [[http://www.catb.org/gpsd/index.html | gpsd]] as a GPS via IP Daemon We support the following modes: * on request (clients must send R after connect to get NMEA frames) * in raw mode (clients are served directly with NMEA frames after connection) * in super raw mode (clients are served directly with NMEA frames after connection) * in JSON mode (the new JSON interface is provided to clients after connection) // get JSON ?WATCH={'enable':true,'json':true} // get NMEA ?WATCH={'enable':true,'json':false} ?WATCH={'enable':true,'nmea':true} ?WATCH={'enable':true} For more information on the new JSON interface see [[http://www.catb.org/gpsd/client-howto.html]] telnet nb 2947 Trying 192.168.1.1... Connected to nb. Escape character is '^]'. {"class":"VERSION","release":"3.15","rev":"3.15","proto_major":3,"proto_minor":11} ?WATCH={"enable":false,"nmea":true} {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyUSB1","driver":"NMEA0183","activated":"2018-11-10T20:28:27.019Z","flags":1,"native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]} {"class":"WATCH","enable":false,"json":false,"nmea":true,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false} ?WATCH={"enable":true} {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyUSB1","driver":"NMEA0183","activated":"2018-11-10T20:28:32.020Z","flags":1,"native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]} {"class":"WATCH","enable":true,"json":false,"nmea":true,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false} $GLGSV,3,1,09,78,02,045,37,70,70,292,31,73,09,226,39,80,68,236,26*69 $GLGSV,3,2,09,79,52,040,24,69,41,158,23,88,10,040,21,87,10,355,19*62 $GLGSV,3,3,09,71,20,323,23*5B $GPGSV,4,1,14,05,31,198,45,07,06,070,36,08,07,025,30,13,80,302,33*7C $GPGSV,4,2,14,15,43,295,48,17,01,129,36,20,05,327,30,21,04,300,37*71 $GPGSV,4,3,14,24,10,254,36,28,57,098,32,30,38,068,39,,,,39*44 $GPGSV,4,4,14,38,27,209,33,49,31,184,45*7A $GPGGA,102924.0,5008.019319,N,00834.241599,E,1,09,0.7,238.6,M,48.0,M,,*5E $GNGNS,102924.0,5008.019319,N,00834.241599,E,AAN,12,0.7,238.6,48.0,,*2E $GPVTG,240.2,T,240.7,M,0.0,N,0.0,K,A*26 $GPRMC,102924.0,A,5008.019319,N,00834.241599,E,0.0,240.2,280219,0.5,W,A*19 $GPGSA,A,2,05,08,13,15,20,21,24,28,30,,,,0.9,0.7,0.6*3E $GNGSA,A,2,05,08,13,15,20,21,24,28,30,,,,0.9,0.7,0.6,1*3D $GNGSA,A,2,70,73,80,,,,,,,,,,0.9,0.7,0.6,2*30 $GNGSA,A,2,219,221,222,227,228,,,,,,,,0.9,0.7,0.6*13 $GNGSA,A,2,,,,,,,,,,,,,0.9,0.7,0.6,3*3A $GLGSV,3,1,09,78,02,045,37,70,70,292,31,73,09,226,39,80,68,236,27*68 $GLGSV,3,2,09,79,52,040,24,69,41,158,23,88,10,040,21,87,10,355,26*6E $GLGSV,3,3,09,71,20,323,21*59 $GPGSV,4,1,14,05,31,198,45,07,06,070,35,08,07,025,33,13,80,302,34*7B $GPGSV,4,2,14,15,43,295,48,17,01,129,36,20,05,327,30,21,04,300,37*71 $GPGSV,4,3,14,24,10,254,36,28,57,098,31,30,38,068,39,,,,39*47 $GPGSV,4,4,14,38,27,209,34,49,31,184,45*7D $GPGGA,102925.0,5008.019336,N,00834.241660,E,1,10,0.6,238.6,M,48.0,M,,*5E $GNGNS,102925.0,5008.019336,N,00834.241660,E,AAN,14,0.6,238.6,48.0,,*20 $GPVTG,240.2,T,240.7,M,0.0,N,0.0,K,A*26 $GPRMC,102925.0,A,5008.019336,N,00834.241660,E,0.0,240.2,280219,0.5,W,A*10 $GPGSA,A,2,05,07,08,13,15,20,21,24,28,30,,,0.9,0.6,0.6*38 $GNGSA,A,2,05,07,08,13,15,20,21,24,28,30,,,0.9,0.6,0.6,1*3B $GNGSA,A,2,70,73,80,87,,,,,,,,,0.9,0.6,0.6,2*3E $GNGSA,A,2,219,221,222,227,228,,,,,,,,0.9,0.6,0.6*12 $GNGSA,A,2,,,,,,,,,,,,,0.9,0.6,0.6,3*3B $GLGSV,3,1,09,78,02,045,37,70,70,292,31,73,09,226,38,80,68,236,25*6B $GLGSV,3,2,09,79,52,040,24,69,41,158,23,88,10,040,21,87,10,355,26*6E $GLGSV,3,3,09,71,20,323,21*59 $GPGSV,4,1,14,05,31,198,46,07,06,070,31,08,07,025,31,13,80,302,34*7E $GPGSV,4,2,14,15,43,295,48,17,01,129,36,20,05,327,30,21,04,300,37*71 $GPGSV,4,3,14,24,10,254,36,28,57,098,31,30,38,068,39,,,,39*47 $GPGSV,4,4,14,38,27,209,34,49,31,184,45*7D $GPGGA,102926.0,5008.019356,N,00834.241727,E,1,09,0.6,238.5,M,48.0,M,,*52 $GNGNS,102926.0,5008.019356,N,00834.241727,E,AAN,13,0.6,238.5,48.0,,*23 $GPVTG,240.2,T,240.7,M,0.0,N,0.0,K,A*26 $GPRMC,102926.0,A,5008.019356,N,00834.241727,E,0.0,240.2,280219,0.5,W,A*17 $GPGSA,A,2,05,08,13,15,20,21,24,28,30,,,,0.9,0.6,0.6*3F $GNGSA,A,2,05,08,13,15,20,21,24,28,30,,,,0.9,0.6,0.6,1*3C $GNGSA,A,2,70,73,80,87,,,,,,,,,0.9,0.6,0.6,2*3E $GNGSA,A,2,219,221,222,227,228,,,,,,,,0.9,0.6,0.6*12 $GNGSA,A,2,,,,,,,,,,,,,0.9,0.6,0.6,3*3B ==== Clients ==== Linux clients are ''cgps'', ''gpsmon'' and ''gpspipe.'' You can install them via ''apt-get install gpsd-clients'' To see the NMEA Data you can also use any telnet emulator of your choice: ''putty'', ''hyperterminal'' etc. ====== cli status interface ====== The Command Line Interface can be used via telnet, ssh or serial terminal access. With the command "**cli status gnss**" you will seethe current gps data. cli status gnss === GNSS MODULE INFORMATION === GNSS1 module type: me909 GNSS1 module info: Manufacturer: Huawei Technologies Co., Ltd. . Model: ME909u-521 . Revision: 11.235.07.00.00 . IMEI: 860461024127634 . +GCAP: +CGSM GNNS1 system: GPS GNSS1 signal: present GNNS1 last fix: 2016-05-08 03:39:55 GNSS1 latitude: 50.134290 GNSS1 longitude: 8.572818 GNSS1 altitude: 146.80 GNSS1 horizontal speed: 0.000 GNSS1 vertical speed: 0.000 GNSS1 hdop: 6.20 GNSS1 vdop: 1.00 GNSS1 pdop: 6.30 GNSS1 satellites inview: 12 GNSS1 satellites used: 3 To have it in the right format for using inside of scripts (bash, python etc.) you can use the parameter "-s" cli status -s gnss GNSS1_MODULE_TYPE="me909" GNSS1_MODULE_INFO="Manufacturer: Huawei Technologies Co., Ltd. Model: ME909u-521 Revision: 11.235.07.00.00 IMEI: 860461024127634 +GCAP: +CGSM" GNNS1_SYSTEM="GPS" GNSS1_SIGNAL="present" GNNS1_LAST_FIX="2016-05-08 03:40:43" GNSS1_LATITUDE="50.134291" GNSS1_LONGITUDE="8.572819" GNSS1_ALTITUDE="146.80" GNSS1_HORIZONTAL_SPEED="0.000" GNSS1_VERTICAL_SPEED="0.000" GNSS1_HDOP="500.00" GNSS1_VDOP="500.00" GNSS1_PDOP="500.00" GNSS1_SATELLITES_INVIEW="12" GNSS1_SATELLITES_USED="3" ====== SDK Scripts ====== Within the SDK you can reach the gps data by requesting the status parameter as in the cli example or you can retrieve the data from the gps over IP daemon to distribute it further. Cli data can be retrieved as follows: status=nb_status("gnss"); dump(status); Result: struct(15): { .GNSS1_MODULE_TYPE = string[5]: "me909" .GNSS1_MODULE_INFO = string[126]: "Manufacturer: Huawei Technologies Co., Ltd. Model: ME909u-521 Revision: 11.235.07.00.00 IMEI: 860461024127634 +GCAP: +CGSM" .GNSS1_LONGITUDE = string[8]: "8.572821" .GNSS1_HDOP = string[4]: "6.00" .GNNS1_SYSTEM = string[3]: "GPS" .GNSS1_VDOP = string[4]: "0.90" .GNSS1_LATITUDE = string[9]: "50.134294" .GNNS1_LAST_FIX = string[19]: "2016-05-08 03:42:16" .GNSS1_ALTITUDE = string[6]: "146.90" .GNSS1_PDOP = string[4]: "6.00" .GNSS1_SATELLITES_USED = string[1]: "4" .GNSS1_VERTICAL_SPEED = string[5]: "0.000" .GNSS1_SATELLITES_INVIEW = string[2]: "12" .GNSS1_SIGNAL = string[7]: "present" .GNSS1_HORIZONTAL_SPEED = string[5]: "0.000" } ==== SNMP ==== It's possible to poll the postition via SNMP. You will find the entries "gnssLat" latitude and "gnssLon" longitude in the private MIB. Please be aware that the update interval will be 3s. ===== Example Scripts ===== * Sending NMEA String on the serial interface: [[sdk:gps2serial]] * Forward NMEA String to a UDP Server: [[sdk:scripts:gps-udp-client]] * Enable/Disable WLAN depending on the current position: [[sdk:scripts:gps-monitor]] * Creating CSV Logfiles with location data: [[sdk:connection-statistics]]