我无法让裸露的 ESP8266EX 进入深度睡眠。它总是消耗大约 8-9 mA(不是 uA)。设置最少,仅 GND、VCC 外部连接,REST 和 GPIO16 被缩短。RX 和 TX 连接到 USB 串行转换器 (CP210x),它也提供 3V3。
电流是使用万用表在 USB 转换器的 VCC 和 3V3 之间设置为 200mA 时测量的。
Arduino中使用了以下代码:
代码:
全选#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() {
}
在之前的测试中,我还启用了 WiFi 并考虑了如下命令:
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); // 也作为第二个参数 WAKE_RF_DISABLED
这里有什么问题?