10:48 am

July 12, 2018

Hello
First post in this forum, let me know if I should have posted in a different location.
I am trying to send data to Thingspeak retrospectively, with a forced timestamp. I intent to use Arduino, and specifically the two functions "ThingSpeak.setField" followed by "ThingSpeak.writeFields(myChannelNumber_02, myWriteAPIKey_02);"
I understand how to send data and let Thingspeak specifies automatically the time value when the function gets called.
However, I would like to be able to retrospectively add data points in ThingSpeak for specific chosen timestamps.
Is there a way to do this?
Thanks in advance
Max
4:20 pm


Moderators
March 7, 2017

Looks like a perfect place to post.
You can use the setCreatedAt() in the ThingSpeak Communication library.
i.e. ThingSpeak.setCreatedAt("2017-01-06T13:56:28");
You can find the documentation for all the available functions in your Arduino libraries folder, then look in thingSpeak , extras and then class_thing_speak_class.html
here is the partial path:
/Arduino/libraries/ThingSpeak/extras/documentation/class_thing_speak_class.html
6:16 pm

July 12, 2018

8:04 pm


Moderators
March 7, 2017

search for an arduino time library. There are a bunch of libraries that help you do almost any crazy time operation you want to do. You just have to sift through the doc or examples, but they have it. Time formatting is the stuff of many of my recurring programming nightmares.
You can also just do string manipulation on it yourself, but I guarantee it will be wrong after daylight savings or every other leap year, etc. (not recommended)
And thanks for letting us know it worked!
Most Users Ever Online: 166
Currently Online:
30 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
huldacormier, bogart, estebanmateo93, mikewrite, onlinebusiness, winzy99Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457