gps103 status (ACC,Alarm)

I am looking at the info for the gps103 as defined in the supported devices and this docs SEEMED completely wrong.
However, looking at the java I see that both the decode and the encode work perfect using single characters (the old way) although they are completely different.

But they are a subset of the numeric version:

single char:

        switch (command.getType()) {
            case Command.TYPE_CUSTOM:
                return formatCommand(command, "**,imei:{%s},{%s}", Command.KEY_UNIQUE_ID, Command.KEY_DATA);
            case Command.TYPE_POSITION_STOP:
                return formatCommand(command, "**,imei:{%s},A", Command.KEY_UNIQUE_ID);
            case Command.TYPE_POSITION_SINGLE:
                return formatCommand(command, "**,imei:{%s},B", Command.KEY_UNIQUE_ID);
            case Command.TYPE_POSITION_PERIODIC:
                return formatCommand(
                        command, "**,imei:{%s},C,{%s}", this, Command.KEY_UNIQUE_ID, Command.KEY_FREQUENCY);
            case Command.TYPE_ENGINE_STOP:
                return formatCommand(command, "**,imei:{%s},J", Command.KEY_UNIQUE_ID);
            case Command.TYPE_ENGINE_RESUME:
                return formatCommand(command, "**,imei:{%s},K", Command.KEY_UNIQUE_ID);
            case Command.TYPE_ALARM_ARM:
                return formatCommand(command, "**,imei:{%s},L", Command.KEY_UNIQUE_ID);
            case Command.TYPE_ALARM_DISARM:
                return formatCommand(command, "**,imei:{%s},M", Command.KEY_UNIQUE_ID);
            case Command.TYPE_REQUEST_PHOTO:
                return formatCommand(command, "**,imei:{%s},160", Command.KEY_UNIQUE_ID);

vs. Numeric commands:

Function explanation
100 Single track
101 Auto track continuously
102 Cancel Auto continuous track
103 Track upon distance interval
104 Cancel alarm
105 Set movement alarm
106 Cancel movement alarm
. . .

There exist around 30 commands more and I hope that the 'modern' version will also return information like ACC etc. status which are momentarily returned as empty (,,.).

To switch to the 'new' standard I sent:

sms123456
--it disconnected from the server-
followed by the sms
protocol 12 out
gprs123456
-it reconnected-
-and followed nicely the numeric commands, ignoring the character comands as expected (otherwise we would not need to set the protocol
...
sms123456
--it disconnected from the server-
followed by the sms
protocol 12 in
gprs123456
-it reconnected-
-and was back following single-char commands commands again

I receive now a float and an int, both 0. I don't know if they represent a status, but having the additional functionality available is really cool and useful.

I don't expect the new syntax to be implemented in this version and my java is pretty rusty, BUT, if the authors of the software would implement the functionality
"switch to new commandset"
{ switch to sms | send sms 'protocol 12 in' | send sms 'gprs123456' }
and if needed
"switch to new commandset"
{ switch to sms | send sms 'protocol 12 out' | send sms 'gprs123456' }
We could use the 'send custom command' gui and 'Dispatch commands to device' API respectively. That would save the problem having to switch (possibly, I have not tested it) manually each time the gps reboots, since sending SMSs is already implemented in the system anyway.

I would appreciate that 'switcharoo' to 'new' ( https://www.traccar.org/protocols/ doc: "PROTOCOL123456 out.doc" ) commandset enormously!!!

'Playing' via https://www.any-api.com/traccar_org/traccar_org/docs/Definitions/Device helps also a lot.

guenter

Anton Tananaev6 years ago

You are welcome to send a pull request with updated commands.