Problem with Arduino Thingspeak.writeFields() not updating fields correctly | ThingSpeak API | Forum


Please consider registering


— Forum Scope —

— Match —

— Forum Options —

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

Register Lost password?
sp_Feed sp_TopicIcon
Problem with Arduino Thingspeak.writeFields() not updating fields correctly
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
May 19, 2017 - 12:27 am
sp_Permalink sp_Print

Writing to more than 5 fields with the .writeFields() function causes the Thingspeak server to receive all null data. The channel is setup properly. I have tried deleting and recreating the channel, switched the order of writes, nothing works. The stranger thing is that it all worked a few days ago.

Remove the set for "field6", works fine. Add it back... server gets null for all fields (but it does get an entry). All fields are of the same "int" type.

  ThingSpeak.setField(1, var1);
  ThingSpeak.setField(2, var2);
  ThingSpeak.setField(3, var3);
  ThingSpeak.setField(4, var4);
  ThingSpeak.setField(5, var5);
  ThingSpeak.setField(6, var6);
  ThingSpeak.writeFields(ChannelNumber, WriteAPIKey);

Anyone see anything like this? Is it flakey server code?


Forum Posts: 23
sp_UserOfflineSmall Offline
May 19, 2017 - 9:48 am
sp_Permalink sp_Print

Both ThingSpeak and the library support writing all 8 fields at once.  To be sure, I just confirmed it with a sketch running on a MKR1000.  

I can also make it work with a URL in my browser:

It is possible your device is running out of RAM and causing the HTTP output buffer to get corrupted.  That would explain the null response.  Most of the early arduino device models don't have much RAM to begin with.  It is very easy to run out of RAM and not realize it.

New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
May 23, 2017 - 8:34 pm
sp_Permalink sp_Print

Thanks for the tip. I am running low on RAM. Are there any good libs (or tricks) out there that provide memory resource tracking?

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online: acemarie, oddappz
23 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:






Viewport Tech

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565


Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee