Incorrect timestamp when using bulk upload of several lines on Thingspeak

조회 수: 3 (최근 30일)
Using bulk upload in a CSV format to store IoT logs onto Thinkspeak.
My IoT (ESP32) will bulk upload few (~10) lines by the end of a cycle, once in about an hour.
However, ont he time line (both on automatic charts and on export) it seems that the lines are spread on over an hour, so actually I have no idea when this is really happened.
the two following pictures demonstrates it well: both "points" where reported at the same time using a simple bulk update call, but reported like it was posted 40 minutes apart. this is consistent with the data exported in the export function. However there, it is 10-15 seconds shifted from the time on the chart... (?!?!!?)
Why is the timestamp incorrect and spead over time ?
How can I make sure I get the correct timestamp to a log submitted ?
thanks!
  댓글 수: 3
avner gideobi
avner gideobi 2020년 4월 28일
Thanks Christofer.
relative.
here is an example for the POST message:
write_api_key=XXXXXXXXXXXXX&time_format=relative&updates=999,706,1,1,14,22.00,91391064,250348,122719,,,,New configuration available: 200|999,706,1,1,15,22.00,91391064,250379,31,,,,Server Configuration refreshed|
avner gideobi
avner gideobi 2020년 4월 28일
Also, as implied by your answer tried (well for six hours now) to use absolute timing:
but failing with HTTP/1.1 400 Bad Request.
here is the POST section:
write_api_key=XXXXXXXXX&time_format=absolute&updates=
2020-4-28T22:30:58-1768,3,0,2,1,,91449512,1768,1768,,,,This is boot No. 0 of Device |
2020-4-28T22:30:58-4229,2,0,2,2,,91449512,4230,2462,,,,Device found. Device name: 703|
2020-4-28T22:30:58-4232,2,0,2,3,,91449512,4232,2,,,,Participating in 2 plans.|
2020-4-28T22:30:58-4247,3,0,1,4,,91449512,4248,16,,,,Network configuration loaded and parsed succesfully|
2020-4-28T22:30:58-4278,2,0,1,5,21.00,91449512,4278,30,,,,Temperature: 21.00 Humidity: 52.00|
2020-4-28T22:30:58-4279,3,0,0,6,21.00,91449512,4278,1,,,,Initialization Completed.|
2020-4-28T22:30:58-4286,2,0,2,7,21.00,91449512,4286,7,,,,Going to wake in 3600|
2020-4-28T22:30:58-4287,1,0,2,8,21.00,91449512,4286,0,,,,Going to sleep now for 3600 secs....This cycle took: 4287

댓글을 달려면 로그인하십시오.

채택된 답변

avner gideobi
avner gideobi 2020년 4월 30일
sure.
I missed two points in the format, nothing that eight hours of debugging can't solve ;-)
first the format YYYY-MM-DDTHH:MM:SS-XXXX - i tought that the XXXX is miliseconds. of course it is not.
secondly, i got failures as I submitted multiple events with the same second timestamp. as the logs arent consistent it was hard to understand what was the problem.
Some more verbose error messages would have been helpful.
thanks.
  댓글 수: 1
Christopher Stapels
Christopher Stapels 2020년 4월 30일
Thank you for updating. Ill make a request to improve the error messages if possible. Unfortunately the bulk update flow has some special difficulties for reporting errors in real time.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

avner gideobi
avner gideobi 2020년 4월 29일
OK i think i finally got it.

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

Help CenterFile Exchange에서 ThingSpeak에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by