Why is it not normal and what are you expecting?
Before the upgrade, when creating a geofence while the device was inside the geofence area, the Geofence Enter
notification was sent only after the device exits and then enters the geofence.
Now the geofence enter event is triggered even if the device haven't moved.
Basically, geofence created with the device inside -> Geofence Enter notification triggered upon receiving the next data packet.
The new behavior sounds correct to me.
Well, this is not right. It's doesn't make much sense from user perspective to receive an event with the device stationery inside the geofence.
The event should be trigged under two conditions (like it was before):
Is there a way to filter out this "redundant" event or maybe even cancel it altogether?
No.
Ok, so the server gets a data record after the geofence is activated - it sends an event.
How does it "know" not to send a second event after receiving the second data record? Because the geofenceids
from the previous row in tc_positions
already contains that same geofence id?
Or is the logic different?
Yes, it checks the geofence in the last position.
Well, then there needs to be an additional operation adding or removing the geofence to the last positions record at the time the geofence is added/removed. Otherwise the purpose is defied. If I remove a geofence and then receive an event "Geofence exit" 5 hours later, I am going to wonder what's wrong.
I don't think there is an API call to make changes to the positions records, am I correct?
So after some more testing, it's only the geofence enter event which is generated incorrectly. Geofence exit does not generate an extra event after the geofence is removed. Just FYI in case it helps someone else to understand the new setup.
UPDATE: To remediate this issue, I've previously implemented a separate script to manually add the new geofence in the last positions record.
In this way the Geofence Event handler did not trigger an "enter" event if the vehicle was already inside the geofence.
However, after the upgrade to version 6.4, even if we manually add the geofence in the positions table, the "enter" event is triggered with the next record anyway.
May I ask you confirm the following:
Thanks for the quick reply!
It's true the last question is a bit difficult to answer but where would be your recommendation to start from?
Unfortunately that's not something I can help with here on the forum.
I am experiencing a strange behavior with geofences after the 5.8 upgrade.
After the creation of a new geofence, I am getting a
Geofence Enter
notification for the first data record sent by the device.Is this normal?