Send command to device

vrisha year ago

Hi,
I'm using a g108 GPS that uses jt808 protocol. I'm able to run it on HUABAO protocol port 5015.

  1. Are there commands that are available for engine cutoff / resume for this device / protocol? I've looked through the documentation but wasn't able to find anything specific.
  2. I have also tried to build my own command based on the documentation ( https://www.roadragon.com/uploads/JT808-protocol.pdf ) and am able to generate a message successfully 7E8500000A013670654390000101286375742C312C3029047E, and send to the device, but the device does not respond. I'm able to execute the same command using SMS and the engine gets cut. Any thoughts on how I can debug this using the Traccar code?
Richard Acostaa year ago

Hi, i'm still stuck on this.

Another user sent me this code 7E810500010190999999998D2564D87E, but is also useless.

vrisha year ago

This is my payload and a breakdown.

7E8300000AXXXXXXXXXXXX000001286375742C312C3129687E

Payload: 286375742C312C3129 (lock / cut engine power)

  1. 7E - FLAG_BIT (static)
  2. 8300 - Static Text
  3. 000A - Length of Payload (step 6)
  4. XXXXXXXXXXXX - Device Unique ID
  5. 000001 - Sequence # (Do not change unless you are managing sequence #)
  6. 286375742C312C3129 - Payload
  7. 68 - Checksum (calculate checksum XOR all bytes from step 2 till step 6)
  8. 7E - FLAG_BIT (static)
Richard Acostaa year ago

Did that work?

vrisha year ago

Yes. Generate your payload based on mine.

catruchos3 days ago

If anyone like me is trying to send commands to a huabao device and is trying the ascii text as in a SMS and does not work, you might try to convert it to HEX and send it like that
Ex: STATUS# does work from sms but not from Traccar.
Here Traccar hex encoder/decoder you can convert it to hex and send as custom command.

STATUS# would be 53544154555323

Anton Tananaev3 days ago

You need a full valid packet. You can't just convert text into HEX and expect it to work.

catruchos2 days ago

Thanks for your input Anton.
I don't know what you mean when you refer to a full valid packet.
I know that I have tested several commands to my device that is a Micodus MV710g (huabao, port 5015) from traccar, it does not respond to ASCII but it respond correctly to the encoded hex strings.
Although traccar does not decode some of the packets the device reply back to commands in huabao protocol, I tried manually decode the answer when I receive them from traccar log to commands like status and, once decoded, the answer in ASCII is the same as when you send the ASCII command from SMS.

Also I tried to switch from traccar to the micodus app server sending the ascii command (SERVER,1,d.micodus.net,7700#) translated to HEX(5345525645522c312c642e6d69636f6475732e6e65742c3737303023) and I saw the device appeared connected to the Micodus server again and disconnected from traccar , so it works.

I got the idea from this post

from this post about sending commands to huabao

I also tried to change heartbeat period modification and it seems to work as well.

I also saw in the log in the traccar received that traccar is not able to decode some messages with info from the device ,
I think that there are messages 0x0900 and sub-type 0xFF, according to (=( protocol documentation are messages type passthrough with ASCII info inside like battery, GPS Fix, Power , Network state, internet, imei, version, Firmware, APN, etc

2025-11-20 22:13:38  INFO: [T573266d7] id: 019176575054, command type: custom sent
2025-11-20 22:13:38  INFO: [T573266d7: huabao > 90.166.123.237] STATUS#
2025-11-20 22:13:39  INFO: [T573266d7: huabao < 90.166.123.237] 7e090000ac0191465760540260ff534d532c49443a31393137363537353035340a424154544552593a313030250a494e5445524e45543a535543434553530a4e45543a34472c484947482c31390a4750533a554e4649582c300a53504545443a304b4d2f480a4143433a4f46460a52454c41593a4f46460a444f4f523a434c4f5345440a504f5745523a434f4e4e45435445442c35372e35560a53454e534f523a4f46462c4c4556454c3a320a53544154453a44495341524de57e
2025-11-20 22:13:39  INFO: [T573266d7: huabao > 90.166.123.237] 7e80010005019176575054000002600900005a7e
2025-11-20 22:13:39  WARN: [T573266d7] error - Latitude out of range - IllegalArgumentException (Position:239 < HuabaoProtocolDecoder:1348 < *:390 < ExtendedObjectDecoder:73 < ... < WrapperContext:102 < ...)
2025-11-20 22:13:39  INFO: [T573266d7] disconnected

I do not know much programming however with the help of the internet the meaning of this packet should be something like

SMS,ID:19146576054
BATTERY:100%
INTERNET:SUCCESS
NET:4G,HIGH,19
GPS:UNFIX,0
SPEED:0KM/H
ACC:OFF
RELAY:OFF
DOOR:CLOSED
POWER:CONNECTED,57.5V
SENSOR:OFF,LEVEL:2
STATE:DISARM.

Being the structure of the packet:

Start:7e
Message ID: 0900
Body properties: 00ax
Terminal ID: 19146576054
Serial number: 0260
Subtype: ff (Subtype =0xFF passtrough)
Payload 534D53...
Checksum:e5
End:7e

I don´t know if it helps to try to help traccar decode the message or not, but If you guide me and let me know how i can help to implement the packets decoding or let me know that if you want me to test something else I would gladly do so to improve the protocol decoding.
In the meantime I am reading the HuabaoProtocolDecoder.java file and try to understand it.

Thanks once again for your hard work Anton.

Anton Tananaev2 days ago

You'd need the protocol documentation first.

Walter Spada2 days ago

The plain conversion from SMS text to HEX is working for me too.
Surely is not the same for every device, but for some work.