Channel status updates "created_at" field spuriously showing a time in the future
3 views (last 30 days)
Show older comments
Hi,
I'm querying status updates of a channel as part of my workflow. Each of these status updates comes with a "created_at" timestamp, so when I query for the last one I expect to get the latest.
However, twice during March I got an status update with a "created_at" timestamp several weeks in the future, which completely messes my workflow. Because that same message always get returned as the latest for several weeks.
I could code a workaround for this, but I would rather understand why this happen and how to avoid it.
Attached is a CSV export from that channel, and you can see how all dates make sense and suddenly, the entry_id 502 (row 503), reports being created on March 29 2023, 20 days ahead of when it was actually created.
Some background to my question:
The reason why the status updates are so important in my workflow, is because I'm sending data in binary format (bitpacked) to ThingSpeak from a satellite modem (RockBlock), were a React scripts decode it and send it to another Channel for visualization.
One of my encoded messages looks like "6ae5c7c895ec7803abc602c0ffffffffff07a8"
To get this encoded messages, I read the status updates of the channel. Due to the way the satellite system works, in the status update I can find the IMEI of the modem, a message ID and the encoded message, therefore one status entry at the status updates feed of the channel looks like this:
300434066310190,1121,6ae5c7c895ec7803abc602c0ffffffffff07a8
So I use these status updates to retreive the binary messages.
6 Comments
Christopher Stapels
on 15 Mar 2023
A few things I would try if you have the bandwidth.
Set up another feed with the same data where you do explicitly set the datetime in Rock7, and see if that gives any errors.
Set up another feed with fixed data, like a single simple character. Your special characters might be getting interpreted unexpectedly somewhere that overflows a buffer, but ony when certain things are true about the date time (for example if the datetime does not have a fixed width)
Since we allow people to use times in the future and in the past, ThingSpeak does not see these dates as incorrect data and there is no built in filter. However, you can easily build your own filter in MATLAB analysis and use TimeControl to run the code regularly to write the filtered data into a new channel. I do this for the traffic monitor channel. It writes every 15 seconds, but I read the data every day and then calculate and write the houlry average into another channel so I can view the trend easier.
Answers (0)
Communities
More Answers in the ThingSpeak Community
See Also
Categories
Find more on Reference Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!