device connections are not saved

tristec2 years ago

Hi,

I have a Traccar server running where I have encountered a problem. Changes to the device connections are not saved e.g. the linking with geo fences. My user have admin permissions.

In the log I see the following events:

[object Object]

However, the changes do not arrive in the database:

[object Object]

Interestingly, I have the same problem on the website https://demo.traccar.org.
Do you have any idea what this could be? Or am I doing something wrong?

best regards
Tristan

Anton Tananaev2 years ago

I think your confusing linking geofences to devices and current geofences that the device is in. The latter is shown in the device API, not the former.

tristec2 years ago

Mhh ok, I want to define a geofence and be alerted when the device leaves it.

For this I created a geofence and a notification of the "type: Geofence exited" for all devices.
Then I tried to assign the geofence to the device via the connections parameter.

Is that not correct?

Anton Tananaev2 years ago

If you're trying to set geofenceids for that, that's not how you do it. You need to use permissions API instead. I would recommend checking what the official app does.

tristec2 years ago

Sorry, perhaps I have expressed myself incomprehensibly. I currently only use the web interface and would like to configure the geofence there for a device. I checked the database only for error analysis.

Geofence:
undefined

Notification:
undefined

When I configure the device I can select the geofence.
undefined

But when I press the Save button, the changes are apparently not saved. Because when I open the device properties again the configured geofence is gone.
undefined

Anton Tananaev2 years ago

In that case you were using the wrong places to check errors. Connections are stored in linking tables, not in the device or geofence table.

Anyway, it is expected that the connection field is empty until you click on it. We want to avoid preloading all the data to avoid excessive number of API calls.

tristec2 years ago

Ah ok, thanks for the explanation! I just tested it, the mapping between device and geofence is saved correctly.