Server not decoding data from device

Neth 2 years ago

Hi all,

I am trying to connect my ST-901L-4G tracker from Sinotrack to Traccar server that I set up on my own Linux server. According to logs the server receives the messages with GPS coordinates in the time interval that I set up on device but they are not decoded. Weird thing is, sometimes they do get decoded - I can see cordinates successfully decoded for a couple of messages after connection sometimes but then it stops and all I get are HEX coded strings again. Can somebody help me with this, please?

The tracker is configured to send data to port 5013.

iptables:

ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:8082
ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:5013

(with relevant ports open on network as well, other server applications are communicating no problem)

config.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
<properties>

    <!-- Documentation: https://www.traccar.org/configuration-file/ -->

    <entry key='database.driver'>org.h2.Driver</entry>
    <entry key='database.url'>jdbc:h2:./data/database</entry>
    <entry key='database.user'>[name]</entry>
    <entry key='database.password'>[pass]</entry>
    <entry key='notificator.types'>traccar</entry>
    <entry key='notificator.traccar.key'>[my_key]</entry>
    <entry key='decoder.timezone'>UTC</entry>

</properties>

log with decoded messages:

2024-07-06 16:49:45  INFO: [Tf96a3cfa] id: 8888888888, time: 2024-07-06 16:49:43, lat: 99.99999, lon: 99.99999, course: 203.0
2024-07-06 16:49:45  INFO: [Tf96a3cfa: h02 > 255.255.255.255] 2a48512c383838383838383838382c56342c56312c323032343037303631343439343523
2024-07-06 16:51:15  INFO: [Tf96a3cfa: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3134353131332c412c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3230332c3036303732342c46464637464242462c3233312c30332c31302c31353032373323
2024-07-06 16:51:15  INFO: [Tf96a3cfa] id: 8888888888, time: 2024-07-06 16:51:13, lat: 99.99999, lon: 99.99999, course: 203.0
2024-07-06 16:51:15  INFO: [Tf96a3cfa: h02 > 255.255.255.255] 2a48512c383838383838383838382c56342c56312c323032343037303631343531313523
2024-07-06 16:51:46  INFO: [Tf96a3cfa: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3134353134342c412c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3230332c3036303732342c46464637464246462c3233312c30332c31302c31353032373323

log where nothing gets decoded:

2024-07-06 19:12:17  INFO: Event id: 8888888888, time: 2024-07-06 19:12:17, type: deviceOnline, notifications: 1
2024-07-06 19:12:18  INFO: [T77dd1faa: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3137313135302c412c393939392e393939392c4e2c39393939392e393939392c452c3030302e32332c3030302c3036303732342c46424646444646462c3233312c30332c31302c31393633353423
2024-07-06 19:12:19  INFO: [T77dd1faa: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3137313230312c412c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3030302c3036303732342c46424646444646462c3233312c30332c31302c31393633353423

Thanks!

Cristian 2 years ago

did you try port 5015?

Anton Tananaev 2 years ago

Trying different port won't help here. You have to check the full connection session. Most likely there's a binary message with non standard length.

Neth 2 years ago

Thanks for the replies! I have tried port 5015, no difference there.

Anton I see there one message with non-standard length but it's HEX just like the rest of them and it looks like standard H02 message, just with some assitional attributes. Did you mean this? What can I do to make the decoder work correctly? In the documentation I don't see any Config.xml entries that would look helpful.

Full log of single connection session:

2024-07-07 10:35:40  INFO: [Tbe22305d] connected
2024-07-07 10:35:41  INFO: [Tbe22305d: h02 < 255.255.255.255] 2a48512c383838383838383838382c56362c3030303033332c562c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3030302c3031303132302c46464646444646462c3233312c30332c31302c3139363335342c383934323130333131303031343836363337384623
2024-07-07 10:35:41  INFO: Event id: 8888888888, time: 2024-07-07 10:35:41, type: deviceOnline, notifications: 1
2024-07-07 10:35:41  INFO: [Tbe22305d: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3030303031342c562c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3030302c3031303132302c46464646444646462c3030302c30302c30303030302c3030303023
2024-07-07 10:35:42  INFO: [Tbe22305d: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3030303033322c562c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3030302c3031303132302c46424646444646462c3233312c30332c31302c31393633353423
2024-07-07 10:35:49  INFO: [Tbe22305d: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3038333534392c562c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3030302c3037303732342c46464646444646462c3233312c30332c31302c31393633353423
2024-07-07 10:36:00  INFO: [Tbe22305d: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3038333630302c562c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3030302c3037303732342c46464646444646462c3233312c30332c31302c31393633353423
2024-07-07 10:36:11  INFO: [Tbe22305d: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3038333630392c412c393939392e393939392c4e2c39393939392e393939392c452c3030302e30342c3030302c3037303732342c46464646444646462c3233312c30332c31302c31393633353423
2024-07-07 10:36:22  INFO: [Tbe22305d: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3038333632302c412c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3030302c3037303732342c46464646444646462c3233312c30332c31302c31393633353423
2024-07-07 10:36:32  INFO: [Tbe22305d: h02 < 255.255.255.255] 2a48512c383838383838383838382c56312c3038333633312c412c393939392e393939392c4e2c39393939392e393939392c452c3030302e30302c3030302c3037303732342c46464646444646462c3233312c30332c31302c31393633353423
2024-07-07 10:36:40  INFO: [Tbe22305d] disconnected
2024-07-07 10:36:40  INFO: Event id: 8888888888, time: 2024-07-07 10:36:40, type: deviceOffline, notifications: 1
Anton Tananaev 2 years ago

All the coordinates are invalid. That's why it's not decoded.

Neth 2 years ago

Of course they are invalid, I didn't plan to share my location here :)

However I managed to solve the problem. Just after device connects it send a longer message with many zeros in place of attributes. I figured it's a template for all the messages, so I took that message's length and set it as h02.messageLength in config file. In my case it's 97 bytes. Worked like a charm.

Thanks for your help and replies!

Anton Tananaev 2 years ago

Next time you should probably say that you actually altered the log.