From 7d1a6eb00c2410bcc6facad6d0166f3927130748 Mon Sep 17 00:00:00 2001 From: Peter Hoddie Date: Thu, 16 Mar 2023 10:58:12 -0700 Subject: [PATCH] disable esp8266 modem sleep - resolves analog noise and should give smooth network performance phoddie/node-red-mcu#101 --- modules/network/wifi/esp/modwifi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/network/wifi/esp/modwifi.c b/modules/network/wifi/esp/modwifi.c index 897e91eeaf..6b05a67eed 100644 --- a/modules/network/wifi/esp/modwifi.c +++ b/modules/network/wifi/esp/modwifi.c @@ -152,6 +152,8 @@ void xs_wifi_connect(xsMachine *the) wifi_station_set_config_current(&config); + wifi_set_sleep_type(NONE_SLEEP_T); + if (channel >= 0) wifi_set_channel(channel); @@ -463,6 +465,8 @@ void xs_wifi_accessPoint(xsMachine *the) if (!ret) xsUnknownError("wifi_set_opmode_current failed"); + wifi_set_sleep_type(NONE_SLEEP_T); + ETS_UART_INTR_DISABLE(); ret = wifi_softap_set_config_current(&config); ETS_UART_INTR_ENABLE();