Traccar Client auf Raspberry Pi

RainerS8 years ago

Hallo Traccar Gemeinde,

folgendes Projekt möchte ich gerne umsetzen.
Raspberry PI mit GPS Modul und UMTS Stick im Auto sollte die aktuelle Position an Traccar Server senden.
Das GPS Modul habe ich konfiguriert und auch die UMTS Verbindung.
Der Server bekommt die Daten kann diese aber anscheinend nicht verarbeiten.
In der log Datei des Servers werde diese als empfangen angezeigt.

Ich habe bereits seit einem Jahr einen TK5000 im Einsatz welcher die Daten in folgendem Format an den Server sendet. (IP und Hex Code unkenntlich gemacht)
2016-03-07 14:34:12 DEBUG: [511D9918: 5032 < 89.204..] HEX: *******************************************
laut Hex Decoder ergibt dies: 1000000001,20160307214049,Longitude,Latitude,4,334,122,6,2
Im einzelnen bedeuten diese Werte: ID des Gerätes, Datum/Zeit, Longitude, Latitude, Speed, ???, Altitude, Anzahl Satelliten, ???

Liegen ich mit dieser Annahme richtig bzw. was bedeuten die Fragezeichen?

In einem Python script habe ich nun die Infos welche durch GPSD zur Verfügung gestellt werden in folgendes Format konvertiert:
1000000002,20160307214742,Longitude,Latitude,0.28,334,116.8,5,3
Die unbekannten Werte habe ich einfach durch Werte des TK5000 ersetzt.
Beim Server kommt dann folgendes an
2016-03-07 22:47:45 DEBUG: [905C9017: 5032 < 10.75..] HEX: *********************
Der Hex Code ergibt laut Hex Decoder auch den gewünschten String, allerdings kann der Traccar Server diese Wert nicht dem Device in der GUI zuordnen (Id´s stimmen überein)
IP ist privat da ein VPN Tunnel aufgebaut wurde.

In welchem Format muss der Server den String empfangen und welchen Port nutze ich dafür am Besten?

Viele Grüße
Rainer

Anton Tananaev8 years ago

There is an old third party project available that might be useful for you:

https://github.com/liske/tralnx

If you provide English translation of the post, I can try to answer your questions.

RainerS8 years ago

Hi Anton,

sorry für my bad Englisch...

next project I would like to implement.
Raspberry PI with GPS module and UMTS stick in the car should send the current position to Traccar Server.
The GPS module and the UMTS connection are configured.
The server receives the data but can not process it.

In the log file of the server Traccar this data is received.

For a year I use a TK5000, which sends the data in the format to the server. (IP and Hex Code defaced)
2016-03-07 14:34:12 DEBUG: [511D9918: 5032 <89 204 *** ***..] HEX: ********************* **********************
according Hex decoder gives: 1000000001.20160307214049, Longitude, Latitude, 4,334,122,6,2

(ID of the device, date / time, longitude, latitude, speed, ???, Altitude, number of satellites, ???)

Is my information correct?
What are the question mark?

In a Python script I now have the information to be provided by which GPSD available converted to the following format:
1000000002.20160307214742, Longitude, Latitude, 0.28,334,116.8,5,3

The unknown values ​​I have replaced by values ​​of the TK5000.
The Traccar server receives the following data
2016-03-07 22:47:45 DEBUG: [905C9017: 5032 <10.75 ** **..] HEX: *********************
The Hex decoder decodes the hex code in the correct format. The Traccar Server shows the values ​​not in the GUI (IDs match)
IP is private because a VPN tunnel has been established.

In what format the server needs the string received and which port I use it best?

Anton Tananaev8 years ago

Your TK5000 seems to be using Wondex protocol. You can find documentation here:

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

If you want to implement some protocol, this one would be the easiest one for you:

https://www.traccar.org/traccar-client-protocol/

Also take a look at the link from my previous comment. You can just use that possibly with some modifications.

RainerS8 years ago

Hey Anton,

many thanks for this link. It works perfectly!

RainerS8 years ago

Hi Anton,

a problem I have.
How can I tranlxd autostart after reboot.

In sudo crontab -e

@reboot sleep 60 && /home/pi/GPS/tralnx/tralnxd

it does not work

Normally start at commandline with
sudo /home/pi/GPS/tralnx/tralnxd

Anton Tananaev8 years ago

I would recommend to Google an answer or check on Stack Overflow. I'm not sure what's the right way of adding it into the auto-start.

rubensx8 years ago

Hi RainerS, You have created a raspberry pi client to traccar?

you have the code or the app to as you using?

thank you