Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By anotherjoe
#55183 Hi again I've had some partial success. I soldered a 100uF electrolytic cap directly across the battery terminals and now when I cold boot the device by disconnecting / reconnecting the battery, the device appears to be reliably booting up every time. Thanks Barnabybear for this suggestion.

The problem I have now is that once the device has booted up then shortly later been put into deep sleep, it refuses to wake. When it's in this 'stuck in sleep state', the only way to bring it back alive is to disconnect / reconnect the battery.

I do have GPIO16 connected to RST with a 470R resistor inline as shown in the schematic. Is this the problem - should GPIO16 be directly connected to RST with no resistor?

Thanks again
Joe
User avatar
By martinayotte
#55228 A 470R resistor between GPIO16 and RES is fine, I've even used a 1K without issues.
Connecting directly is not good, since it prevent having external RES during deepSleep, because GPIO is strong HIGH during this period. For example, the CH340 on NodeMCU or Wemos-D1-Mini are not able to do an external RES to do new upload because GPIO16 HIGH is stronger than CH340.
So, your issue is probably elsewhere ...
Do you still have a PullUp on RES ?
User avatar
By anotherjoe
#55248 Thanks martinayotte it's good to get confirmation that the 470R resistor is ok. Everything is connected exactly as per the schematic that I attached in this thread, with the exception of a new 100uF cap across the battery which has improved stability massively. So yes the RST pullup is still there.

I added some logging to my firmware and was able to see that the device actually is waking from deep sleep but I had a bug which came with the side effect of nothing logged for the wake event which mislead me to think deep sleep wake up wasn't working when it was..my bad :oops:

There is one odd thing that remains though: if the device is in deep sleep and I manually reset via the switch pulling the reset pin to ground, I see that the boot rst_reason flag comes through as REASON_DEEP_SLEEP_AWAKE = 5. I'd really hope that this would have come through as REASON_EXT_SYS_RST = 6 because then I could then detect in code that the device had been manually woken from sleep as opposed to automatically woken from sleep.

If I disconnect the battery for a short while when the device is in deep sleep then reconnect it, I see that the boot rst_reason flag does come through as REASON_EXT_SYS_RST = 6

I see this running with Arduino Core v2.3.0 on sdk v1.5.3

Does anyone have any idea why this would happen?

Cheers
Joe
User avatar
By Barnabybear
#55253 Please disregard this post the comments are based on incorrect information - see later posts.
****************************************************************************************************************
HI, I'm not sure how you are wakeing from deep sleep by pulling RST low with S1. In theory you have pulled RST low with GPIO 16 to enable deep sleep, so closing S1 should have no effect. I would expect you to pull RST high to wake the ESP. Are you sure that pressing S1 is waking the ESP? I can't see how that would work, unless S1 is connected to the wrong side of R6 and shorts Vcc to ground.
Last edited by Barnabybear on Sat Sep 17, 2016 6:14 am, edited 2 times in total.