mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-14 15:11:32 +10:00
redo esp32 disconnect
This commit is contained in:
+4
-4
@@ -1421,10 +1421,10 @@ bool WiFiManager::WiFi_Disconnect() {
|
||||
#elif defined(ESP31B) || defined(ESP32)
|
||||
DEBUG_WM(F("wifi station disconnect"));
|
||||
// @todo why does disconnect call these, might be needed
|
||||
// WiFi.getMode(); // wifiLowLevelInit()
|
||||
// esp_wifi_start();
|
||||
// return esp_wifi_disconnect() == ESP_OK; // @todo BUG not declared in scope
|
||||
return WiFi.disconnect();
|
||||
// WiFi.getMode(); // @todo wifiLowLevelInit(), probably not needed, for save config only
|
||||
// esp_wifi_start(); // @todo can only disconnect if enabled perhaps, prevent failure, or correct for previous call ?
|
||||
return esp_wifi_disconnect() == ESP_OK;
|
||||
// return WiFi.disconnect();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#elif defined(ESP31B) || defined(ESP32)
|
||||
#include <WiFi.h>
|
||||
#include <WebServer.h>
|
||||
#include <esp_wifi.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// ESP-01 users please note: the only pins available (0 and 2), are shared
|
||||
// with the bootloader, so always set them HIGH at power-up
|
||||
#define TRIGGER_PIN 0
|
||||
const char* modes[] = { "NULL", "STA", "AP", "STA+AP" };
|
||||
|
||||
|
||||
void setup() {
|
||||
@@ -21,6 +22,10 @@ void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println("\n Starting");
|
||||
|
||||
Serial.setDebugOutput(true);
|
||||
Serial.println(modes[WiFi.getMode()]);
|
||||
WiFi.printDiag(Serial);
|
||||
|
||||
pinMode(TRIGGER_PIN, INPUT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user