Command expiry

vrish a year ago

Hi,
I have a requirement that I need to send a command to all my devices every X minutes. Its the same command that is sent every time. I'm able to send the commands via API. That's the easy part!

My question is in 2 parts: I want to ensure the commands are not queued, but expire. Is there a way to set an expiry on a command if its not delivered? If not, is there a way in which I could check if there is a command already in queue? Then I can skip the next instance of the command.

I couldn't find anything in the API.

Thanks
-VK

Anton Tananaev a year ago

You can check in the database. I don't think we have an API. But I think it might be a good idea to have an option to not queue commands.

vrish a year ago

Hmm.

I thought about the DB part, but I'm hosting the Traccar environment separately and I'm not comfortable opening the ports.

Thanks for the reply. Let me see if I can figure something out.
-VK

maclofin a year ago

I'm not 100% sure but I remember that when the command is queue the response code is 204 and when the command is sent is 200, you can handle the action through that.

Anton Tananaev a year ago

Oh yeah good point. But I think it's still a good idea to have an option to skip queue.

Kaldek a year ago

Hi Anton, I'll second adding this capability. Here's why:

We're using Traccar to send commands to disable a vehicle if it is stolen, or as a general immobiliser when parked. Essentially it's Safe Engine Cut Off (SECO) but is sent as a command via Traccar.

The command is setdigout ?1 ? 2 ? 20 which triggers the DOUT2 of the Teltonika tracker for 2 seconds if the vehicle is going less than 20km/h.

If the command is sent when a customer parkes their car in a location where the tracker is out of mobile coverage (this is Australia...it happens) the command will queue until they are back in coverage and then BLAM - disabled vehicle while driving. It is SECO, so it won't cut out until they're doing 20km/h, but still....

Kaldek a year ago

For added context, the command timeout needs to be configurable per command (or take a default) rather than global.

Kaldek a year ago

I note that the preview version (I assume soon to be v6.7) has this capability. It's not a configurable timeout, but I'll take it.

Command No Queue.png

Kaldek a year ago

Anton if a Saved Command is set to No Queue, what command result will the user get? Something like "command not sent, device offline"?

vrish a year ago

This is pretty neat. I'm assuming it will be available in the API

Anton Tananaev a year ago

It doesn't matter if it's a saved command or not saved. The result is the same. If you try to send and device is not online, you will get an error.