Implement protocol on own tracker

thibaud 10 years ago

Hello,

Before all, thanks for this project, it's very amazing what you had done.

I installed the server part on my Rasperry Pi-like (a Banana Pi), and I want to use my own GPS tracker to work with. I built an electronic card, which could connect to the sever through TCP. However, I don't know which protocol use to send data to my server (I'm more electronic than software).

I want to send ID, GPS coordinates, time, battery (% and voltage), and maybe some other infos (like battery car voltage).
Could you advise me to choose a protocol ? Is it just a http request I need to send to log data on my server ?

For now, I could see connexions on the log file, but I don't know how to properly do it.

Thanks for your help (and sorry for the language mistakes)
Thibaud

Anton Tananaev 10 years ago

I would recommend to use following protocol:

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

It's HTTP based and you can add as many parameters as you want.

You can also take a look at some other protocols if you want here:

https://www.traccar.org/protocols/

thibaud 10 years ago

Thanks for your quick response.

I tried to use osmand protocol, after adding a new vehicle with 123456 as id. I used this URL :

http://demo.traccar.org:5055/?id=1234567&lat={43.1557}&lon={-1.5688}&timestamp={2}&hdop={3}&altitude={4}&speed={5}

But it doesn't work, and when I look in the log file, I can see the error :

error - For input string: "{43.1557}" - NumberFormatException (... < OsmAndProtocolDecoder:102 < ExtendedObjectDecoder:58 < ...)

It seems to be the same error as this topic :
https://www.traccar.org/forums/topic/error-for-input-string/

Indeed, I'm using the 3.7 version, while there is a 3.8 version.
Does the problem come from this ?
Do I need to erase this version to install the new one, or can I update automatically ? I think not because I have to install it manually ...

Thanks !
Thibaud

thibaud 10 years ago

In fact, there is no arm version for v3.8 release. Can I still correct the error ? Or should I need to wait the next arm version ?

Anton Tananaev 10 years ago

In your request you should remove curly braces.

There is no need for ARM version, starting from 3.8 Traccar package is universal.

thibaud 10 years ago

I thought I needed curly braces, that must be the problem.
Unfortunately, I tired to install v3.8, by removing /opt/traccar/ folder. This seems to be a mistake : I can connect to the web interface, but when I send an HTTP request, there's nothing in the log file ... I think I broke all ! I'll try to repair it tomorrow.

Thank you Anton !