0

Help on battery saving with ESP8266, battery info, and remot
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Help on battery saving with ESP8266, battery info, and r

by clemens on Sun Jun 05, 2016 4:54 pm

I'm experimenting also with the ESP8266 Huzzah and sleep modes and I'm a bit frustrated. For testing I have connected two DHT22 to the board. I measure every minute and connect to my webserver to upload data via http. After that I send the Huzzah to sleep for about a minute.

I started with a wire connection between GPIO 16 and RST but after a certain time, sometimes hours, sometimes around 1 1/2 day the system stopps as reported in this thread and other postings in the web.

Than I added a delay of 100 ms after the deep sleep command but with no success. Same instable working as before.

Now I added a 10k pullup to GPIO 0 but same issue.

Lastly I replaced the plain wire between GPIO 16 and RST with a 330 Ohm resistor. But also no luck!

Now I changed the delay from 100 ms to 1000 as my last idea to this problem. Some people say moving most out of loop() to setup() but I can not imagine what this should help!

Do you have any idea what is left to try? I'm a bit annoyed about such a creepy sleep implementation. I ordered a bunch of ESP8266 Huzzahs and can they throw away now because an other setup as sleep and battery powered makes no sense.

I experimented the last days and weeks with this problem and appreciate any help!

clemens
 
Posts: 41
Joined: Fri Jan 06, 2012 12:21 am

Re: Help on battery saving with ESP8266, battery info, and r

by bradsour on Sun Jun 05, 2016 5:18 pm

clemens wrote:I'm experimenting also with the ESP8266 Huzzah and sleep modes and I'm a bit frustrated. For testing I have connected two DHT22 to the board. I measure every minute and connect to my webserver to upload data via http. After that I send the Huzzah to sleep for about a minute.

I started with a wire connection between GPIO 16 and RST but after a certain time, sometimes hours, sometimes around 1 1/2 day the system stopps as reported in this thread and other postings in the web.

Than I added a delay of 100 ms after the deep sleep command but with no success. Same instable working as before.

Now I added a 10k pullup to GPIO 0 but same issue.

Lastly I replaced the plain wire between GPIO 16 and RST with a 330 Ohm resistor. But also no luck!

Now I changed the delay from 100 ms to 1000 as my last idea to this problem. Some people say moving most out of loop() to setup() but I can not imagine what this should help!

Do you have any idea what is left to try? I'm a bit annoyed about such a creepy sleep implementation. I ordered a bunch of ESP8266 Huzzahs and can they throw away now because an other setup as sleep and battery powered makes no sense.

I experimented the last days and weeks with this problem and appreciate any help!


I'm not sure you should have anything in loop. I have nothing in loop because the nature of the ESP is to be reset each time. Unless of course you don't plan on any power saving features and are just letting the wifi stay connected... is that the case? Hard to tell without knowing what your code is doing.

bradsour
 
Posts: 4
Joined: Fri May 29, 2015 12:12 am

Re: Help on battery saving with ESP8266, battery info, and r

by adafruit_support_rick on Mon Jun 06, 2016 7:17 am

This seems to be a common problem with the ESP8266. They don't always come out of deep sleep properly. As I understand it, they tend to come up in bootloader mode sometimes.

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Help on battery saving with ESP8266, battery info, and r

by dalowe999 on Sat Jul 16, 2016 2:48 pm

Is the consensus that the esp12 doesn't work reliably in power saving mode (deep sleep)? If so, are there alternative devices that may work better? It seems like a lot of people on the internet are trying to use this in "battery" mode to collect data and forward it via wifi but are having similar wake up issues. Does ADAFRUIT have an opinion on this? If it isn't going to work (in this particular application), I'd like to stop banging my head on the wall ;-)

dalowe999
 
Posts: 2
Joined: Tue Mar 08, 2016 6:26 pm

Re: Help on battery saving with ESP8266, battery info, and r

by adafruit_support_rick on Sat Jul 16, 2016 5:07 pm

From the reports we have, the ESP doesn't always wake up properly from deep sleep. Sometimes, it wakes up into bootloader mode. Personally, I would pick something else if I needed to sleep the processor.

Have a look at the Feather WiFi.
https://www.adafruit.com/products/3010

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Help on battery saving with ESP8266, battery info, and r

by vyruz on Tue Sep 06, 2016 2:43 pm

Hi again,

Almost a year later I still haven't tackled this issue, my Adafruit Huzzah breakout ESP8266 keeps hanging itself up after going into deepsleep mode.
I've picked this up again last week and got a little bit further:
I read somewhere the bootloader logs messages serially using baudrate 74800bps (non-standard baud rate).
So I modified my arduino sketch to use this same baud rate, this enabled me to see my own software logs combined with the bootloader logs.
Below is the output of this updated sketch:
Code: Select all | TOGGLE FULL SIZE
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
                               
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v3ffe9848
~ld

Starting!
Connecting to AP: <ssid1>......Failed
Connecting to AP: <ssid2>......Failed
Connecting to AP: <ssid3>......Failed
Connecting to AP: <ssid4>......
WiFi connected
Analog read: 294 | mapped: 94 | voltage: 323.43
Connecting to MQTT... MQTT Connected!
V: 323.43 | T: 25.10 | H: 67

                                               
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
                               
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v3ffe9848
~ld
                                                                           
Starting!
Connecting to AP: <ssid1>......Failed
Connecting to AP: <ssid2>......Failed
Connecting to AP: <ssid3>......Failed
Connecting to AP: <ssid4>......
WiFi connected
Analog read: 294 | mapped: 94 | voltage: 323.43
Connecting to MQTT... MQTT Connected!
V: 323.43 | T: 25.10 | H: 67
                                               
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
                             
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
                             
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
                             
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)


What you see above are 2 successful loops, after that it goes into 'zombie mode'.
As you can see the RESET seems to be happening correctly, since it is exactly the same logging as with the successful loops.
The first reset after the logs of my own code (last V:... line) is a reset done after the the sleep timer expired.
The last 3 RESETs are me manually pushing the reset button, which again produces exactly the same logging.

I'd like to clarify the ESP does NOT boot into bootloader mode, since this produces another logging (captured by after putting the ESP into bootloader mode manually):
Code: Select all | TOGGLE FULL SIZE
 ets Jan  8 2013,rst cause:2, boot mode:(1,6)


As you can see this produces boot mode (1,6) instead of (3,6).

So my conclusion so far is that the sleep timer seems to work correctly, it is triggering the reset pin of the ESP.
But for some reason the ESP is not loading it's software (the 'load' logs seen after normal resets are missing ).

The only way I can recover from this situation is by removed all power and powering up again.

At this point I suspect my huzzah board to be faulty, and will order another one to see if that works better.
I'll keep this post updated.

vyruz
 
Posts: 7
Joined: Mon Oct 26, 2015 8:11 pm

Re: Help on battery saving with ESP8266, battery info, and r

by clemens on Tue Sep 20, 2016 7:30 pm

I found an German article about the ESP8266 vs. ESP8285 https://www.heise.de/make/meldung/Schne ... 06572.html with some example data gathered from an ESP8266 with sleep mode in between. I asked the author about any problems with the ESP8266 and sleep mode but he reported the "pure" ESP8266 board has no problem with sleeping and waking up! So the problem must be an other piece of the puzzle! Perhaps it is the Adafruit Huzzah board or the software implementation. I used the Arduino IDE for programming. The author or this article used a Lua script You can find an older version on http://blog.koepi.info/2016/07/home-log ... based.html

I tested also two different ESP8266 Huzzahs, the blue one and the newer with the black PCB and golden antenna, but no differences, both are not working as expected in sleep mode.

clemens
 
Posts: 41
Joined: Fri Jan 06, 2012 12:21 am

Re: Help on battery saving with ESP8266, battery info, and r

by adafruit_support_rick on Wed Sep 21, 2016 9:25 am

I've seen suggestions of pullups on GPIO0 and GPIO2, but the breakout already has those.

This thread claims to have a fix for it, but I'm skeptical.
http://www.esp8266.com/viewtopic.php?f= ... 19&start=5

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Help on battery saving with ESP8266, battery info, and r

by clemens on Tue Nov 01, 2016 8:33 pm

Some month ago I gave up to hope for a solution to this deep sleep problem (in the knowledge that I have a couple unusable Adafruit Huzzah ESP8266 on the shelf).

Now I tried an update of the ESP8266 Arduino core and I must say it seems that it leads to a much more stable operation! I had the 2.0.0 version on the computer before and updated to the latest version 2.3.0 now. The same sketch that crashed after minutes or hours runs now nearly 2 days with one update per minute. That means till now about 2800 data set updates and also 2800 wake up-sleep cycles! It looks promising!!

clemens
 
Posts: 41
Joined: Fri Jan 06, 2012 12:21 am

Re: Help on battery saving with ESP8266, battery info, and r

by pshankland on Mon Jan 30, 2017 5:35 pm

clemens wrote:Some month ago I gave up to hope for a solution to this deep sleep problem (in the knowledge that I have a couple unusable Adafruit Huzzah ESP8266 on the shelf).

Now I tried an update of the ESP8266 Arduino core and I must say it seems that it leads to a much more stable operation! I had the 2.0.0 version on the computer before and updated to the latest version 2.3.0 now. The same sketch that crashed after minutes or hours runs now nearly 2 days with one update per minute. That means till now about 2800 data set updates and also 2800 wake up-sleep cycles! It looks promising!!


Are you able to confirm if you are using a resistor between GPIO 16 and RST? I am having the same issues even with using 2.3.0 but the board is going into boot loader immediately - I'm currently not using a resistor.

Thanks.

pshankland
 
Posts: 9
Joined: Tue Jan 03, 2017 7:04 pm

Please be positive and constructive with your questions and comments.