-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I have investigated the following GPS related AT commands for the modem Fibocom NL687-E
AT+GPSCFG=20,180,9999999,1,2,7
QOS_T: (1-100)
QOS_ST: (1-255)
Num_fix: (1-9999999)
Time_fix: (1-65535)
Session_type: (0-5)
Svc_type: (1-7)
AT+GPSCFG?
+GPSCFG:QOS_T:20,QOS_ST:180,Num_fix:9999999,Time_fix:1000,Session_type:2,Svc_type:7,
AT+GTAGPSSERV: (<IP/URL>),(1-65535)
AT+GTGPSSET (always ERROR)
AT+GPSMODE: (0-7)
AT+GPSMODE?
+GPSMODE:0
AT+GTGPSEPO: (0-1)
AT+GTGPSEPO?
+GTGPSEPO:1
AT+GPSSTART (always ERROR)
AT+GPSEND
AT+GTGPSPOWER: (0-1)
AT+GTGPS:"RMC","GGA","GSA","GSV","GST"
The default USB mode is 17 (AT+GTUSBMODE=17): Diag (ttyUSB0)+Modem (ttyUSB1)+AT (ttyUSB2)+NMEA (ttyUSB2)+RMNET+ADB. Note it is possible to read the firmware content via ADB interface. ttyUSB1, ttyUSB2 and ttyUSB3 work the same way. You can submit AT commands to any port and get a response.
AT+GPSSTART does not work.
AT+GTGPSPOWER=1 activates the GPS.
AT+GTGPSPOWER=0 or AT+GPSEND deactivates the GPS.
I have no idea how to enable the output to NMEA port. But it is possible to request NMEA messages using the following commands:
AT+GTGPS="RMC"
AT+GTGPS="GGA"
AT+GTGPS="GSA"
AT+GTGPS="GSV"
AT+GTGPS="GST"
The response looks like
GTGPS:
$GPRMC,,V,,,,,,,,,,N*53
OK
Or AT+GTGPS? requests all messages at once
+GTGPS:
$GPRMC,,V,,,,,,,,,,N*53
$GPGGA,,,,,,0,,,,,,,,*66
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,4,1,16,02,,,26,04,,,28,07,,,28,08,,,29*7D
$GPGSV,4,2,16,09,,,28,10,,,27,11,,,27,12,,,29*72
$GPGSV,4,3,16,13,,,28,15,,,29,20,,,27,22,,,27*7C
$GPGSV,4,4,16,23,,,30,24,,,29,25,,,31,26,,,26*74
$PQGSV,1,1,02,01,,,28,02,,,31,0,5*63
OK
Note usually a modem sends a lot of messages to NMEA port. These messages may be almost the same for different types ($GPGSV for GPS, $GLGSV for Glonass, $GAGSV for Galileo, $PQGSV for Beidou). If the modem is well documented it is possible to enable only useful/supported messages and reduce a SPAM on the NMEA port and the CPU load.
I propose to implement on-demand mode. GPoint already has a timer to send the data to traccar or other server each few seconds.
It is possible to request only necessary data each few seconds.
To support Fibocom NL687-E it is enough to activate GPS by AT+GTGPSPOWER=1 and request AT+GTGPS="RMC" and AT+GTGPS="GGA" periodically.
Note the modem MeiGLink SLM828 has the following commands for such requests:
AT+GPSGNMEA="GGA"
AT+GPSGNMEA="RMC"
AT+GPSGNMEA="GSV"
AT+GPSGNMEA="GSA"
AT+GPSGNMEA="VTG"
AT+GPSGNMEA="GNS"
The response looks like
+GPSGNMEA:$GPRMC,215243.00,A,3203.6311,N,7671.4525,E,0.0,242.9,211025,10.2,E,A,V*7E
OK
There is also a simple request AT+GPSLOC=2 which returns almost $GPRMC:
+GPSLOC:215204.00,32.036311,N,76.714525,E,0.900000,129.992676,3,0.000000,0.000000,0.000000,211025,11
OK
or the following if coordinates are unavailable:
+GPSLOC:000000.00,-0.000000,S,-0.000000,W,0.000000,0.000000,0,0.000000,0.000000,0.000000,01010-3,0
OK
Note EOL may be very different. So I recommand to apply the patch from #38 to support any combinations of \r and \n.
On-demand mode can reduce the CPU load a lot.
It is simple because you need only 1 TTY port to send commands and get responses. And the port is not locked all the time.
What do you think?