Can't send custom command via web

maxw3ll7 years ago

Hi, since updating Traccar to 3.17 I am not able to send commands via the web interface anymore. It used to work with 3.14 but when I try to send a command I can not select anything from the "Type" dropdown.
Debugging the network I can see that there is a call to /api/commands/types but it returns an empty array.
No errors on the JS console or tracker-server.log
Also tried first creating a "Saved Command" but can not select any type there either.
Also tried on a fresh installation, with default config and DB.

GPS device I am working with uses H02 protocol.

Anton Tananaev7 years ago

Just tried on the latest version and custom command works perfectly for me. I also get results from the API endpoint that you references. Saved commands work fine as well. Sounds like you have some issue with your setup.

maxw3ll7 years ago

Thanks for checking Anton. I found the issue:
I used a Apache rewrite rule to make Traccar >3.15 commands API backwards compatible for older instances of our app:

RewriteEngine On
RewriteRule "^/api/commands" "/api/commands/send" [PT]

After removing this I was able to select commands. Pretty clear now why it didn't work as I remapped the endpoint to fetch available commands.