Is there a way to configure a protocol option per device?

C5roki 8 months ago

I have a problem using 'old' and 'new' Sinotrack ST-901 trackers in one Traccar instance:

  • 'old' ST-901 tracker - uses the h02 protocol and only sends text-based messages (starting with *HQ).
  • 'new' ST-901 tracker - uses the h02 protocol and sends text-based (starting with *HQ) and binary (starting with 24) messages.

There are a lot of topics in the Traccar forum that state that the 'new' ST-901 trackers need to have h02.ack set to true to stop the endless stream of binary messages. But with h02.ack to true the 'old' ST-901 trackers do not send messages according to their interval settings anymore, but a message every couple of minutes.

So I'm a bit stuck:

  • set h02.ack to false - 'old' ST-901 trackers work fine, 'new' ST-901 trackers keep sending binary messages at an alarming rate.
  • set h02.ack to true - 'old' ST-901 trackers are almost irresponsive, 'new' ST-901 trackers send messages at an acceptable rate (but still won't go to sleep, but that is another matter)

To use both 'old' and 'new' ST-901 trackers in a Traccar instance, the h02.ack

  • should be configurable per device -or-
  • should be a protocol setting separately for either text-based or binary messages

Is there already a way to configure h02.ack (or any other protocol option) per device or should this be a feature request?

Track-trace 8 months ago

You can just copy the ho2 protocol to for instance ho2b and then recompile the server to run that ho2b protocol on a new port where you for instance connect your new st-901 with the preferred setting.

C5roki 8 months ago

That crossed my mind too:

  • a h02legacy protocol - only text-based messages
  • a h02 protocol - as it is now, text-based and binary messages

But maybe I overlooked a way of doing the same without having to recompile Traccar.
And I can't imagine that I'm the only one that has this kind of issue, the ST-901 tracker is already around for a long time.

Anton Tananaev 8 months ago

Ideally we should make it possible to configure per device or per group.

C5roki 8 months ago

So I should ask for a feature 'configure protocol option per device or per group'. How / where do I do that?

Anton Tananaev 8 months ago

You should use GitHub for feature requests.

RastreameMX 21 days ago

@C5roki

Excuse me, do you have identified which ST models or what firmware versions have implemented this "new" h02ack protocol? We use mostly ST906L devices, and at the moment we have no issues with position receiving or device communication still at version ST906(70SALASA)_TQ_V_2.2 2026/01/19 , but we didn't bought ST901 anymore since PCB changing from A7670SA to Global version.

C5roki 21 days ago

@RastreameMX, I don't know about the firmware versions of the ST-901's that use the 'old' or the 'new' protocol. I also identify them by looking at the markings on the PCB.
I did implement a kind of workaround by changing the H02 protocol implementation:

diff --git a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java                                    
index f04eaaff7..2663d9ab7 100644                                                                                                                                       
--- a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java                                                                                                        
+++ b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java                                                                                                        
@@ -160,9 +160,9 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {

         processStatus(position, buf.readUnsignedInt());                                                                                                                

-        if (getConfig().getBoolean(Keys.PROTOCOL_ACK.withPrefix(getProtocolName()))) {
+        // if (getConfig().getBoolean(Keys.PROTOCOL_ACK.withPrefix(getProtocolName()))) {
             sendResponse(channel, remoteAddress, id, "R12");                                                                                                           
-        }
+        // }

         return position;                                                                                                                                               
     }                                                                                                                                                                  

(and recompile the tracker-server.jar with gradle)
This way the 'new' protocol always get an ACK (regardless of the configuration) and you can configure the ACK for the 'old' protocol in the traccar.xml as you are used to.
The new ST-901's are still a bit chatty, but at least the old ST-901's work as before.

(You can also implement a separate ACK for the 'new' protocol, so you can configure independently from the current ACK.)

RastreameMX 20 days ago

@C5roki Thank you so much for your information.

I'll keep it in mind if i get ST devices that require 'new' protocol implementation.