Browse Source
			
			
			Merge pull request #22 from mariolukas/feature/mdns
			
				feat (MDNS): added support for mdns
			
			
				master
			
			
		 
		
			
				
					
						 biologist79
					
					5 years ago
						biologist79
					
					5 years ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
				  
				  No known key found for this signature in database
				  
				  	
						GPG Key ID: 4AEE18F83AFDEB23
				  	
				  
				
			
		
		
		
	
		
			
				 2 changed files with 
12 additions and 
0 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/main.cpp
				
- 
					
					
					 
					src/settings.h
				
					
					
						
							
								
									
										
											
	
		
			
				
					|  |  | @ -4,6 +4,9 @@ | 
			
		
	
		
			
				
					|  |  |  | #include <ESP32Encoder.h>
 | 
			
		
	
		
			
				
					|  |  |  | #include "Arduino.h"
 | 
			
		
	
		
			
				
					|  |  |  | #include <WiFi.h>
 | 
			
		
	
		
			
				
					|  |  |  | #ifdef MDNS_ENABLE
 | 
			
		
	
		
			
				
					|  |  |  | #include <ESPmDNS.h>
 | 
			
		
	
		
			
				
					|  |  |  | #endif
 | 
			
		
	
		
			
				
					|  |  |  | #ifdef FTP_ENABLE
 | 
			
		
	
		
			
				
					|  |  |  |     #include "ESP32FtpServer.h"
 | 
			
		
	
		
			
				
					|  |  |  | #endif
 | 
			
		
	
	
		
			
				
					|  |  | @ -2987,6 +2990,14 @@ wl_status_t wifiManager(void) { | 
			
		
	
		
			
				
					|  |  |  |         } else { // Starts AP if WiFi-connect wasn't successful
 | 
			
		
	
		
			
				
					|  |  |  |             accessPointStart((char *) FPSTR(accessPointNetworkSSID), apIP, apNetmask); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         #ifdef MDNS_ENABLE
 | 
			
		
	
		
			
				
					|  |  |  |         // zero conf, make device available as <hostname>.local
 | 
			
		
	
		
			
				
					|  |  |  |         if (MDNS.begin(hostname.c_str())) { | 
			
		
	
		
			
				
					|  |  |  |             MDNS.addService("http", "tcp", 80); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         #endif
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         wifiNeedsRestart = false; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
										
									
								
							
						 
					 
				 
			
		
			
				
					
					
						
							
								
									
										
											
	
		
			
				
					|  |  | @ -1,6 +1,7 @@ | 
			
		
	
		
			
				
					|  |  |  | #include "Arduino.h" | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | //########################## MODULES ################################# | 
			
		
	
		
			
				
					|  |  |  | //#define MDNS_ENABLE | 
			
		
	
		
			
				
					|  |  |  | #define MQTT_ENABLE                 // Make sure to configure mqtt-server and (optionally) username+pwd | 
			
		
	
		
			
				
					|  |  |  | #define FTP_ENABLE                  // Enables FTP-server | 
			
		
	
		
			
				
					|  |  |  | #define NEOPIXEL_ENABLE             // Don't forget configuration of NUM_LEDS if enabled | 
			
		
	
	
		
			
				
					|  |  | 
 |