0

No Feeds after deepsleep
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

No Feeds after deepsleep

by Gediminas on Fri Jan 04, 2019 5:06 pm

Hello,
I just made simple weather station for test with ESP8266. Finally it seems I managed to put few examples together - DHT22 and analog read. But need to get it work with deepsleep as this will be autonomous weather station powered by battery. When I put a delay(); in the end of the loop(); I get feeds recorded, but when I replays delay(1000*10); by ESP.deepSleep(1000000*10); no feeds have been uploaded. Serlial monitor shows successful connection to IOAdafruit, but no upload.
Any ideas how to make it work?

Gediminas
 
Posts: 2
Joined: Wed Jan 02, 2019 5:58 am

Re: No Feeds after deepsleep

by brubell on Mon Jan 07, 2019 11:00 am

Using DeepSleep with Adafruit IO is tricky, you'll want to connect to Adafruit IO and write to a feed from within the setup(), and then sleep after (since it resets the board, you'll need to reconnect to IO).

We have an example which is part of the Adafruit IO Arduino Library available here for reference: https://github.com/adafruit/Adafruit_IO ... psleep.ino

In your use-case, you'll want to connect to adafruit io, take a reading from the DHT22, set up and write to the feed, and go into deepsleep.

brubell
 
Posts: 282
Joined: Fri Jul 17, 2015 10:33 pm

Re: No Feeds after deepsleep

by Gediminas on Fri Jan 11, 2019 1:41 pm

Hi Brubell,

thank you for replay. I've missed notification about your replay.

I should be proud of my self as being just a total amateur and trying all different sketch setups found work around and it is like you suggest - put publish commands in to separate function, execute it in to setup() and after that put deepsleep also in setup. But still do not understand why this syntacsys works and why in main loop does not.

Any way, I had to put one command to set gpio high, take voltage mesurments and put it low. After that no feeds again... oh, had to spend two longs evenings. And just after I've put delay() before deepsleep command feeds are online and keep going for few days now. First I put delay(1000), but as I need as short time with wifi on as possible, I have lowered it till 100 millis. Then only one out of three feeds has been uploade. Now it is 500 millis delay before deepsleep and it is working ok.

Gediminas
 
Posts: 2
Joined: Wed Jan 02, 2019 5:58 am

Please be positive and constructive with your questions and comments.