From 52060548862b95f5a919e9119077f82ac7d7ded1 Mon Sep 17 00:00:00 2001 From: Adrian Scillato <35405447+ascillato@users.noreply.github.com> Date: Fri, 4 Jun 2021 09:57:25 -0300 Subject: [PATCH] Add new options to WIFI command Actual Options: 0 - Turn Off Wi-Fi 1 - Turn On Wi-Fi New Options Added: 2 - Force the device to ONLY connects as a 11b device 3 - Force the device to ONLY connects as a 11b/g device 4 - Force the device to connects as a 11b/g/n device --- tasmota/support_command.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 7a7a00340..e8bca9f73 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -2142,8 +2142,12 @@ void CmndWifi(void) if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { Settings.flag4.network_wifi = XdrvMailbox.payload; if (Settings.flag4.network_wifi) { WifiEnable(); } +#ifdef ESP8266 + } else if ((XdrvMailbox.payload >= 2) && (XdrvMailbox.payload <= 4)) { + WiFi.setPhyMode(WiFiPhyMode_t(XdrvMailbox.payload - 1)); // 1-B/2-BG/3-BGN +#endif } - ResponseCmndStateText(Settings.flag4.network_wifi); + Response_P(PSTR("{\"" D_JSON_WIFI "\":\"%s\",\"" D_JSON_WIFI_MODE "\":\"11%c\"}"), GetStateText(Settings.flag4.network_wifi), pgm_read_byte(&kWifiPhyMode[WiFi.getPhyMode() & 0x3]) ); } #ifdef USE_I2C