Geofences: question

Percy7 years ago

@abyss, could you provide a sample of your entire ical test calendar (the one you said above that works using UTC)? The test ical I provided at the top of this thread doesn't work as expected for me.

If your test ical uses UTC and works, that is what I need, if you could share it.

Thanks

Percy7 years ago

Also found this on the logs during Traccar startup:

[main] INFO net.fortuna.ical4j.util.Configurator - ical4j.properties not found.
abyss7 years ago

@Percy

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
X-KDE-ICAL-IMPLEMENTATION-VERSION:1.0
X-WR-CALNAME:Every night(UTC)
X-WR-TIMEZONE:Asia/Yekaterinburg
BEGIN:VEVENT
CREATED:20161213T045151Z
LAST-MODIFIED:20180522T053423Z
DTSTAMP:20180522T053423Z
UID:9d000df0-6354-479d-a407-218dac62c7c9
SUMMARY:Every night
RRULE:FREQ=DAILY
DTSTART:20161129T130000Z
DTEND:20161130T050000Z
TRANSP:OPAQUE
SEQUENCE:1
X-MOZ-GENERATION:1
END:VEVENT
END:VCALENDAR

You can safely ignore this log message.

Percy7 years ago

Guys,

I'm sorry to keep bringing this issue up but I have tested this all the ways possible, and I see false positives on the event generation. I believe that the geofences calendars are not working precisely as they should. I really hate to bother you guys, but since my work depends on this.

I'm going to bring all the evidence forward to see if you guys are able to replicate this, but I set a calendar today on a geofence for 1 hour, and there was a geofenceEnter event generated 18 minutes AFTER the geofence schedule. We really need to have these schedules followed, otherwise it will cause issues sending false alarms.

I'm going to post all the relevant rows from the database, so you guys can try to see why this is happening. What I suggest for testing this is to setting a geofence calendar very close inside and outside the schedule. Because if an event is triggered even 1 minute outside the schedule, is a false alarm.

Below is all the relevant evidence pulled from the DB. Location info is hidden of course, for privacy reasons.

Calendar

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//example.com//ical//EN
BEGIN:VEVENT  UID:1ao9@example.com
SEQUENCE:0
DTSTAMP:20180524T155947Z
DTSTART:20180501T160000Z
DTEND:20180524T170000Z
RRULE:FREQ=WEEKLY;BYDAY=TH
SUMMARY:Place 3
DESCRIPTION:Place 3
END:VEVENT
END:VCALENDAR

Relevant Table row on events table

(all times are UTC - So the geofenceEnter is 18 minutes outside the schedule - see the calendar DTEND: 20180524T170000Z - or 1700 hour)

Name      |Value              |
----------|-------------------|
id        |5200               |
type      |geofenceEnter      |
servertime|2018-05-24 17:18:39|
deviceid  |8                  |
positionid|16205              |
geofenceid|9                  |
attributes|{}                 |```

#### Relevant row on the positions table
Name Value
id 16205
protocol watch
deviceid 8
servertime 2018-05-24 17:18:38
devicetime 2018-05-24 17:18:16
fixtime 2018-05-24 17:18:16
valid true
latitude 00.000000
longitude 00.00000
altitude 0000.0
speed 0.539957
course 103.18
address Address Here
attributes {"sat":5,"rssi":00,"batteryLevel":72,"steps":0,"distance":90.53,"totalDistance":8077604.83,"motion":true}
accuracy 0
network {"radioType":"gsm","considerIp":false,"cellTowers":[{"cellId":00000000,"locationAreaCode":0000,"mobileCountryCode":000,"mobileNetworkCode":00,"signalStrength":86}],"wifiAccessPoints":[{"macAddress":"00:00:00:00:00:00","signalStrength":-42},{"macAddress":"00:00:00:00:00:00","signalStrength":-42},{"macAddress":"00:00:00:00:00:00","signalStrength":-83},{"macAddress":"00:00:00:00:00:00","signalStrength":-87},{"macAddress":"00:00:00:00:00:00","signalStrength":-81}]}
#### Other info
Server is now using UTC timezone

I really want to help getting this working precise to down to the minute, so you guys have my full cooperation to determine what the issue is.
Anton Tananaev7 years ago

Are you changing server timezone? That might be the issue. Make sure that it actually affected Traccar.

Percy7 years ago

No, I didn't. What I did was (since we are still testing) I launched a new instance of the Traccar server using Docker (like a brand new install from zero) still the Traccar server is notifying of events outside of the schedule.

We have been testing this all day with this new instance of Traccar, and the results are the same, the times ranges of the calendar are not obeyed.

If you need further info from me, feel free to let me know - I'm open to cooperate to solve this.

Thanks,

Anton Tananaev7 years ago

OK, but why is server timezone different from your original one?

Percy7 years ago

We tried different Docker configurations with different timezones to test and see if it would affect the problem, but still it won't matter what timezone we set on the server, the problem persists.

Anton Tananaev7 years ago

Well, as you can see from the thread. We tested it without Docker and it works as expected. Possibly there is some issue with how Docker handles timezone. I would recommend to try official release as it is without Docker.

Percy7 years ago

I can guarantee that Docker is not the problem, as the server image is built fine - also Docker doesn't manage timezones it's just a tool to build the server image - Traccar does it's setup normally and initializes the Database. Also all other features work fine. I saw the test from Abyss, but I don't see this test checking with 1 minute precision.

As you can see from the Database rows I pulled as evidence of the issue, Traccar generated these rows with the provided ics Calendar. I can assure you if the unit tests are expanded to include (for example) a 3 minute event and then perform a test with a date/time within that 3 minute ics calendar event, I'm sure this issue can be replicated.

Example Calendar Event Range:
DTSTART: 20180501T160000Z
DTEND: 20180501T160300Z

Then the unit test would test: 20180501T160200Z (that should trigger the event, or result in "true" on checkMoment)
Another unit test date would be: 20180501T160400Z (that should not trigger the event, or result as "false" on checkMoment as it is outside the event date/time range)

Anton Tananaev7 years ago

I guess the only thing you can do is debug the code and see what's happening at the check.

Percy7 years ago

I would be able to, if I would be familiar with Java, but getting a dev environment setup for Java and Traccar I'm not familiar with.

Can you guys help with a 1 hour paid support? because I don't see this getting solved any other way - I'm sure by all the tests performed that this is not an outside issue, as by all the tests performed so far it all points to the calendar event check.

Anton Tananaev7 years ago

Send an email to support address to discuss it, but I'm not sure of 1 hour would be enough. I'm not very familiar with Docker.

Percy7 years ago

Ok

abyss7 years ago

Have you checked your calendar in other place. It is wrong.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//example.com//ical//EN
BEGIN:VEVENT  UID:1ao9@example.com
SEQUENCE:0
DTSTAMP:20180524T155947Z
DTSTART:20180501T160000Z
DTEND:20180524T170000Z
RRULE:FREQ=WEEKLY;BYDAY=TH
SUMMARY:Place 3
DESCRIPTION:Place 3
END:VEVENT
END:VCALENDAR

calendar

If you want it for a hour, you must make it in the same day.

DTSTART:20180524T160000Z
DTEND:20180524T170000Z