我无法在 NodeMCU v3 ESP8266 上进行轻度睡眠,因为该函数wifi_fpm_do_sleep()
返回 -1。你能帮我找出错误的原因吗?
void light_sleep() {
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
gpio_pin_wakeup_enable(GPIO_ID_PIN(gpio_read), GPIO_PIN_INTR_HILEVEL);
wifi_fpm_open();
WiFi.disconnect();
WiFi.mode(WIFI_OFF);
Serial.print("WiFi Sleep\t");
WiFi.forceSleepBegin();
int err = wifi_fpm_do_sleep(0xFFFFFFF);
Serial.print("ERROR: ");
Serial.println(err);
}
谢谢你。