Commands sent to ST4310 and ST3310 not working, apparently they use a different protocol

Iván Ávalos3 years ago

Hello! We've been having issues sending commands to Suntech ST4310 and ST3310 devices (reports from the devices work fine, though). Traccar is sending the following payloads to the device:

SA200CMD;XXXXXXXXXX;02;Enable1

And the device is replying with:

ERROR

It seems that new models use a different variant of the Suntech protocol. We have the following PDF documenting it: https://nextcloud.avalos.me/index.php/s/59WMMwXEPmYwr97. Based the PDF, we sent the following payload from Traccar and it worked:

CMD;XXXXXXXXXX;04;01
Iván Ávalos3 years ago

Possible solutions are the following:

  • Implement the new protocol on SuntechProtocolEncoder.java. The problem is, do older Suntech models support it? If not, how do we identify specific device models so we know when to encode using the new protocol version?
  • Create a custom command. If there's no way to interpolate a device ID on the payload, we would have to create a stored command for every single ST4310/ST3310 device we have. Everyone using those models with Traccar would need to do the same. It is a terrible solution, tbh.
  • Add new commands to Traccar Server for ST4310/ST3310 devices. The list of commands would show, for example, “Engine Stop v4”. This would be a better and easier solution than the second one, but worse than the first one.
Anton Tananaev3 years ago

It has to be implemented in a similar way we implement prefix:

https://github.com/traccar/traccar/commit/05e44d8cf956f6a0d44497aa0b357036139425dd

Anton Tananaev3 years ago

Feel free to send a pull request if you manage to implement it.

AvlMexico3 years ago

Yo utilice el modo ZIP de Suntech en el configurador y funciona, el dispositivo ST4340, el detalle es que ya no lo seguimos usando por lo mismo, ya que migraron a su famoso protocolo universal!!

Iván Ávalos3 years ago

I implemented commands support for the new protocol. It is not the best solution, it is only temporary and improvised; there's probably a better way to do it. I would love to receive feedback.

Here you can find my patches, in the suntech-fixes branch: https://git.avalos.me/traccar-server/log/?h=suntech-fixes

In order to inform Traccar that your device requires the new protocol, you need to set the suntech.m2m device attribute to true. This needs to be set per device, the default for all Suntech devices is false.