You need to update or clear "positionid" filed in the devices table. Then restart service.
Ok, it worked perfectly.
1 - I checked which devices were associated with the wrong future dates
select id,deviceid,valid,servertime,devicetime,fixtime,latitude,longitude from positions where id in (select positionid from devices) and fixtime > '2018-01-01 07:10:00';
2 - I checked the last valid position for each device
select id,deviceid,valid,servertime,devicetime,fixtime,latitude,longitude from positions where deviceid=????? order by servertime DESC LIMIT 1;
3 - I made the update and pointed the device to the last valid position.
UPDATE devices SET positionid = ????? WHERE id=??
After this change, I restarted the traction and it was OK
Note:
Before doing the update I already included in the configuration file the options below:
<entry key='filter.enable'>true</entry>
<entry key='filter.future'>86400</entry>
Hi, all.
I put filter future key
<entry key='filter.enable'>true</entry>
<entry key='filter.future'>86400</entry>
but anyway got problem with future date.
Is there a comment why it' s so?
Best regards,
Egons
Filtering only affects new data. It doesn't affect what you already have in the database. You have to manually clean that up.
Oh, thank's for quick response.
Yes. I put that filter because some months ago got that problem with future data and then add config to get rid of that problem and filter future data. But anyway got that problem. Is syntax ok?
Did you restart the service?
I think yes, but will try again.
I may be wrong, but I believe that the version you use must be equal to or greater than 3.11
yea, it's 3.15
I think it's relevant to this topic also - is there a method how to delete wrong data database H2 input? I run Traccar on Ubuntu.
Connect to the database and remove it.
New database query should be as follow:
select id,deviceid,valid,servertime,devicetime,fixtime,latitude,longitude from tc_positions where id in (select positionid from tc_devices) and fixtime > '2019-12-31 07:10:00';
May be an improved version of this sql
select id,deviceid,valid,servertime,devicetime,fixtime,latitude,longitude from tc_positions where id in (select positionid from tc_devices) and fixtime > (CURDATE() + 1);
I´ve tried to make it work with mongodb but no success so far. I am not 100% sure with the syntax in traccar.xml
<entry key='database.driver'>com.mongodb.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mongodb+srv://<user>:<password>@cluster0-fqsfu.mongodb.net/test?retryWrites=true&w=majority</entry>
Obviously user and passowrd are not shown. If anyone could accomplish , please share it , thanks
Some trackers that use, sometimes send positions to the year 2022.
I checked that there is the option:
Filter.future
I'm setting the Traccar to use it.
But the old data that was sent with this future year is causing problems.
Even the tracker sending correct positions, the real-time map displays only the year position of 2022. Clicking the device and looking at "State > Time" 2022 is displayed.
For testing, I changed the "valid" field in the database to "0" but it still displays the last position, which was sent with the wrong date. (Year of 2022)
What is the most effective way to disable data with the wrong year, which is already stored in the database?
Traccar Version: 3.11