|  | @ -10,6 +10,12 @@ | 
			
		
	
		
		
			
				
					|  |  | #endif |  |  | #endif | 
			
		
	
		
		
			
				
					|  |  | #include "ahoywifi.h" |  |  | #include "ahoywifi.h" | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | #if defined(ESP32) | 
			
		
	
		
		
			
				
					|  |  |  |  |  | #include <ESPmDNS.h> | 
			
		
	
		
		
			
				
					|  |  |  |  |  | #else | 
			
		
	
		
		
			
				
					|  |  |  |  |  | #include <ESP8266mDNS.h> | 
			
		
	
		
		
			
				
					|  |  |  |  |  | #endif | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | // NTP CONFIG
 |  |  | // NTP CONFIG
 | 
			
		
	
		
		
			
				
					|  |  | #define NTP_PACKET_SIZE     48 |  |  | #define NTP_PACKET_SIZE     48 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | @ -83,6 +89,7 @@ void ahoywifi::tickWifiLoop() { | 
			
		
	
		
		
			
				
					|  |  |             if (mGotDisconnect) { |  |  |             if (mGotDisconnect) { | 
			
		
	
		
		
			
				
					|  |  |                 mStaConn = RESET; |  |  |                 mStaConn = RESET; | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             MDNS.update(); | 
			
		
	
		
		
			
				
					|  |  |             return; |  |  |             return; | 
			
		
	
		
		
			
				
					|  |  |         case IN_AP_MODE: |  |  |         case IN_AP_MODE: | 
			
		
	
		
		
			
				
					|  |  |             if (WiFi.softAPgetStationNum() == 0) { |  |  |             if (WiFi.softAPgetStationNum() == 0) { | 
			
		
	
	
		
		
			
				
					|  | @ -180,6 +187,15 @@ void ahoywifi::tickWifiLoop() { | 
			
		
	
		
		
			
				
					|  |  |             mAppWifiCb(true); |  |  |             mAppWifiCb(true); | 
			
		
	
		
		
			
				
					|  |  |             mGotDisconnect = false; |  |  |             mGotDisconnect = false; | 
			
		
	
		
		
			
				
					|  |  |             mStaConn = IN_STA_MODE; |  |  |             mStaConn = IN_STA_MODE; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             if (!MDNS.begin(mConfig->sys.deviceName)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 DPRINTLN(DBG_ERROR, F("Error setting up MDNS responder!")); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             } else { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 DBGPRINT(F("[WiFi] mDNS established: ")); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 DBGPRINT(mConfig->sys.deviceName); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 DBGPRINTLN(F(".local")); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |             break; |  |  |             break; | 
			
		
	
		
		
			
				
					|  |  |         case RESET: |  |  |         case RESET: | 
			
		
	
		
		
			
				
					|  |  |             mGotDisconnect = false; |  |  |             mGotDisconnect = false; | 
			
		
	
	
		
		
			
				
					|  | @ -245,7 +261,6 @@ void ahoywifi::setupStation(void) { | 
			
		
	
		
		
			
				
					|  |  |         WiFi.hostname(mConfig->sys.deviceName); |  |  |         WiFi.hostname(mConfig->sys.deviceName); | 
			
		
	
		
		
			
				
					|  |  |     WiFi.mode(WIFI_AP_STA); |  |  |     WiFi.mode(WIFI_AP_STA); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     DBGPRINT(F("connect to network '")); |  |  |     DBGPRINT(F("connect to network '")); | 
			
		
	
		
		
			
				
					|  |  |     DBGPRINT(mConfig->sys.stationSsid); |  |  |     DBGPRINT(mConfig->sys.stationSsid); | 
			
		
	
		
		
			
				
					|  |  |     DBGPRINTLN(F("' ...")); |  |  |     DBGPRINTLN(F("' ...")); | 
			
		
	
	
		
		
			
				
					|  | 
 |