sendQueuedCommands does not seem to work?

michael ring4 years ago

If my device (teltonika device) is online and I send a custom command to it I works always fine.
But I get this warning in the log each time I am sending custom command:

WARN: Automatic device registration error - Duplicate entry '0' for key 'idx1' - SQLIntegrityConstraintViolationException (... < QueryBuilder:446 < DataManager:425 < BaseObjectManager:123 < ...)

And when device is not online the command gets queued. In this case the command is delivered to device too - but the device is not able to handle it. On the logs of the device you can find "GPRS command error". In this case there is no warning about dublicate entry in traccar log.

That means when I get a warning in traccar log everything is fine device has received the command and when there is nothing in the logs the devices did not receive a correct command.

Is this a known problem or am I the only one that has problems with sendQueuedCommands.

Btw. I changed some things in BaseProtocolDecoder class / Baseprotocol and in CommandManager class - and did a lot of logging in there - but did not find a workaround yet.

Anton Tananaev4 years ago

Looks like you have an issue with some customization.

michael ring4 years ago

No, I started customization because there this issue. In production I am using traccar latest version you provide without any customization.

Anton Tananaev4 years ago

OK, what's the error on your production server? Let's talk about that one instead.

michael ring4 years ago

Error is:
Sending gprs commands to devices that are not online does not work.
No error is logged in traccar log file, but a GPRS-command error is logged on the device side. Command arrives but it is somehow not readable for the device.

The "setparam" command works fine if device is online and the command is not queued.

Anton Tananaev4 years ago

Is the command sent? Have you checked the format?

michael ring4 years ago

Yes I checked the format. The command works if device is online.

Anton Tananaev4 years ago

Please answer all questions.

Anton Tananaev4 years ago

Also, what's the API response?

michael ring4 years ago

It's not a problem of a single command. All commands do not work if device offline. I am only sending one single command.

And all command do work if device is online.

michael ring4 years ago

I never get API responds. This does not seem to work.

Anton Tananaev4 years ago

Hmm.. where are you checking the API response? Screenshot please.

michael ring4 years ago

This is the command I am sending:

setparam 13003:1

In case this was your question. It's a teltonika specific command.

michael ring4 years ago

I was checking response in the traccar logs and in database tables. Screenshots? I have traccar log with level "all" of some 5 Minutes after restart - but how could I share attachments here? And I don't think there is anything interesting in it besides a no response...

Thanks for trying to help. I will find another solution and don't want to disturb you any longer. Perhaps the not working queued commands is just a problem on my systems - I thought it might be a known problem and somebody has a workoround.

Anton Tananaev4 years ago

We don't log any API responses in the log. You have to check your browser network console.