readIntField returns different results than data export | ThingSpeak API | 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
readIntField returns different results than data export
No permission to create posts
August 4, 2018
4:10 pm
Avatar
wadevcamp

Silver
Members
Forum Posts: 11
Member Since:
July 30, 2018
sp_UserOfflineSmall Offline

When I export the data from field1 of one of my channels, it shows no entry for that field (which is as it should be, since uploading data via data import of a file, while occurring without error, does not result in actually putting the data into the field -- but that's a separate problem).

However, when I use a readIntField call it returns a value of -1 with a code of 200 (i.e., operation occurred without error).

Anyone have an explanation?

August 6, 2018
8:09 am
Avatar
cstapels
Moderator
Members


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

I see your other post for the first problem (with data upload.)

For the readIntField question, according to the library documentation, it should return 0 if there is text data or no integer. Is your channel public? Can you share the channelID and the field you are reading from?

August 6, 2018
1:51 pm
Avatar
wadevcamp

Silver
Members
Forum Posts: 11
Member Since:
July 30, 2018
sp_UserOfflineSmall Offline

It is not public, but if there is a way for you to access a private channel, let me know what it is.

So, even though I can now upload data to the channel, it still seems as though a channel field that contains nothing (i.e., is blank/null) returns a value of -1 when retrieved via readIntField vs. a value of blank/null when retrieved via a data export.

August 6, 2018
2:53 pm
Avatar
cstapels
Moderator
Members


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

On the sharing tab of your channel, you can share your channel with at MathWorks.com. I will have access to view your data but not write access to add any data.
You can revoke it at any time.

August 7, 2018
2:47 pm
Avatar
wadevcamp

Silver
Members
Forum Posts: 11
Member Since:
July 30, 2018
sp_UserOfflineSmall Offline

You didn't give me a complete email address with which to share the channel....

I assumed you email to be cstapels at mathworks dot com, and shared the channel to that email.

Channel id is 535544, field is 3, and it is blank acc. to the data export utility.

August 9, 2018
3:32 pm
Avatar
cstapels
Moderator
Members


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

I just viewed the data in your channel. It looks like you recently updated it (possibly clearing it), but there was no data in the channel.

readIntField() is a member of the thingSpeak communication library for arduino and esp8266.

That function does not return the HTTP code, unless you use getLastReadStatus(). Is that what you are doing to get the 200 code?

This topic is ThinkSpeakAPI, which is related to but different from the thingSpeak communication library. Can you clarify what you are trying to do exactly? Are you using hardware to read from your channel?

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
32 Guest(s)

Currently Browsing this Page:
3 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

Georgesic, BalladolbineAboth, Wayneamure, MattonAboth, ginatm2, Spreeuw

Administrators: Hans: 387, lee: 457