Commands: how do they work?

Ryan8 days ago

Please forgive my ignorance on this subject; I am brand new to Traccar and have virtually no background knowledge about GPS trackers, OBD-II, or Arduino/ESP32/hackable microcontrollers in general.

I have found the official documentation on Commands, but the following points are still unclear to me. (If it would be of value to the project, I'd be happy to incorporate anything I learn here into a pull request on the official docs, to reduce support burden and improve onboarding for new users in the future.)

  1. What exactly are commands in the first place? Is this a concept specific to OBD-II (that is, commands that you can send to a car via the GPS tracker), or a general feature that could be implemented in various ways by any GPS tracker for any purpose? Is it safe to infer that there is a high degree of variability / no standardization in how commands are implemented (or even which commands are available) across manufacturers?

  2. For the sake of illustration, I was hoping to find some examples of common commands. Based on some documents linked in the Protocols page of the official docs, it seems like commands can be used to:

    • Restart the tracker
    • Set an SOS number (?)
    • Apply a speed limit to the vehicle
    • Apply a geofence
    • Set an alarm
    • Clear an alarm
    • etc.

    Does that look right / am I understanding these docs correctly?

  3. When Traccar sends a command to a device, is it using the same protocol/port as the device uses to communicate with Traccar? E.g., if I have a Freematics device, would Traccar dispatch commands over 5170/udp?

  4. Does a device's protocol (e.g., tk103, watch, gps103) strictly determine which commands it supports, and/or how they're implemented? (In other words, do all trackers on the "watch" protocol support the exact same set of commands? or do they at least follow the same format for custom commands? or is it something else?)

  5. Should I expect the dropdown list of commands for a given device to always be automatically populated in Traccar? (I.e., if it's empty, should I take that as an indication that this device can only receive custom commands?)

  6. Alternately, is there a reliable reference source for which commands a given device supports? Is this typically available in the device's documentation, or on the Protocols page linked in Point 2 above?

    (Based on @tananaev's comments in this thread, it seems that a recommended way to determine the exact format for custom messages is to inspect the payload of real commands sent by the manufacturer's official web app. Does that mean that in general, these features are likely undocumented, and require some reverse engineering to do in Traccar?)

Thanks in advance, this is a very cool project

Anton Tananaev8 days ago
  1. It's a general feature most devices support. There's a lot of variability between vendors of what commands are available and there's also variability on what commands we support for certain protocols.
  2. Most common commands are request for a location and updating reporting frequency.
  3. Yes, unless you use SMS commands.
  4. Usually yes.
  5. Yes. But missing command could simply means that we don't support something yet, not that device doesn't support it in general.
  6. Sometimes it's in the protocol documentation. Sometimes there's a separate documentation for commands.
Ryan8 days ago

Big thanks