We help IT Professionals succeed at work.
Troubleshooting Question

About GPS, how to send LAT, LONG to the center?

112 Views
Last Modified: 2020-08-11
Hi All,

I have used a GPS & 4G module (QUECTE EC21-EC), it is mounted on the device and runs OpenWRT.
1 / For 4G, it works OK
2 / For GPS, I don't know if there are any missing commands (I also have used some command lines), even though I have searched for some guide information available on Google. I need your help:
- How do I use the command line to send LAT, LONG to the central system?
- Or do I have to do anything else for this?

Thanks in advance,

LDVHAI.
Comment
Watch Question

nociSoftware Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Most GPS devices provide or emulate a serial port. the gpsd (gps daemon) can be used to capture the traffic and dispatch it to other tools.
https://gpsd.gitlab.io/gpsd/

Andrew Hancock (VMware vExpert PRO / EE Fellow)VMware and Virtualization Consultant
CERTIFIED EXPERT
Fellow
Expert of the Year 2017

Commented:
Usually, the GPS chip is connected to a UART (serial device) and sends data continuously as a data stream by the NMEA protocol. (can be changed to other protocols, e.g. SIRF) but the default is usually NMEA.

9600 baud 8 bits, No Parity, and 1 stop bit <-- default

There will be a few sentences which contain the LAT and LON.

$GPGLL is one such sentence string, which will show the LAT and LON, you'll only get a LAT and LONG when there is a GPS FIX.

So simply using a terminal will show the data.
nociSoftware Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
For NMEA here is a fairly complete reference: https://www.gpsinformation.org/dale/nmea.htm 
Besides all the standard phrases some devices have specific phrases they work with.

If your kernel is compiled with the right modules it should even be supported see specsheet: https://www.quectel.com/UploadFile/Product/Quectel_EC21_LTE_Specification_V1.8.pdf 
I am not sure if the openwrt kernel has the required module available. The device is mentioned in the usb serial driver.
aswell as in the qmi_wwan driver (3G/LTE/).

For USB serial devices check if the is a /dev/ttyUSB* or /dev/ttyACM* device.
Duncan RoeSoftware Developer
CERTIFIED EXPERT

Commented:
At my last job, we always used the RMC messages ($GPRMC usually, but we had one Russian(?) modem that sent $GRRMC).

Author

Commented:
Thanks for your answer.
I wait for 15 minutes, move the GPS antenna in outside, change adapter power. It gets error 516.
Please help me fix this issue.
Thank you very much.

Andrew Hancock (VMware vExpert PRO / EE Fellow)VMware and Virtualization Consultant
CERTIFIED EXPERT
Fellow
Expert of the Year 2017

Commented:
15 minutes is not long enough depending upon time of day and if this a cold power up it can take up to 1 hour to establish a fix and download the GPS database also depends on your location location of antenna any obstructions type of GPS receiver etc

what model is it from where there is no fix from that output

be careful if purchasing from eBay or Amazon there are lots of fakes!!!
Duncan RoeSoftware Developer
CERTIFIED EXPERT

Commented:
If you need to download the almanac from the satellite then certainly it will take a long time, as Andrew Hancock posted. If your GPS is part of a cell phone modem then it can take a lot less time because your telco can supply the almanac. I think that's called assisted GPS but it's been a while since I worked on this stuff. You may have to configure that - consult your modem manufacturer's documentation (ours was Sierra Wireless, and they had a ton of good stuff).
nociSoftware Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Not exactly A-GPS, that is using fixed landbased base station to also send a GPS signal and can compensate for slight errors due to atmospheric changes, or bad reception.
https://en.wikipedia.org/wiki/Assisted_GPS

The AGPS data needed to know you landbased station also has Orbital data for GPS so it is usable.
Often used GPS chipset: https://en.wikipedia.org/wiki/GpsOne

This should be the command to set it.
ALM - GPS Almanac Data contains GPS week number, satellite health and the complete almanac data for one satellite. Multiple messages may be transmitted, one for each satellite in the GPS constellation, up to maximum of 32 messages. Note that these sentences can take a long time to send so they are not generally sent automatically by the gps receiver. (Sorry I don't have an exact example of the sentence.) Note that this sentence breaks the 80 character rule. Also note that this sentence is often accepted as input so that you can preload a new almanac in a receiver.
     $GPALM,A.B,C.D,E,F,hh,hhhh,...

Where:
       ALM   Almanac Data being sent
       A     Total number of messages
       B     Message number
       C     Satellite PRN number
       D     GPS week number (0-1023) 
       E     Satellite health (bits 17-24 of message)
       F     eccentricity
       hh    t index OA, almanac reference time
       hhhh  sigma index 1, inclination angle
       ...   OMEGADOT rate of right ascension
             SQRA(A) root of semi-major axis
             Omega, argument of perigee
             Omega index 0, longitude of ascension node
             M index 0, mean anomaly
             a index f0, clock parameter
             a index f1, clock parameter
Then you also need a source for the orbital data.
https://glonass-iac.ru/en/GPS/ephemeris.php
nociSoftware Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.