| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -22,8 +22,13 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#include "espfs.h" | 
					 | 
					 | 
					 | 
					#include "espfs.h" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#include "captdns.h" | 
					 | 
					 | 
					 | 
					#include "captdns.h" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					//The example can print out the heap use every 3 seconds. You can use this to catch memory leaks.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					//#define SHOW_HEAP_USE
 | 
					 | 
					 | 
					 | 
					//#define SHOW_HEAP_USE
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					//The example can act as a captive portal, that is, if someone connects their phone to the access
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					//point, it will automatically 
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					#define CAPTIVE_PORTAL | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					//Function that tells the authentication system what users/passwords live on the system.
 | 
					 | 
					 | 
					 | 
					//Function that tells the authentication system what users/passwords live on the system.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					//This is disabled in the default build; if you want to try it, enable the authBasic line in
 | 
					 | 
					 | 
					 | 
					//This is disabled in the default build; if you want to try it, enable the authBasic line in
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					//the builtInUrls below.
 | 
					 | 
					 | 
					 | 
					//the builtInUrls below.
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -53,7 +58,9 @@ general ones. Authorization things (like authBasic) act as a 'barrier' and | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					should be placed above the URLs they protect. | 
					 | 
					 | 
					 | 
					should be placed above the URLs they protect. | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					*/ | 
					 | 
					 | 
					 | 
					*/ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HttpdBuiltInUrl builtInUrls[]={ | 
					 | 
					 | 
					 | 
					HttpdBuiltInUrl builtInUrls[]={ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					#ifdef CAPTIVE_PORTAL | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						{"*", cgiCheckHostname, "esp8266.local"}, | 
					 | 
					 | 
					 | 
						{"*", cgiCheckHostname, "esp8266.local"}, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					#endif | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						{"/", cgiRedirect, "/index.tpl"}, | 
					 | 
					 | 
					 | 
						{"/", cgiRedirect, "/index.tpl"}, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						{"/flash.bin", cgiReadFlash, NULL}, | 
					 | 
					 | 
					 | 
						{"/flash.bin", cgiReadFlash, NULL}, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						{"/led.tpl", cgiEspFsTemplate, tplLed}, | 
					 | 
					 | 
					 | 
						{"/led.tpl", cgiEspFsTemplate, tplLed}, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -91,8 +98,10 @@ static void ICACHE_FLASH_ATTR prHeapTimerCb(void *arg) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void user_init(void) { | 
					 | 
					 | 
					 | 
					void user_init(void) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						stdoutInit(); | 
					 | 
					 | 
					 | 
						stdoutInit(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						ioInit(); | 
					 | 
					 | 
					 | 
						ioInit(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						captdnsInit(); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					#ifdef CAPTIVE_PORTAL | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						captdnsInit(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					#endif | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						// 0x40200000 is the base address for spi flash memory mapping, ESPFS_POS is the position
 | 
					 | 
					 | 
					 | 
						// 0x40200000 is the base address for spi flash memory mapping, ESPFS_POS is the position
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						// where image is written in flash that is defined in Makefile.
 | 
					 | 
					 | 
					 | 
						// where image is written in flash that is defined in Makefile.
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |