Feed read

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
marafino
 
Posts: 2
Joined: Wed Apr 27, 2022 3:30 pm

Feed read

Post by marafino »

I have an esp8266 with Arduino Uno I am using to post data to a feed on Adafruit IO and it works great. The Adadfruit part is running entirely on the esp8266. I am using feed->save(data) (feed is an AdafruitIO_Feed object) and the data uploads fine. But I can't read from any feeds. If I use feed->last value() Null is returned, and if I try and use
feed->onMessage(handleMessage);
feed->get();
It is never triggered when the feed changes value.
Is there something I need to do on the site to allow it to read? I am copying from the examples on git hub almost exactly so I don't understand why it won't work.

I been stuck on it for hours so any help is appreciated.
Thanks for your help in advanced.
Last edited by marafino on Wed Apr 27, 2022 8:14 pm, edited 3 times in total.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Feed read

Post by dastels »

Are you calling io.run(); in your loop?
Next, we have the main loop() function. The first line of the loop function calls io.run(); this line will need to be present at the top of your loop in every sketch. It helps keep your device connected to Adafruit IO, and processes any incoming data.
Dave

User avatar
marafino
 
Posts: 2
Joined: Wed Apr 27, 2022 3:30 pm

Re: Feed read

Post by marafino »

dastels wrote:Are you calling io.run(); in your loop?
Next, we have the main loop() function. The first line of the loop function calls io.run(); this line will need to be present at the top of your loop in every sketch. It helps keep your device connected to Adafruit IO, and processes any incoming data.
Dave
Yes I am.
Appreciate your response

User avatar
jwcooper
 
Posts: 1004
Joined: Tue May 01, 2012 9:08 pm

Re: Feed read

Post by jwcooper »

It might be useful to take a look at this example:
https://github.com/adafruit/Adafruit_IO ... _02_pubsub

Make sure that's working for you, and then compare where things can get updated in your code. It's a good example of writing to a feed, and then reading that value.

There are a lot of examples in the parent folder that may help too.

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”