Browse Source

Version 6.2.3; Patch WIFIMANAGER

platenspeler 5 years ago
parent
commit
69bdbebd2c
3 changed files with 17 additions and 17 deletions
  1. 13 15
      src/ESP-sc-gway.ino
  2. 3 1
      src/_WiFi.ino
  3. 1 1
      src/_wwwServer.ino

+ 13 - 15
src/ESP-sc-gway.ino

@@ -77,6 +77,9 @@ extern "C" {
 #	include <WiFi.h>										// MMM added 20Feb
 #	include <ESPmDNS.h>
 #	include <SPIFFS.h>
+#	include <WiFiManager.h>								// Standard lib for ESP WiFi config through an AP
+
+#	define ESP_getChipId()   ((uint32_t)ESP.getEfuseMac())
 
 #	if A_SERVER==1
 #		include <WebServer.h>								// Standard Webserver for ESP32
@@ -89,10 +92,6 @@ extern "C" {
 #		include <ArduinoOTA.h>
 #	endif //A_OTA
 
-#	if _WIFIMANAGER==1
-#		define ESP_getChipId()   ((uint32_t)ESP.getEfuseMac())
-#		include <WiFiManager.h>								// Standard lib for ESP WiFi config through an AP
-#	endif //_WIFIMANAGER
 
 // ----------- Specific ESP8266 stuff --------------
 #elif defined(ARDUINO_ARCH_ESP8266)
@@ -102,6 +101,9 @@ extern "C" {
 	}
 #	include <ESP8266WiFi.h>									// Which is specific for ESP8266
 #	include <ESP8266mDNS.h>
+#	include <WiFiManager.h>									// Library for ESP WiFi config through an AP
+
+#	define ESP_getChipId()   (ESP.getChipId())
 
 #	if A_SERVER==1
 #		include <ESP8266WebServer.h>
@@ -113,11 +115,7 @@ extern "C" {
 #		include <ESP8266httpUpdate.h>
 #		include <ArduinoOTA.h>
 #	endif //A_OTA
-
-#	if _WIFIMANAGER==1						
-#		include <WiFiManager.h>								// Library for ESP WiFi config through an AP
-#		define ESP_getChipId()   (ESP.getChipId())
-#	endif //_WIFIMANAGER
+					
 
 #else
 #	error "Architecture not supported"
@@ -360,13 +358,13 @@ void setup() {
 	yield();
 
 #	if _WIFIMANAGER==1
-	msg_oLED("WIFIMGR");
-#	if MONITOR>=1
-		mPrint("setup:: WiFiManager");
-#	endif
-	delay(500);
+		msg_oLED("WIFIMGR");
+#		if MONITOR>=1
+			mPrint("setup:: WiFiManager");
+#		endif //_MONITOR
+		delay(500);
 	
-	wifiMgr();
+		wifiMgr();
 #	endif //_WIFIMANAGER
 
 	msg_oLED("WIFI STA");

+ 3 - 1
src/_WiFi.ino

@@ -186,14 +186,16 @@ int wifiMgr()
 // Callback Function for MiFiManager
 // ----------------------------------------------------------------------------
 //gets called when WiFiManager enters configuration mode
-#if _WIFIMANAGER==1
 
+#if _WIFIMANAGER==1
 void configModeCallback (WiFiManager *myWiFiManager) 
 {
+
   Serial.println("Entered config mode");
   Serial.println(WiFi.softAPIP());
   //if you used auto generated SSID, print it
   Serial.println(myWiFiManager->getConfigPortalSSID());
+
 }
 #endif //_WIFIMANAGER
 

+ 1 - 1
src/_wwwServer.ino

@@ -354,7 +354,7 @@ static void setVariables(const char *cmd, const char *arg) {
 			ESP.restart();
 			delay(1000);
 		}
-#		endif
+#		endif //_MONITOR
 		
 		//WiFi.disconnect();