Fix WiFi scan not Working in AP mode

This commit is contained in:
Luc 2021-08-01 18:53:06 +02:00
parent 862da6c225
commit 62e2edd52a
3 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,7 @@ bool Commands::ESP410(const char* cmd_params, level_authenticate_type auth_type,
#endif //AUTHENTICATION_FEATURE #endif //AUTHENTICATION_FEATURE
//Backup current mode //Backup current mode
uint8_t currentmode = WiFi.getMode(); uint8_t currentmode = WiFi.getMode();
if(currentmode==WIFI_AP)WiFi.mode(WIFI_AP_STA);
bool plain = hastag(cmd_params,"plain"); bool plain = hastag(cmd_params,"plain");
int n = 0; int n = 0;
uint8_t total = 0; uint8_t total = 0;

View File

@ -22,7 +22,7 @@
#define _VERSION_ESP3D_H #define _VERSION_ESP3D_H
//version and sources location //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" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
#endif //_VERSION_ESP3D_H #endif //_VERSION_ESP3D_H

View File

@ -259,6 +259,7 @@ void MKSService::sendWifiHotspots()
uint dataOffset = 1; uint dataOffset = 1;
uint8_t total_hotspots = 0; uint8_t total_hotspots = 0;
uint8_t currentmode = WiFi.getMode(); uint8_t currentmode = WiFi.getMode();
if(currentmode==WIFI_AP)WiFi.mode(WIFI_AP_STA);
clearFrame(); clearFrame();
//clean memory //clean memory
WiFi.scanDelete(); WiFi.scanDelete();