Updating multiple Thingspeak fields with forced timestamp | Arduino | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Updating multiple Thingspeak fields with forced timestamp
No permission to create posts
July 12, 2018
10:48 am
Avatar
maximelanoelle
New Member
Members
Forum Posts: 2
Member Since:
July 12, 2018
sp_UserOfflineSmall Offline

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

July 12, 2018
4:20 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 477
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

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

July 17, 2018
6:16 pm
Avatar
maximelanoelle
New Member
Members
Forum Posts: 2
Member Since:
July 12, 2018
sp_UserOfflineSmall Offline

Thanks for the help :). This was exactly the command I was after. Now I just need to figure out how to convert my RTC time to the format you specified.
Cheers. Max

July 17, 2018
8:04 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 477
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

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!

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
39 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:

JerilynDernnida, JaketripDernnida, KenterDernnida, AlisaMiz, AriurinDernnida, KabinaDernnida

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457