So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By QuickFix
#78814
AcmeUK wrote:You do not say if you are using the Arduino IDE or the ESP8266 SDK.

Eli Lurie wrote:(Arduino framework)

:idea:
BTW. An IDE is only the development environment (the thing you type your code in; you could also use Notepad if you'd wish).

As AcmeUK says, it sounds like deep sleep is not working correctly every time.
Because it's a problem that occasionally occurs, you'll have to put some more (and creative) effort to find the culprit.

I think your best (and quickest) bet to tackle the problem is to:
  • Get hold of the entire hardware-portion (PCB) from a client that gives the most problems (just swap it out)
  • Flash it with exactly the same code, except for the deep sleep time-out: instead of waking up every hour, let it wake up every five (or less) minutes
  • Connect GPIO1 or GPIO2 (both are outputting the same at boot) to a monitoring PC set to 74880 Baud and let it monitor (and log) all boot messages
  • Wait 'till it fails and analyze the error (and/or paste the entire boot message here)
It might also help if you'd show us (part of) the schematic around deep sleep (GPIO16 -> RESET) and/or PCB layout.

Please note that the ESP has very strict (absolute minimum and maximum) power requirements: it must be very stable and filtered (by using a small capacitor very close between the VCC and GND pins) at 3.3V (NOT 5V) and at least able to deliver at least 300mA, but preferably more (say 500mA). :idea:
User avatar
By Eli Lurie
#78847 QuickFix and AcmeUK. Thank you again.
QuickFix Wrote:
Flash it with exactly the same code, except for the deep sleep time-out: instead of waking up every hour, let it wake up every five (or less) minutes
Connect GPIO1 or GPIO2 (both are outputting the same at boot) to a monitoring PC set to 74880 Baud and let it monitor (and log) all boot messages

As your suggestion, we are trying to recreate it in our LAB exactly like that.
QuickFix Wrote:
Please note that the ESP has very strict (absolute minimum and maximum) power requirements: it must be very stable and filtered (by using a small capacitor very close between the VCC and GND pins) at 3.3V (NOT 5V) and at least able to deliver at least 300mA, but preferably more (say 500mA).

Indeed we have verified that this is how our board is designed.
Two questions:
1. Is there a chance from your experience that the chip have failed to enter deep sleep (once in few hundred times) and it have entered some yield() that consumes battery power?
2. Is there a chance that bootloader stage one (ROM) for some reason have been started in UART mode (waiting for firmware flash) and in that case HW WDT does not reset the chip (and it is waiting there and consumes battery power)?
User avatar
By QuickFix
#78858
Eli Lurie wrote:1. Is there a chance from your experience that the chip have failed to enter deep sleep (once in few hundred times) and it have entered some yield() that consumes battery power?

I don't have enough real life experience with deep sleep to give a substantiated comment on that, though of course in theory when an ESP is somewhere between "Going to sleep" and "Deep sleep" it is consuming more power than while in actual deep sleep.
But I personally haven't heard of such a state before, maybe Rudy or someone else with professional (and hardware) experience can tell you more about this (I'm just a hobbyist).

Eli Lurie wrote:2. Is there a chance that bootloader stage one (ROM) for some reason have been started in UART mode (waiting for firmware flash) and in that case HW WDT does not reset the chip (and it is waiting there and consumes battery power)?

The ESP can only enter UART mode when GPIO0 is in a (near) LOW state at boot.

If you make sure GPIO0, GPIO1 and GPIO2 are pulled HIGH, while GPIO15 is pulled LOW at boot, the ESP should boot properly.

Please note that while GPIO1 and GPIO2 may theoretically be in any state at boot, experience tells it's better to pull them HIGH to prevent potential booting problems. :idea:
User avatar
By btidey
#78863
QuickFix wrote:I don't have enough real life experience with deep sleep to give a substantiated comment on that, though of course in theory when an ESP is somewhere between "Going to sleep" and "Deep sleep" it is consuming more power than while in actual deep sleep.
But I personally haven't heard of such a state before, maybe Rudy or someone else with professional (and hardware) experience can tell you more about this (I'm just a hobbyist).



I often use EN to wake up my battery powered devices. If the device powers up with EN low (via a fairly high value pull down) then I have occasionally seen them get into some intermediate state consuming about 2mA. When it wakes up, does its thing, and enters deep sleep then it consumes the normal deep sleep few uA. From then on all is OK. So I make sure that I trigger these units at least once after an initial power up.

On another note, the 10K pull down being used for GPIO15 is a bit high to guarantee a low during boot. There is an internal ~35K pull up on this pin at boot time. I normally use 4k7.