Error command type: engineStop sent

jose juan4 years ago

Hello, I have a problem sending the shutdown command, it shows me the following error.

2021-02-27 10:18:52  INFO: [9747abab] id: 008879322, time: 2021-02-27 10:27:57, lat: 19.43733, lon: -102.07058, speed: 28.2, course: 352.2
2021-02-27 10:18:52  INFO: [73703f20] id: 0580011796, command type: engineStop sent
2021-02-27 10:18:52  INFO: [73703f20: suntech > 52.86.140.195] HEX: 5341323030434d443b303538303031313739363b30323b456e61626c65310d
2021-02-27 10:18:53  INFO: [73703f20: suntech < 52.86.140.195] HEX: 4552524f520d

Can somebody help me

Anton Tananaev4 years ago

Where's the error?

jose juan4 years ago

HEX: 4552524f520d =ERROR https://www.traccar.org/hex-decoder/ :(

Anton Tananaev4 years ago

That's coming directly from your device.

jose juan4 years ago

I just checked the manual of my device.

command sent SA200CMD;0580011796;02;Enable1

required command
ST3300CMD;0580011796;02;

How can I add ST3300CMD to the traccar server?

Anton Tananaev4 years ago

You would have to modify the encoder class.

Anton Tananaev4 years ago

Alternatively you can also send it as a custom command.

jose juan4 years ago

refers to this

    private String getPrefix(Channel channel) {
        String prefix = "SA200CMD";
        if (channel != null) {
            SuntechProtocolDecoder protocolDecoder =
                    BasePipelineFactory.getHandler(channel.pipeline(), SuntechProtocolDecoder.class);
            if (protocolDecoder != null) {
                String decoderPrefix = protocolDecoder.getPrefix();
                if (decoderPrefix != null && decoderPrefix.length() > 5) {
                    prefix = decoderPrefix.substring(0, decoderPrefix.length() - 3) + "CMD";
                }
            }
        }
        return prefix;
    }