Implementing a standard GPS communication protocol in Python

sebi53615 years ago

I have a A9G development board, a board with GPS and GPRS features, that runs MicroPython (Python for MCUs) thanks to this work.

My goal is to implement a standard GPS communication protocol in python to interface the board with Traccar.

Thanks,

Anton Tananaev5 years ago

I think the simplest option would be OsmAnd:

https://www.traccar.org/osmand/

It's a unidirectional HTTP-based protocol.

sebi53615 years ago

Neat! Thanks!!

sebi53615 years ago

Anton, just a subsidiary question:
When do you plan to release the replay feature?
(I have seen this is WIP in GitHub.)

Anton Tananaev5 years ago

Where did you see it?

sebi53615 years ago

https://github.com/traccar/traccar/issues/2053#issuecomment-325120383
Any chance to see this feature soon?
It would be neat to visualize previous routes, not only real-time routes.

Anton Tananaev5 years ago

There is a report to visualize previous routes. I don't really understand what "replay" adds over existing report.

sebi53615 years ago

Indeed, sorry I missed that feature.
(Looking at the bottom right to find the icon is not that natural to me...)
Thanks!

Is there the possibility to see the evolution in time of the position(s)?

sebi53615 years ago

I played a bit with the interface and find it really good the way it is.
Thank you!

sebi53615 years ago

For people curious to know how the MicroPython code running on the A9G board looks like:

import cellular
import gps
import socket

ID = 1234567 # Same arbitrary number as in Traccar
url = "demo.traccar.org"
port = 5055

cellular.gprs("internet", "", "") # Adjust with your APN credentials

gps.on()
loc = gps.get_location()

s = socket.socket()
s.connect((url, port))
s.send(bytes('POST /?id={}&lat={}&lon={} HTTP/1.1\r\nHost: {}:{}\r\n\r\n'.format(ID, loc[0], loc[1], url, port), 'utf8'))
s.recv(50) # Should be b'HTTP/1.1 200 OK\r\ncontent-length: 0\r\n\r\n'
s.close()

cellular.gprs(False)
hariro9 months ago

what is the update time or how can it be set