bare ESP8266 deep sleep failing
Posted: Tue Dec 22, 2020 12:35 am
I cannot get a bare ESP8266EX into deep sleep. It always consumes about 8-9 mA (not uA). The setup is minimal, only GND, VCC are connected externally and REST and GPIO16 are shortened. RX and TX are connected to a USB-serial converter (CP210x), which also supplies 3V3.
The current is measured using a multimeter at 200mA setting between VCC and 3V3 from the USB-converter.
The following code is used in Arduino:
In previous tests, I also had WiFi enabled and considered commands like:
WiFi.config(staticIP, gateway, subnet);
WiFi.persistent( false );
WiFi.mode( WIFI_STA );
WiFi.disconnect(true);
WiFi.mode( WIFI_OFF );
wifi_set_sleep_type(MODEM_SLEEP_T); // LIGHT_SLEEP_T
WiFi.forceSleepBegin();
ESP.deepSleep(DEEP_SLEEP_TIME * 1e6); // also WAKE_RF_DISABLED as 2nd parameter
What is wrong here?
The current is measured using a multimeter at 200mA setting between VCC and 3V3 from the USB-converter.
The following code is used in Arduino:
Code: Select all
#define DEEP_SLEEP_TIME 5 // seconds
// === main ==========================================================================
void setup() {
// serial port
Serial.begin(115200);
while(!Serial); // time to get serial running
Serial.println("Powered on");
delay (2000); // around 70mA at this point
Serial.println("Going into deep sleep mode!");
delay(100);
Serial.end();
ESP.deepSleep(DEEP_SLEEP_TIME * 1e6);
delay(100);
}
void loop() {
}
In previous tests, I also had WiFi enabled and considered commands like:
WiFi.config(staticIP, gateway, subnet);
WiFi.persistent( false );
WiFi.mode( WIFI_STA );
WiFi.disconnect(true);
WiFi.mode( WIFI_OFF );
wifi_set_sleep_type(MODEM_SLEEP_T); // LIGHT_SLEEP_T
WiFi.forceSleepBegin();
ESP.deepSleep(DEEP_SLEEP_TIME * 1e6); // also WAKE_RF_DISABLED as 2nd parameter
What is wrong here?