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

Avatar

Please consider registering
Guest

Search

— 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
Avatar
JK
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
1
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?

Avatar
JasonW

Forum Posts: 12
sp_UserOfflineSmall Offline
2
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:
https://api.thingspeak.com/update?api_key=INSERTAPIKEYHERE&field1=1&field2=2&field3=3&field4=4&field5=5&field6=6&field7=7&field8=8

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.

Avatar
JK
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
3
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: alexparrado
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 250

Vinod: 142

piajola: 73

vespapierre: 63

Adarsh_Murthy: 59

cstapels: 54

Newest Members:

chrissaxon

getty

l3inbin

ossan

gbalychik

wul

Forum Stats:

Groups: 4

Forums: 17

Topics: 1242

Posts: 4315

 

Member Stats:

Guest Posters: 1

Members: 5546

Moderators: 0

Admins: 2

Administrators: Hans, lee