FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
420 views 0 comments
by anonymous
Good day,

I am trying to run a python script that periodically retrieves a latitude and longitude GPS location on the device. Are there any gsmctl or AT commands that I can use to request the GPS location? Ideally I would like to request, store and publish the answer in a script already running on the device.

Regards,
Francois

1 Answer

0 votes
by anonymous

Hello,

You can use gpsctl command:

Usage: gpsctl [options]
Options:
-h, --help            show usage information
-d, --debug           debug mode
-i, --latitude        get latitude
-x, --longitude       get longitude
-t, --timestamp       get timestamp
-a, --altitude        get altitude
-v, --speed           get speed
-p, --satellites      get satellite count
-g, --angle           get angle
-s, --status          get fix status
-u, --accuracy        get accuracy
-e, --datetime        get datetime (YYYY-MM-DD HH:MM:SS)
Alternatively, you can configure your gateway as a MODBUSTCP slave and retrieve GPS values by configuring MODBUS requests. GPS data is stored in registers 144 to 184. For more details refer here. MODBUS has a database, which can store up to 20k records. The router can then be configured to send these records with certain periodicity to some external host/server using Data to server functionality. 
A couple of configuration examples with third party cloud platforms as MQTT brokers: Flespi (instructions) or AWS (instructions).
Best regards,