I am seeing an issue where when I query using the REST API page using a FROM and TO time then there is no data, but when I query using REVERSE and 10 records with a TO time only then I see results.
This doesn't work:
curl -X GET --header 'Authorization: FlespiToken ' 'https://flespi.io/gw/devices/1986081/messages?data=%7B%22to%22%3A1630493561%2C%22from%22%3A1630450800%7D'
curl -X GET --header 'Authorization: FlespiToken ' 'https://flespi.io/gw/devices/1986081/messages?data=%7B%22to%22%3A1630493561%2C%22reverse%22%3Afalse%2C%22count%22%3A100%7D
If I try with another device then the FROM and TO work as expected:
curl -X GET --header 'Authorization: FlespiToken ' 'https://flespi.io/gw/devices/1681653/messages?data=%7B%22to%22%3A1630493561%2C%22from%22%3A1630450800%7D'
Have been using Flespi for a while and is working correctly for some devices as above but not others.
Any help appreciated.
Hmm As I can see, you have no messages for device 1986081 for the specified period (first request)
It looks like the device is uploading messages from the black box and has not yet uploaded messages for the specified period.
When I look in toolbox I can see new messages from the tracker showing position is changing but they are geryed out. What does this mean?
Please pay attention to the fields timestamp and server.timestamp
Toolbox color-codes device messages depending on their "freshness":
grey come from the past (flushing blackbox or wrong device settings); the darker grey means farther into the past
orange come from the future (wrong device settings); the darker orange means farther into the future
white come from the present (soon after the device records the data).
So when I see a message:
Timestamp Server-Timestamp Ident Lat Long
31/08/2021 11:51:22 01/09/2021 14:42:24 864394040598197 52.973335 -0.78936
What is the difference between the Timestamp and Server-Timesatmp fields?
timestamp - the time when the device register a message to its local memory
server.timestamp - time when the device sends a message to the server and the server registers the message in the database
Thanks was as I thought and for this device the time is wrong on the tracker as shows yesterday.
As a follow-up if I run the query for that device for midnight to now then there is still no data. But if I open TRACK-IT for that device I can see the vehicle is moving now and it has drawn lines for its' path today.
Looking at it I think that because the tracker is sending data from yesterday then is why I can't see it as I assume the FROM and TO fields are querying the TIMESTAMP field not the SERVER.TIMESTAMP field, which would make sense.
The TRACK-IT page must be using the SERVER.TIMESTAMP field as is showing movement now but the SHOW/EXPORT tracks page is using the the TIMESTAMP field, as this shows no movement for today?
For a flespi device, the primary field is the timestamp. All flespi algorithms work with this field. If you think that the device is not sending old data, but the wrong time, please configure the device so that it sends the correct time.