TOPIN PROTOCOL ( PORT 5199) Question :

stephane bhiri4 years ago

I have 2 TOPIN ZX302 devices connected to a Traccar Server

Communication works fine with GPS and LBS real time positioning.

But when it comes to LBS off-line data positioning, communications problems occurs:

LBS Offline datas comes like this, and can be seen in the logs:
787800172001081022460300d01401327599640132759a6401324e7f6e000d0a
Which means in Topin protocol:
7878 -> ( 0x78 0x78 is Topin Devices beginning of data strings)
00 -> supposed to be packet length ( but often discarded and send as 00 with Topin)
17 -> WIFI/LBS OFFLINE protocol code
200108102246 -> Date and Time BCD coded in this case : 2020-01-08 10:22:46
0300d01401327599640132759a6401324e7f6e00 -> is the LBS data

Traccar responds as expected:
7878 07 17 200108102246 0d0a
Which is the received date time as a response.

But then Traccar records the date/time ( fixtime ) same as server time, which is problematic for Offline datas from past.

LOG: 2020-01-21 14:06:47  INFO: [15a6e923] id: 3593xxxx32584, time: 2020-01-21 14:06:46, lat: 48.85550, lon: 2.34608, course: 0.0, accuracy: 500.0

(Note: Time Override is not activated)

I suspect Traccar Topin protocol not reading LBS and WIFI Date/Time data coded in BCD.
Note that when Topin device send GPS positioning data, it sends Date/Time coded in Hex->Dec. So it's a different Date/Time encoding when it comes to LBS/WIFI vs GPS.

So it brings the Offline data unusable and brings wrong data in records and map.

Any Ideas?

Also another problem with offline data: The device seems to send over and over the same offline data ( same date and positioning )
I don't know what's wrong here, as Traccar protocol sends the expected response ( date/time response) for the device to continue to send new offline data.

SOME FULL LBS offline data and realtime LOGS here:

2020-01-21 14:43:23  INFO: [76af9f08: topin < 5.35.xxx.1xx] HEX: 787800172001171900230500d0140102ad465a0102ac66640102dd66640102ac646e0102ad476e000d0a
2020-01-21 14:43:23  INFO: [76af9f08: topin > 5.35.xxx.1xx] HEX: 787807172001171900230d0a
2020-01-21 14:43:23  INFO: [76af9f08] id: 35933xxxxxx2604, time: 2020-01-21 14:43:23, lat: 48.87059, lon: 2.29989, course: 0.0, accuracy: 560.0
2020-01-21 14:43:39  INFO: [76af9f08: topin < 5.35.xxx.1xx] HEX: 787800692001211443380700d014013277ed5a0132bfc96401320f66640132ac176400c29b2b6400c29b2c6401320f6564000d0a
2020-01-21 14:43:39  INFO: [76af9f08: topin > 5.35.xxx.1xx] HEX: 787807692001211443380d0a
2020-01-21 14:43:40  INFO: [76af9f08] id: 35933xxxxxx2604, time: 2020-01-21 14:43:39, lat: 48.85786, lon: 2.29202, course: 0.0, accuracy: 500.0

Thank you,
Stéphane

robertr44 years ago

Hi,
When i've asked Topin to provide their tracking server details, they've told me to send SMS like this to the device: domain#www.baidu.com#1001#
Maybe it will help you to do the Reverse Engineering on that.

robertr44 years ago

@stephane bhiri
which commands have you used to reconfigure TOPIN ZX302 to use your own server?
I've tried these:

MYIPADDR#5199#
DOMAIN#MYIPADDR#5199#

but the device does not sent data to my server ?

stephane bhiri4 years ago

hi
@robertr4
DOMAIN#MYIPADDR#5199# should work, assuming you have correctly configured 5199 port fowarding with your router
you may also try:
SERVER#MYIPADDR#5199# ----- with SERVER command your device is forced to have your IP as the default IP, even after a reset.
(but you will loose the ability to have 365gps.com as the backup server in case of problems with your server. To have 365gps back as default : SERVER#120.76.241.191#8005 )

Also don't forget to configure APN correctly with sms commande : APN#YOURMOBILEAPN#

robertr44 years ago

Thank you @stephane the SERVER#MYIPADDR#5199# did the trick.
Thanks again.

stephane bhiri4 years ago

After reverse engineering by logging a proxy between device and 365gps.net ( port 8005 ):
Here is how 365gps replies to device after offline LBS data from tracker(0x17 protocol)

[tracker] 78 78 00 17 20 01 27 19 17 58 02 00 D0 01 75 0A 61 E1 5A 75 0A 9E 51 64 00 0D 0A
[365gps.net] 78 78 00 17 20 01 27 19 17 58 0D 0A
[tracker] 78 78 00 17 20 01 27 19 19 23 02 00 D0 01 75 0A 61 E1 5A 75 0A 9E 51 64 00 0D 0A
[365gps.net] 78 78 00 17 20 01 27 19 19 23 0D 0A

The only difference noticed from Traccar behavior is the fact that 365gps discards packet lenght ( 00 value ) .