mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
FIx esp32 updates
Webserver now builtin to esp32 lib, esp32 persistent still not implemented properly, fixes erase again, fixes save again
This commit is contained in:
@@ -16,12 +16,11 @@ First attempt at a library. Lots more changes and fixes to do. Contributions are
|
||||
|
||||
[https://github.com/esp8266/Arduino](https://github.com/esp8266/Arduino)
|
||||
|
||||
**This works with the ESP32 Arduino platform with staging , with caveats below**
|
||||
**This works with the ESP32 Arduino platform with staging**
|
||||
|
||||
[https://github.com/espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)
|
||||
|
||||
### Known Issues
|
||||
* :exclamation: ESP32 must be patched with webserver library, see [https://github.com/tzapu/WiFiManager/issues/513](https://github.com/tzapu/WiFiManager/issues/513)
|
||||
* Documentation needs to be updated, see [https://github.com/tzapu/WiFiManager/issues/500](https://github.com/tzapu/WiFiManager/issues/500)
|
||||
|
||||
## Contents
|
||||
|
||||
+9
-1
@@ -165,6 +165,7 @@ WiFiManager::~WiFiManager() {
|
||||
if (_params != NULL){
|
||||
DEBUG_WM(DEBUG_DEV,F("freeing allocated params!"));
|
||||
free(_params);
|
||||
_params = NULL;
|
||||
}
|
||||
|
||||
DEBUG_WM(DEBUG_DEV,F("unloading"));
|
||||
@@ -173,7 +174,10 @@ WiFiManager::~WiFiManager() {
|
||||
void WiFiManager::_begin(){
|
||||
if(_hasBegun) return;
|
||||
_usermode = WiFi.getMode();
|
||||
|
||||
#ifndef ESP32
|
||||
WiFi.persistent(false); // disable persistent so scannetworks and mode switching do not cause overwrites
|
||||
#endif
|
||||
}
|
||||
|
||||
void WiFiManager::_end(){
|
||||
@@ -206,6 +210,10 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef ESP32
|
||||
if(esp32persistent) WiFi.persistent(false); // disable persistent for esp32 after esp_wifi_start or else saves wont work
|
||||
#endif
|
||||
|
||||
_usermode = WIFI_STA;
|
||||
|
||||
// no getter for autoreconnectpolicy before this
|
||||
@@ -2362,7 +2370,7 @@ bool WiFiManager::WiFi_eraseConfig() {
|
||||
bool ret;
|
||||
WiFi.mode(WIFI_AP_STA); // cannot erase if not in STA mode !
|
||||
WiFi.persistent(true);
|
||||
ret = WiFi.disconnect(true);
|
||||
ret = WiFi.disconnect(true,true);
|
||||
WiFi.persistent(false);
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
+1
-2
@@ -48,12 +48,11 @@
|
||||
#define WM_WIFIOPEN WIFI_AUTH_OPEN
|
||||
|
||||
#ifndef WEBSERVER_H
|
||||
#warning "WEBSERVER not implemented in espressif/esp32, see readme notes"
|
||||
#ifdef WM_WEBSERVERSHIM
|
||||
#include <WebServer.h>
|
||||
#else
|
||||
#include <ESP8266WebServer.h>
|
||||
// Forthcoming official
|
||||
// Forthcoming official ?
|
||||
// https://github.com/esp8266/ESPWebServer
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user