Watch Protocol Oddity

Alex 2 years ago

Ah sorry, I didn‘t knew of its extistence. I‘ll check it out. Trank you.

Alex 2 years ago

Another question. Do you know if the TK905 4G variants uses the watch protocol at the correct way, Anton? I ask because i like the TK devices and want 4G devices too. But the Problem with the battery is still anoying. If the TK905 4G works correct, I will send back the TK913-4G.

I can really unterstand if you won‘t fix an issue which is not really yours. But it is a bit pity for me to try to fix it every release by myself.

Anton Tananaev 2 years ago

You have to get a proper protocol documentation for us to fix it.

Berbigou 2 years ago

@Alex about TK913-4G
"Do you know if the TK905 4G variants uses the watch protocol at the correct way, Anton? I ask because i like the TK devices and want 4G devices too. But the Problem with the battery is still anoying"

I support Alex request !!

Thank you for spending time for that

Alex 2 years ago

So I found the distributor website and wrote winnes/tkstar a mail where I asked for an corrected protocol documentation. I linked that tread here, too.

I can not find comparable devices on the market wich will work good with traccar. So I hope, they’ll give us an actual documentation.

From now, I‘ll wait for there reply.

hariro 13 days ago

Hello,

I can confirm that this issue still exists in Traccar 6.17.0 with TKSTAR918 and TKSTAR913 devices.

When the devices are stationary, they send LK messages such as:

[SG*9189XXXXXX*0009*LK,0,96,0]

and

[SG*8069XXXXXX*0009*LK,0,100,0,0]

According to the protocol documentation, the fields should be steps, rolling, battery. However, some firmware versions put the battery percentage in the rolling field and report zero in the battery field.

The current decoder therefore incorrectly reports 0% battery.

I tested the following workaround successfully on Traccar 6.17.0:

int steps = Integer.parseInt(values[0]);
int rolling = Integer.parseInt(values[1]);
int battery = Integer.parseInt(values[2]);

position.set(Position.KEY_STEPS, steps);

if (steps == 0 && battery == 0 && rolling > 0) {
    position.set(Position.KEY_BATTERY_LEVEL, rolling);
} else {
    position.set(Position.KEY_BATTERY_LEVEL, battery);
}

This preserves the standard behavior while handling the firmware variation.

I tested this successfully with both TKSTAR918 and TKSTAR913 devices. The battery level no longer drops to 0% when the devices sends stationary LK messages.

Could you please consider including this fix in the official Traccar codebase?

Thank you!

Berbigou 13 days ago

@hariro
I support your request to have this included in Traccar.
I have the same problem, I use docker and I have no clue in Java, so I don't know how to have a modified tracker-server.jar in my docker.

I know this is not the "standard Watch protocol", but all this project exists because nothing is normalized in trackers' world.

Thanks to Anton and all the folks for this amazing work.

Anton Tananaev 13 days ago
Berbigou 12 days ago

Thank you Anton.