From 62e2edd52aab8e24ff34fd048538bde27bb3cb79 Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Sun, 1 Aug 2021 18:53:06 +0200 Subject: [PATCH] Fix WiFi scan not Working in AP mode --- esp3d/src/core/espcmd/ESP410.cpp | 1 + esp3d/src/include/version.h | 2 +- esp3d/src/modules/mks/mks_service.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/esp3d/src/core/espcmd/ESP410.cpp b/esp3d/src/core/espcmd/ESP410.cpp index f5962a8c..d5184ff4 100644 --- a/esp3d/src/core/espcmd/ESP410.cpp +++ b/esp3d/src/core/espcmd/ESP410.cpp @@ -41,6 +41,7 @@ bool Commands::ESP410(const char* cmd_params, level_authenticate_type auth_type, #endif //AUTHENTICATION_FEATURE //Backup current mode uint8_t currentmode = WiFi.getMode(); + if(currentmode==WIFI_AP)WiFi.mode(WIFI_AP_STA); bool plain = hastag(cmd_params,"plain"); int n = 0; uint8_t total = 0; diff --git a/esp3d/src/include/version.h b/esp3d/src/include/version.h index 7b1efa04..4ee03346 100644 --- a/esp3d/src/include/version.h +++ b/esp3d/src/include/version.h @@ -22,7 +22,7 @@ #define _VERSION_ESP3D_H //version and sources location -#define FW_VERSION "3.0.0.a99" +#define FW_VERSION "3.0.0.a100" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0" #endif //_VERSION_ESP3D_H diff --git a/esp3d/src/modules/mks/mks_service.cpp b/esp3d/src/modules/mks/mks_service.cpp index 8ed0d07c..1e003c79 100644 --- a/esp3d/src/modules/mks/mks_service.cpp +++ b/esp3d/src/modules/mks/mks_service.cpp @@ -259,6 +259,7 @@ void MKSService::sendWifiHotspots() uint dataOffset = 1; uint8_t total_hotspots = 0; uint8_t currentmode = WiFi.getMode(); + if(currentmode==WIFI_AP)WiFi.mode(WIFI_AP_STA); clearFrame(); //clean memory WiFi.scanDelete();