esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
15.98k stars 13.34k forks source link

ESP.deepSleep hangs after wakeup - ESP12F (Working on older chips) #6007

Closed petrilloa closed 5 years ago

petrilloa commented 5 years ago

Basic Infos

Platform

Settings in IDE

Problem Description

A few months ago, we start developing a custom PCB using ESP8266, ESP12F from AI.

esptool.py --port COM14 flash_id esptool.py v2.6 Serial port COM14 Connecting... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi MAC: cc:50:e3:04:37:7e Uploading stub... Running stub... Stub running... Manufacturer: 20 Device: 4016 Detected flash size: 4MB Hard resetting via RTS pin...

After successfully deploy 100 boards, we receive a new batch from a distributor on China. The new chip, looks the same as the old one, except it has an Expressif logo instead of AI logo.

Then, using esptool, we check that was manufactured by other factory

esptool.py --port COM14 flash_id esptool.py v2.6 Serial port COM14 Connecting... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi MAC: dc:4f:22:5e:93:23 Uploading stub... Running stub... Stub running... Manufacturer: 0e Device: 4016 Detected flash size: 4MB Hard resetting via RTS pin...

The PCB was build using all the following design rules and experiences from Espressif, blogs, etc. Example: https://www.instructables.com/id/ESP-12F-ESP8266-Module-Minimal-Breadboard-for-Flas/

Also, we using several recomendations from videos of Andreas Spiess. @SensorsIOT and read post by @igrr.

image

The sensor, reads a value, then enter a deepSleep cycle until wakeups. All was working fine in more than 100 pcb!!!

After receiving the new batch, with the same PCB and CODE, the ESP hangs after wake up.

We already try 10 chips off the new bach, all have the same issue.

Trying this simple sketch:

MCVE Sketch


/**
 * An example showing how to put ESP8266 into Deep-sleep mode
 */

 #include <Arduino.h>
extern "C" {
#include <user_interface.h>
}

#define STATUS_LED  2   

void setup() {

  pinMode(STATUS_LED, OUTPUT);

  Serial.begin(74880);
  Serial.setTimeout(2000);

  digitalWrite(STATUS_LED, false);

  // Wait for serial to initialize.
  while(!Serial) { }

  Serial.print("Chip ID: ");
  Serial.println(ESP.getChipId());

  rst_info *rinfo = ESP.getResetInfoPtr();

  Serial.print(String("\nResetInfo.reason = ") + (*rinfo).reason + ": " + ESP.getResetReason() + "\n");

  Serial.println(".");  
  Serial.println("I'm awake.");

  delay(1000);

  Serial.println("Going into deep sleep for 3 seconds");
  ESP.deepSleep(3e6);    

  delay(5000);
}

void loop() {
}

Debug Messages ON WORKING CHIP

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v951aeffa
~ld
Chip ID: 276350

ResetInfo.reason = 5: Deep-Sleep Wake
.
I'm awake.
Going into deep sleep for 3 seconds

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v951aeffa
~ld
Chip ID: 276350

ResetInfo.reason = 5: Deep-Sleep Wake
.
I'm awake.
Going into deep sleep for 3 seconds

Debug Messages ON NOT WORKING CHIP

ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v951aeffa
~ld
Chip ID: 6198051

ResetInfo.reason = 5: Deep-Sleep Wake
.
I'm awake.
Going into deep sleep for 3 seconds

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

Hangs/Freeze until power down, or hard reset (button from RESET to GND).

Things we already try

Similar ISSUES

5892

2768

https://github.com/universam1/iSpindel/issues/59

Please HELP US!!! Can be a faulty batch?

RPBCACUEAIIBH commented 6 months ago

Yup, 10k pull up on SD0 (MISO) works for me too. TY! (Also using generic module labeled ESP8266MOD with Espressif logo, sold as ESP12F module.)

alexander-malyshev-wdc commented 6 months ago

Thanks. Will try with my 12F model - have same issue.

johanneszelger commented 6 months ago

I have tried today to solder 9k between D6 (Which should be MISO on my Wemos D1 mini) and a 400 Ohm resistor between D0 and RST. However still no luck in getting it to work. The internal LED blinks very very briefly when it is supposted to wake up, so something is definitely happening. My serial also says rst cause:2, boot mode:(3,6), however nothing is happening afterwards.

Sorry for soldering quality, it was just to test, since i have been struffling with this for weeks now

IMG_0364

RPBCACUEAIIBH commented 6 months ago

I have tried today to solder 9k between D6 (Which should be MISO on my Wemos D1 mini) and a 400 Ohm resistor between D0 and RST. However still no luck in getting it to work. The internal LED blinks very very briefly when it is supposted to wake up, so something is definitely happening. My serial also says rst cause:2, boot mode:(3,6), however nothing is happening afterwards.

Sorry for soldering quality, it was just to test, since i have been struffling with this for weeks now

IMG_0364

Because That's not the right MISO pin... The right one is not connected on the D1 Mini, it's the second pin from the top on the image you posted opposite to the antenna, (on the black module, right after the "PA +25dBm"marking... not on the top or bottom row of GPIOs). Try pulling that high with the 9K resistor.

shivan commented 6 months ago

I'm also searching for a solution for the Wemos D1 mini. Currently I use the partly workaround with the code mentioned somewhere above. It woke up much better than with the ESP.deepSleep(). But this does not switch off the digital outs and I know power consumption is not as low as it could be. And I still have the problem, when my battery (using battery shield 1.2.0) was empty and solar power is back, the D1 mini does not wake up again. Maybe the root cause is the same like mentioned here.

RPBCACUEAIIBH commented 6 months ago

If the metal can on your D1 Mini says ESP8266MOD and doesn't wake from deep sleep then here's your solution:

313469273-3753e8a5-194e-47ec-8b33-eb798487a20f

johanneszelger commented 6 months ago

I have tried today to solder 9k between D6 (Which should be MISO on my Wemos D1 mini) and a 400 Ohm resistor between D0 and RST. However still no luck in getting it to work. The internal LED blinks very very briefly when it is supposted to wake up, so something is definitely happening. My serial also says rst cause:2, boot mode:(3,6), however nothing is happening afterwards. Sorry for soldering quality, it was just to test, since i have been struffling with this for weeks now IMG_0364

Because That's not the right MISO pin... The right one is not connected on the D1 Mini, it's the second pin from the top on the image you posted opposite to the antenna, (on the black module, right after the "PA +25dBm"marking... not on the top or bottom row of GPIOs). Try pulling that high with the 9K resistor.

You are amazing, that works!

manj9501 commented 6 months ago

Thanks a lot buddy @leofds, pulling up MISO with 10k resistor worked for my NodeMCU!

GeoX234 commented 5 months ago

YESSS !!!! Like others have stated above...... I can also confirm that this fix WORKS !! THANK YOU Sanc0Pansa !!!

Problem: D1 mini (clone with ESP8622MOD, no VENDOR print) doesn't wake up after "deep-sleep" with a software timer. You might observe a dim flash of the built-in LED, when the RTC module tries to boot up the chip for the first time. But the module does not boot and is frozen right there. The only way to continue then is to press manually the "Reset Button".
The fix:

  1. STANDARD : Connect RST pin to D0 pin with a simple wire bridge.
  2. On the bottom of the ESP module are 6 unlabeled connectors...internally connected to the flash memory chip. You need to solder a 10K resistor to the second connector from the left (GPIO7/SD0/MISO) and connect to a point with VCC 3,3V. For me it was the best to connect to a point on the backside. To the RESET push button, lower left corner. This pad carries also VCC 3.3V.

BAMM !! D1 mini clone boots with RTC timer periodically...runs a sketch, connects to Wifi.....goes back to sleep...and so on.... Powered by 3.3V batteries I measure (simple digital multimeter) in deep sleep mode a current consumption of 330uA. While USB is suspended, the CH340 USB bus convert chip takes still 90 to 150uA according to the data sheet.... AXaA AB BB

manj9501 commented 5 months ago

Hi folks! I probably jumped the gun when I concluded that my NodeMCU is working fine after soldering the 10K resistor between Vcc and MISO/SD0, when in reality, the problem still persists.

I soldered the resistor like so: 20240331_152314

And I was testing with the following code:

#include <ESP8266WiFi.h>
#include "secrets.h"
#include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros

char ssid[] = SECRET_SSID;   // your network SSID (name) 
char pass[] = SECRET_PASS;   // your network password
int keyIndex = 0;            // your network key Index number (needed only for WEP)
WiFiClient  client;

unsigned long myChannelNumber = SECRET_CH_ID;
const char * myWriteAPIKey = SECRET_WRITE_APIKEY;

int number = 0;

void setup() {
  Serial.begin(115200);  // Initialize serial
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo native USB port only
  }
  WiFi.mode(WIFI_STA); 
  ThingSpeak.begin(client);  // Initialize ThingSpeak

    // Connect or reconnect to WiFi
  if(WiFi.status() != WL_CONNECTED){
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(SECRET_SSID);
    while(WiFi.status() != WL_CONNECTED){
      WiFi.begin(ssid, pass);  // Connect to WPA/WPA2 network. Change this line if using open or WEP network
      Serial.print(".");
      delay(5000);     
    } 
    Serial.println("\nConnected.");
  }

  int x = ThingSpeak.writeField(myChannelNumber, 1, number, myWriteAPIKey);
  if(x == 200){
    Serial.println("Channel update successful.");
  }
  else{
    Serial.println("Problem updating channel. HTTP error code " + String(x));
  }
  Serial.println("I'm awake, but I'm going into deep sleep mode for 20 seconds");
  ESP.deepSleep(20e6); 
}

void loop() {

}

The NodeMCU works fine for the first few times (wakes up, connects to WiFi, updates the Thingspeak channel) but after 5-10 deep sleep-wake cycles, it again refuses to connect to the WiFi.

Will probably be using ESP32 in place of the glitchy modules based on ESP8266, now.

mhightower83 commented 5 months ago

@manj9501 That looks like a 1K resistor (brown, black, red). For a 10K resistor, look for color bands brown, black, orange.

Colkerr commented 5 months ago

Does it wake up or is it a wifi problem ? Agree about the 1K resistor but the serial monitor will show if it's waking and not connecting or simply not waking. With about 50 running so far I don't find the ESP8266 particularly glitchy. The odd one is weak on wifi but not that bad.

manj9501 commented 5 months ago

@mhightower83 my bad! I definitely needed a second opinion on this smh. However, it's still exhibiting the same behavior.

The new setup: 20240402_111622

The code remains the same.

Serial log: Screenshot 2024-04-02 112345

As you can see from green highlights, it hardly takes any time to connect to WiFi when it's working fine. But after a few cycles, it wakes up and just refuses to connect to WiFi, as can be seen in the red highlight.

@Colkerr it's a WiFi issue.

GeoX234 commented 5 months ago

Ok, with the right resistor your DEEP SLEEP is working now. Worked 6 times (your green markings) Last deep sleep: 10:54:28.743 "I'm awake, but going into deep sleep mode for 20 seconds." ......approximately 20 seconds later.... 10:54:48.035 "ǃ��r�b� #��o'......." <--- these cryptic letters show that the chip is booting and finishes that successfully because : 10:54:48.254 "..............." <--- these dots mean, it's trying to connect to your wifi....but can't establish a connection.

That's not a "deep sleep" problem anymore......

manj9501 commented 5 months ago

Yes @GeoX234, the issue is no longer with deep sleep, you're right!

I suspect that after waking from one of the deep sleep cycles, the WiFi radio is probably not waking up properly. I will do some more research on this now.

Thanks to all the folks who helped till here!

GeoX234 commented 5 months ago

When I remove all that ThingSpeak stuff, I can compile and test your code and it works with deep sleep. I suspect after you connect successfully to your router....ThingSpeak expect something to happen. "Each channel has an associated Write API Key that is used to control who can write to a channel. bla bla bla........" Because that doesn't work, you get kicked out of your wifi connection. Try this code :

#include <ESP8266WiFi.h>
#include "secrets.h"
#include "ThingSpeak.h" 

char ssid[] = SECRET_SSID;   
char pass[] = SECRET_PASS;  
int keyIndex = 0;           
WiFiClient  client;

unsigned long myChannelNumber = SECRET_CH_ID;   
const char * myWriteAPIKey = SECRET_WRITE_APIKEY; 

int number = 0;

void setup() {
  Serial.begin(115200);  
  while (!Serial) {
    ; 
  }
  WiFi.mode(WIFI_STA); 
  //ThingSpeak.begin(client);  // Initialize ThingSpeak

  if(WiFi.status() != WL_CONNECTED){
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(SECRET_SSID);
    while(WiFi.status() != WL_CONNECTED){
      WiFi.begin(ssid, pass);  
      Serial.print(".");
      delay(5000);     
    } 
    Serial.println("\nConnected.");

  }

  //int x = ThingSpeak.writeField(myChannelNumber, 1, number, myWriteAPIKey);
  //if(x == 200){
  //  Serial.println("Channel update successful.");
  //}
  //else{
  //  Serial.println("Problem updating channel. HTTP error code " + String(x));
  //}
  Serial.println("I'm awake, but I'm going into deep sleep mode for 20 seconds");
  ESP.deepSleep(20e6); 
}

void loop() {
}
manj9501 commented 5 months ago

Your code made it work for 12 cycles before it woke up and refused to connect to WiFi, yet again.

manj9501 commented 5 months ago

@GeoX234 you get that message since you don't have this secrets.h file image

Colkerr commented 5 months ago

do you mean to wait 5 seconds between each attempt to connect ? I have 50ms. If your wifi is slow for some reason you probabaly give up before it's made many tries. Anyway I've flashed you code but with my credentials and it's running fine so far - 20 updates. I'll leave it running for an hour but I suspect it's fine. No it's not. It does occasionally not connect first time and then the 5 secs per attempt cause a long period without anything happening. I'll change to 50ms and leave it for a while. No still a problem.

manj9501 commented 5 months ago

While I'm glad that you are able to replicate the issue, it leads me to suspect that the way this code is written is the issue. What's your take on it?

Colkerr commented 5 months ago

I'm going to pass you my code that works but I have to test it first as I've extracted it from a larger program. I recall having a bit of trouble when I first starting deep sleeping but now I have lots of programs working in different ways, but I always copy what worked before. I'll be as fast as possible but may be tomorrow evening before I've give it a good check and replied. Also I've used wifimanager in the program I'm checking but I have another that doesn't so I need to figure out what's closest to your code but which works.

Colkerr commented 5 months ago

Might as well let you have what's working currently but I'll leave it going overnight. This isn't the fastest way to connect but that only matters if you are running from battery. If it matters to you I will send you a longer version - I store a flag in RTC memory so my code knows whether it's power up or wake up and it connects differently since it knows wifi.begin() should work on wake up but for power on the ssid and password are needed. (I don't know how you posted code so neatly.)

//Demonstrate fast WiFi reconnection after deepSleep. Also Reset reason, and deepSleep. //#include //https://github.com/tzapu/WiFiManager

include

include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros

char ssid[] = "xxxxxxxxxx"; // your network SSID (name) char pass[] = "xxxxxxxxxx"; // your network password unsigned long myChannelNumber = xxxxxxxxxx; const char * myWriteAPIKey = "xxxxxxxxxx"; const int iIntervalSecs = 20, iLongWaitSecs = 1000; bool DEBUG = 1; int number = 123; WiFiClient client;

String sFileName, sFileDate, sFileTime;

void setup() { Serial.begin(9600); // start up serial port Serial.println(); Serial.print( FILE); Serial.print(TIME); Serial.println(DATE); Serial.println(ESP.getResetReason().c_str()); // this should show power up here when turned on enableWiFiAtBootTime(); //for releases >=3 ThingSpeak.begin(client); // Initialize ThingSpeak WiFi.mode(WIFI_STA); WiFiTasks(); }

void loop() { Serial.println(millis()); Serial.println(" when connected"); int x = ThingSpeak.writeField(myChannelNumber, 1, number, myWriteAPIKey); if(x == 200){ Serial.println("Channel update successful."); } else{ Serial.println("Problem updating channel. HTTP error code " + String(x)); } Serial.println("I'm awake, but I'm going into deep sleep mode for 20 seconds"); ESP.deepSleep(iIntervalSecs * 1e6);
}

void WiFiTasks() { int counter = 0; WiFi.begin(ssid, pass); while (WiFi.status() != WL_CONNECTED) { delay(10); // use small delays, NOT 500ms if (++counter >= 1000 ) { Serial.println("cannot connect, sleep and try later "); ESP.deepSleep(iLongWaitSecs * 1e6 ); } } Serial.print(" tries = "); Serial.println(counter); }

manj9501 commented 5 months ago

Brother @Colkerr, it is with great joy that I tell you that your code has been running perfectly fine on my NodeMCU as well as my bare ESP12F module, for over 3 hours now🥳 Thanks very much for helping me out!

But I wonder what exactly was wrong with the code I was using previously? I mean what exactly are the best practices here?

Colkerr commented 5 months ago

I want to figure that out also. It might be the weekend before I have time. But one thing I discovered recently, the ESPs can arrive with the wifi flash area in a mess which glitches wifi, so always use the compile option to reflash all when it's new. Also I include the enableWiFiAtBootTime() as some say it's needed for the newer IDE versions.

Colkerr commented 5 months ago

@manj9501 I changed this section in your code and think it fixes the problem. I took the WiFi.begin(ssid, pass); out of the while loop. (And also reduced the delay(5000) to 50 though that wasn't the problem.)

if(WiFi.status() != WL_CONNECTED){ Serial.print("Attempting to connect to SSID: "); Serial.println(SECRET_SSID); WiFi.begin(ssid, pass);
while(WiFi.status() != WL_CONNECTED){ Serial.print("."); delay(50);
} Serial.println("\nConnected."); }

sendcard commented 4 months ago

YESSS !!!! Like others have stated above...... I can also confirm that this fix WORKS !! THANK YOU Sanc0Pansa !!!

Problem: D1 mini (clone with ESP8622MOD, no VENDOR print) doesn't wake up after "deep-sleep" with a software timer. You might observe a dim flash of the built-in LED, when the RTC module tries to boot up the chip for the first time. But the module does not boot and is frozen right there. The only way to continue then is to press manually the "Reset Button". The fix:

  1. STANDARD : Connect RST pin to D0 pin with a simple wire bridge.
  2. On the bottom of the ESP module are 6 unlabeled connectors...internally connected to the flash memory chip. You need to solder a 10K resistor to the second connector from the left (GPIO7/SD0/MISO) and connect to a point with VCC 3,3V. For me it was the best to connect to a point on the backside. To the RESET push button, lower left corner. This pad carries also VCC 3.3V.

BAMM !! D1 mini clone boots with RTC timer periodically...runs a sketch, connects to Wifi.....goes back to sleep...and so on.... Powered by 3.3V batteries I measure (simple digital multimeter) in deep sleep mode a current consumption of 330uA. While USB is suspended, the CH340 USB bus convert chip takes still 90 to 150uA according to the data sheet.... AXaA AB BB

@GeoX234 You are a genius! I follow your steps and save my D1 mini from deep sleep. However, because of shorting EST and D0, the D1 mini can't be flashed. Is it possible to add a resistor between EST and D0 to make it flash?

Colkerr commented 4 months ago

@sendcard I use a resistor. 10k or more even seems to work fine.

sendcard commented 4 months ago

@sendcard I use a resistor. 10k or more even seems to work fine.

Thanks @Colkerr. I have used 510 ohm, and it works perfectly.

sendcard commented 4 months ago

8393ED40-D67D-4F6D-8864-E9F8D8C6C9CA

To summary up: RST --510 ohm -- D0
GPIO7 -- 10k ohm -- 3.3V

n89thanh commented 4 months ago

@GeoX234 I also tried connecting to the corner of the reset button like in your picture and IT WORKS! Thank you and everyone for solving this years-old issue!

gagabla commented 3 months ago

Hey guys, after weeks of frustration i came across this ticket and the solution/workaround with pullup resistor seems to work for everyone ... just not me. Out of 7 ESP12f modules from 2 suppliers (via aliexpress) only one 1 working (=waking up on first reset from deep sleep) without any additional measure, and one additionally started to work by adding the pull-up resistor 10k from MISO to 3.3V.

I also tried lower resistor value 1k but no help. I also checked the power-supply, now i am using a lab-power-supply and i tried also slightly higher voltage since someone earlier mentioned that even slight drop below 3.3 V might affect wakeup, again no help.

One additional observation i have is, that in "zombie mode", the MISO-signal shows permanent square signal with roughly 300k Hz frequency which is very different from the short sequences observed when waking up properly.

And one more observation i cannot currently make sense out: for my use-case i dont have GPIO16 connected to RST becaues i only want to wakeup on button press, still, if i enter deep sleep with timer, something seems to happen when the timer expires:

  1. ESP running normal, running my code: MISO signal stable at 3.3 V, almost no ripple, 18 mA current
  2. ESP entering deep sleep: MISO signal stable at 3.3 V, almost no ripple, current below what my power-supply can measure
  3. ESP deep sleep timer expired (but not connected to RST as mentioned): short flash of on-board LED, MISO signal starts jittering in a range of 0.8 V (!), 16 mA current (another kind of zombie mode??)
  4. once i press reset button manually, ESP enters zombie mode described by all the others, i get the one line output but not more, MISO shows permanent square signal, 36 mA current

So while the state in 4. is the zombie mode well known here in the ticket, i think in 3. i have yet another strange state which i cannot understand how it can exist since i havent connected the wakeup pin ... This is not an issue when i enter deepsleep without timout (/timout=0), so i am just curious if someone has a theory why the chip reacts to the timeout even if i dont have the wakup signal connected.

@leofds how did you come up with this solution which worked for you and all the others back in 2020? Maybe if i can understand your train of thought, i could see what is the difference in my case and take appropriate measures.

emaddoost commented 3 months ago

Hi everyone, Can anyone provide a hint on how to apply this solution to Arduino Nano ( Atmega328p)? it has different pins than you discussed so I don't know to which pin should I connect RST (and with how much resistor) to solve this wake-up problem. My problem is that my DFPlayer mini module does not work correctly after wake up, so I think your solution may apply to my case as well. Thank you in advance.

Colkerr commented 3 months ago

I doubt it's the same cause. Nano is a different microprocessor family as you have noted.

n89thanh commented 3 months ago

@gagabla you say you're connecting with MISO... Which GPIO pin exactly are you referring to? Make sure you're connecting GPIO7, not GPIO12.

gagabla commented 3 months ago

@n89thanh thanks for jumping in, i connected the resistor to the pin labeled with MISO, so i hope this is the correct one since i cannot find the mapping to GPIO7 in the available material for esp12f / esp12e. top-view-low bottom-view-low I further connect the resistor to 3.3v then with a little clamp since i want to have my esp12f modules to be exchangeble (because of this issue, obviously) and the pogo pins dont work so well when i solder into the pins.

There were a few images above here in the thread, eg from manj9501 and from sendcard which seem to connect to the same pin on a similar board (and for them it seemed to work!).

Any other idea? Do you have an explanation why this resistor is helping for everybody else so i could check what is different for me?

Craig1516 commented 3 months ago

@gagabla. Here is a plugable solution I designed that allowed me to insert different radios in to a PCB. It is kind of a bed of nails using segmented guitar strings. It is quite effective. This wasn't for a ESP 12, but the idea could be adapted. There were many other plugable solutions discussed in the rest of the [post]. Hope it helps. (https://forum.mysensors.org/topic/11954/most-reliable-best-radio/218?_=1655321080395)

Colkerr commented 3 months ago

@n89thanh thanks for jumping in, i connected the resistor to the pin labeled with MISO, so i hope this is the correct one since i cannot find the mapping to GPIO7 in the available material for esp12f / esp12e. top-view-low bottom-view-low I further connect the resistor to 3.3v then with a little clamp since i want to have my esp12f modules to be exchangeble (because of this issue, obviously) and the pogo pins dont work so well when i solder into the pins.

There were a few images above here in the thread, eg from manj9501 and from sendcard which seem to connect to the same pin on a similar board (and for them it seemed to work!).

Any other idea? Do you have an explanation why this resistor is helping for everybody else so i could check what is different for me?

Without seeing everything you are doing it's impossible to know but here is my fix which has worked for all 8 faulty ones I had. 20240605_115643

gagabla commented 3 months ago

@Craig1516 thanks for the tipp, i am quite happy with the pogo pins/clamps though. Not so cheap (20€ on aliexpress ) but very nice to handle for prototyping. Here is how it looks in my setup: overall

@Colkerr yes, i am aware of all the happy users of the MISO workaround above ... just .... for me it is not working consistently :-( (only for one board out of 7) My setup is the bare minimum to reproduce the issue i belive, see foto above. I have connected

Thats it! I can reproduce the issue on most of my modules, i need two resets via push-button for EPS8266 to actually start once it is in deepSleep. When resetting while it is running normally, reset works every time. (but i also have 1 module where the issue is not present right from the beginning and one module where the issue vanished once the 10k were used for MISO).

Code is also minimal:

void setup() {

  Serial.begin(74880);
  Serial.println("Started");

  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);  // LED on to see something
  delay(1000);

  Serial.println("Going to sleep");
  ESP.deepSleep(0, WAKE_RF_DISABLED);
}

void loop() {}

So if only i could understand what motivates the MISO workaround , then i might also be able to find out why it does not work for me ... like i wrote above, i could already observe that when ESP8266 does not wake up properly and goes to zombie mode, MISO pin is permanently going crazy with a square pattern with 300k Hz => seems that communication with flash memory not working normally.

Craig1516 commented 3 months ago

@ gagabla. These clamps look like what I've wanted for a long time. Just bought several. Thanks for the idea.

Craig1516 commented 3 months ago

@gagabla. Forgot to mention, Andreas Spiess has a great video on the zombie zone. I've found my projects have drifted there occasionally. Not only does it render your project dysfunctional, it is also a high current event and will kill your battery... if you are using one.

gagabla commented 3 months ago

@Craig1516 just pay attention that you fetch one with the right pin spacing of 2 mm for esp11, for other spacings there are much cheaper offers, but for 2 mm had to by the expensive stuff.

Thanks for the hint to the videos from Andreas, I was not aware of those. I checked few which are related to deep sleep but couldn't find any mention of zombie Mode so far, do you remember which video it was?

As written in previous comment I can observe two flavors of zombie Mode, first one consumes about 15 mA (although esp is not running) and second flavor of zombie mode ( the one typically observed here in the thread) draws 36 mA.

Craig1516 commented 3 months ago

I spent some time this evening looking. Never found it. But the basic takeaway I remember is that if the MCU falls in to a lower voltage as indicated by the datasheet the MCU will not recover and sit there churning, as you have found. How to avoid: I remember having a power supply with adequate capacitance and filtering was key. If I come across it I will certainly send your way!

Craig

From: gagabla @.> Sent: Friday, June 7, 2024 11:30 PM To: esp8266/Arduino @.> Cc: Craig1516 @.>; Mention @.> Subject: Re: [esp8266/Arduino] ESP.deepSleep hangs after wakeup - ESP12F (Working on older chips) (#6007)

@Craig1516 https://github.com/Craig1516 just pay attention that you fetch one with the right pin spacing of 2 mm for esp11, for other spacings there are much cheaper offers, but for 2 mm had to by the expensive stuff.

Thanks for the hint to the videos from Andreas, I was not aware of those. I checked few which are related to deep sleep but couldn't find any mention of zombie Mode so far, do you remember which video it was?

As written in previous comment I can observe two flavors of zombie Mode, first one consumes about 15 mA (although esp is not running) and second flavor of zombie mode ( the one typically observed here in the thread) draws 36 mA.

— Reply to this email directly, view it on GitHub https://github.com/esp8266/Arduino/issues/6007#issuecomment-2155835675 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AFHYUHCG2OOMIIJUAK6OZZDZGKQHBAVCNFSM4HHT54AKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJVGU4DGNJWG42Q . You are receiving this because you were mentioned.Message ID: @.***>