From 70919d0dbd9120cb3a698370bd9204e9c9bc68e9 Mon Sep 17 00:00:00 2001 From: luc Date: Thu, 14 May 2015 15:07:14 +0800 Subject: [PATCH] Missing Sleep mode setting at start Missing Sleep mode setting at start --- esp8266/wifi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esp8266/wifi.cpp b/esp8266/wifi.cpp index 7fc83d70..6b8bc34f 100644 --- a/esp8266/wifi.cpp +++ b/esp8266/wifi.cpp @@ -76,7 +76,9 @@ bool WIFI_CONFIG::Setup() int wstatus; IPAddress currentIP; byte bflag=0; - + //set the sleep mode + if (!CONFIG::read_byte(EP_SLEEP_MODE, &bflag ))return false; + wifi_set_sleep_type ((sleep_type)bflag); //AP or client ? if (!CONFIG::read_byte(EP_WIFI_MODE, &bflag ) || !CONFIG::read_string(EP_SSID, sbuf , MAX_SSID_LENGH) ||!CONFIG::read_string(EP_PASSWORD, pwd , MAX_PASSWORD_LENGH)) return false; //disconnect if connected