mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 13:46:36 +00:00
Always disable SleepMode
This commit is contained in:
parent
d8109a9309
commit
fc0ecc74f2
@ -398,8 +398,9 @@ static void wifiReconnect(void)
|
|||||||
{
|
{
|
||||||
#if defined(ARDUINO_ARCH_ESP8266)
|
#if defined(ARDUINO_ARCH_ESP8266)
|
||||||
WiFi.disconnect();
|
WiFi.disconnect();
|
||||||
WiFi.begin(wifiSsid, wifiPassword);
|
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
|
WiFi.setSleepMode(WIFI_NONE_SLEEP);
|
||||||
|
WiFi.begin(wifiSsid, wifiPassword);
|
||||||
WiFi.hostname(haspDevice.get_hostname());
|
WiFi.hostname(haspDevice.get_hostname());
|
||||||
|
|
||||||
#elif defined(ARDUINO_ARCH_ESP32)
|
#elif defined(ARDUINO_ARCH_ESP32)
|
||||||
@ -407,6 +408,7 @@ static void wifiReconnect(void)
|
|||||||
WiFi.disconnect();
|
WiFi.disconnect();
|
||||||
WiFi.setHostname(haspDevice.get_hostname());
|
WiFi.setHostname(haspDevice.get_hostname());
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
|
WiFi.setSleep(false);
|
||||||
WiFi.begin(wifiSsid, wifiPassword, WIFI_ALL_CHANNEL_SCAN);
|
WiFi.begin(wifiSsid, wifiPassword, WIFI_ALL_CHANNEL_SCAN);
|
||||||
// WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE); // causes 255.255.255.255 IP errors
|
// WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE); // causes 255.255.255.255 IP errors
|
||||||
#endif
|
#endif
|
||||||
@ -458,10 +460,8 @@ void wifiSetup()
|
|||||||
// wifiEventHandler[0] = WiFi.onStationModeConnected(wifiSTAConnected);
|
// wifiEventHandler[0] = WiFi.onStationModeConnected(wifiSTAConnected);
|
||||||
gotIpEventHandler = WiFi.onStationModeGotIP(wifiSTAGotIP); // As soon WiFi is connected, start NTP Client
|
gotIpEventHandler = WiFi.onStationModeGotIP(wifiSTAGotIP); // As soon WiFi is connected, start NTP Client
|
||||||
disconnectedEventHandler = WiFi.onStationModeDisconnected(wifiSTADisconnected);
|
disconnectedEventHandler = WiFi.onStationModeDisconnected(wifiSTADisconnected);
|
||||||
WiFi.setSleepMode(WIFI_NONE_SLEEP);
|
|
||||||
#elif defined(ARDUINO_ARCH_ESP32)
|
#elif defined(ARDUINO_ARCH_ESP32)
|
||||||
WiFi.onEvent(wifi_callback);
|
WiFi.onEvent(wifi_callback);
|
||||||
WiFi.setSleep(false);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wifiReconnect();
|
wifiReconnect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user