Sending Commands to device, howto generate command?

GPS4PETS a year ago

Hello

i am using a gps tracker with t808 protocoll on port 5015
the tracker is working but i need to send several custom commands to it (enable/disable buzzer, enable/disable light)

using the website en.aika168.com i can see the payload for these commands.
But how can i send it with traccar?

here are the payloads:

light off
{SN:'19175676450',DeviceID:2886256,CommandType:'808DGXC',Model:510,Phones:'0'}
light on
{SN:'19175676450',DeviceID:2886256,CommandType:'808DGXC',Model:510,Phones:'1'}
buzzer off
{SN:'19175676450',DeviceID:2886256,CommandType:'808SYXC',Model:510,Phones:'0'}
buzzer on
{SN:'19175676450',DeviceID:2886256,CommandType:'808SYXC',Model:510,Phones:'1'}

How can i make a custom commands out of that?

Anton Tananaev a year ago

Click send command and select the custom type. Not sure I understand the problem.

GPS4PETS a year ago

i captured those payload from the chinese site en.aika168.com.

now i need to translate them to a traccar custom command

Anton Tananaev a year ago

So that's not the expected format? Then you need the protocol documentation to know the format.

GPS4PETS a year ago

the protocoll is jt808 and i have the docs.
but i need a little help please

GPS4PETS a year ago

i made this command while reading the tj808 docs:
7E8300000A019175676450000001286c65642c312c3129237E

but when i send it as custom command it get interpreted as payload and converted to hex to this:
7e830000330191756764500000013745383330303030304130313931373536373634353030303030303132383663363536343263333132633331323932333745257e

GPS4PETS a year ago

i made this command while reading the docs of the tracker for light control:
7e8105000101918102196600a121016E7e

but when i send it as custom command it get interpreted as payload and converted to hex to this:
7e8300002301917567645000000137653831303530303031303139313831303231393636303061313232303136463765317e

how can i prevent the new encoding and send exactly my given command?

Anton Tananaev a year ago

It seems like we're currently automatically wrapping commands.

GPS4PETS a year ago

modified traccar and added new commands to server and web.
needed to modify the formatMessage to letz the message through without default modification

Anton Tananaev a year ago
GPS4PETS a year ago

yes that did it.
i will keep my modifications in my repo, because the device id will be automaticly set and i dont need to create one custom command for each device.
but your fix makes testing a command much easier
thank you for your help