I have a ESP Pro NodeMcu Lua antenna which operates normally but doesn't deep sleep.
#define led_pin 2
void setup() {
Serial.begin(9600); // Start the Serial communication to send messages to the computer
while (!Serial); // wait for Serial Monitor to open
delay(1000);
pinMode(led_pin, OUTPUT);
Serial.println("wake up");
digitalWrite(led_pin, HIGH);
delay(2000);
digitalWrite(led_pin, LOW);
ESP.deepSleep(6e7); /* Sleep 1 minute*/
// ESP.deepSleep(5e6); /* Sleep for 5 seconds */
}
void loop() {
}
The first pass through setup() writes correctly to the monitor. After connecting reset pin to D0 nothing shows on the monitor.
This code works fine with other ESPs
I have been using this individual chip to communicate using its NOW wireless facility.
The one-minute flash shows that D0 is successfully waking/resetting the ESP. The garbled text is the ESP8266 boot message, which is transmitted at 74880 baud.
Set the Serial Monitor and Serial.begin() to 74880, remove while (!Serial);, and inspect the complete boot message. Since execution does not reach "wake up" after reset, try reflashing with Flash Mode: DOUT or DIO, as some clone boards fail to boot in QIO mode. Also verify that the 3.3 V supply remains stable during Wi-Fi startup.
This ESP8266 controller project also shows the standard GPIO16-to-RESET deep-sleep arrangement. Since your board resets after one minute, that connection appears to be working; the problem is more likely occurring during the subsequent boot.
So deep sleep is working, but i suspect that the USB to TTL chip on the board is not switching between the baud-rates of the boot message and the sketch baud-rate properly.
That for sure, there is no purpose to this on a board without native USB.
adding a delay(1000); before and after the Serial.begin(); should ensure ample time for the USB to TTL converter to be ready.
To view the boot messages sent by the ESP, set the baud rate of the Serial monitor to 74880 bps
But the nodeMCU does have significantly more flash memory available than the default 512KB
Mind you the parameters that are board specific for the other boards that you can use are also options of the generic 8266, actually only the ESP8285 is in not configurable using generic 8266 as a board choice.
The flash modes and (most probably) the board type was nothing to do with deep sleep not working.
Well since i am not convinced deep sleep isn't working, i would propose the following modification of your sketch
#define led_pin 2
void setup() {
delay(1000);
Serial.begin(9600); // Start the Serial communication to send messages to the computer
delay(1000);
Serial.println();
pinMode(led_pin, OUTPUT);
Serial.println("wake up");
for (uint8_t i = 0; i < 10; i++) {
digitalWrite(led_pin, HIGH);
delay(200);
digitalWrite(led_pin, LOW);
delay(200);
}
ESP.deepSleep(6e7); /* Sleep 1 minute*/
// ESP.deepSleep(5e6); /* Sleep for 5 seconds */
}
void loop() {
}
and in this case you should see the LED flash 10 times on reset/ wakeup
Also please verify the connection between GPIO16 and RST pins using a DMM
I suspect that it is actually the USB to TTL converter that is not re-activating properly.
As stated before, when switching the serial monitor baud-rate to 74880, there should always be a boot message printed on reset/wake-up (stating external reset) and you say that this isn't happening at all.
That is normal, there is a 10K (or maybe 20K) pullup on the RST pin. (confirm either way by measuring the resistance between RST & Vcc)
what do you measure on D0 ?, that should also be 3.3v.
What i only just now notice is that RST marked on the silk is actually CH_PD, whereas EN is actually connected to Reset (on the ESP8266). Not that it matter much though, but it is a bit odd.
What you want to measure is the continuity between D0 & RST (or EN)
Which indicates that something is happening. That no boot message is printed is strange.