Issue with Custom Commands in Events vs. Manual Command Sending

Chris5 days ago

Hello,

I'm experiencing an issue with custom commands in Traccar. When I send custom commands manually through the web interface (/settings/device/1/command), they work correctly. However, when the same commands are triggered automatically by events (like geofence exit), they don't seem to have any effect.

What works:
Sending a custom command via the web interface
The logs show the command is sent and I receive a response from the device:

2025-03-25 15:00:10  INFO: [T5dd2cff0] id: 019176284155, command type: custom sent
2025-03-25 15:00:10  INFO: [T5dd2cff0: huabao < 1.1.1.1.1] 7e09000012019176284155007d0100534d532c55504c4f414420534554204f4b987e
2025-03-25 15:00:10  INFO: [T5dd2cff0: huabao > 1.1.1.1.1] 7e800100050191762841550000007d010900002a7e

What doesn't work:
The same custom command when triggered by an event (like geofence exit)
The logs show "command sent" but no device response, and the device doesn't execute the command

My question:
Are custom commands processed differently when sent manually versus when triggered by events? Is there a different encoding or processing path for these two scenarios?
I'm using Huabao protocol devices. My custom command is: 465245512C3132333435362C33363030

Any help or insight would be greatly appreciated!

Anton Tananaev5 days ago

Commands are sent the same way.

Chris5 days ago

thats really weird. i just tested it again:

via /command in web view

2025-03-26 13:36:05  INFO: [T17ca33fa] id: 019176284155, command type: custom sent
2025-03-26 13:36:06  INFO: [T17ca33fa: huabao < 1.1.1.1.1] 7e09000012019176284155003900534d532c55504c4f414420534554204f4bdc7e
2025-03-26 13:36:06  INFO: [T17ca33fa: huabao > 1.1.1.1.1] 7e80010005019176284155000000390900006e7e

with automatic event

2025-03-26 13:39:07  INFO: Event id: 019176284155, time: 2025-03-26 13:39:07, type: geofenceExit, notifications: 1
2025-03-26 13:39:08  INFO: [T17ca33fa] id: 019176284155, command type: custom sent
2025-03-26 13:39:08  INFO: [T17ca33fa: huabao > 1.1.1.1.1] 7e800100050191762841550000003d020000617e

it sends command after geofence exit but it does not work and i dont know why. its 100% same command that i use..
in web view i get answer from device in logs

Cristian4 days ago

Chris, are you creating a notification that when the device leaves the geofence it sends the command? that's it?

it works fine for me for both cases. What I do for the second case you mention is to assign the command to the device. Do you have it assigning the command to the device?

I have never tried without assigning the command

Chris4 days ago

Hello,
thanks for your answer. Yes I have assigend everything to user and device. commands, events and geofence