Browse Source

Remove old web_config parts

quick remove of all code relative to old web config part, remove thumbs
and comment code in still usefull code files
Etienne Landon 9 years ago
parent
commit
067a596249
11 changed files with 6 additions and 887 deletions
  1. 2 2
      ESP_UKI.ino
  2. 4 2
      includes.h
  3. 0 206
      web.h
  4. 0 34
      web_Admin.h
  5. 0 120
      web_General.h
  6. 0 74
      web_Information.h
  7. 0 112
      web_NTPSettings.h
  8. 0 206
      web_NetworkConfiguration.h
  9. 0 32
      web_Root.h
  10. 0 31
      web_Script.js.h
  11. 0 68
      web_Style.css.h

+ 2 - 2
ESP_UKI.ino

@@ -22,7 +22,7 @@ void setup ( void ) {
   Serial.println("Starting ES8266");
   setupLeds();
   setupWifi();
-  setupWebserver();
+  //setupWebserver();
   setupOTA();
   
   delay(200);
@@ -43,7 +43,7 @@ void setup ( void ) {
 
 void loop ( void ) {
   loop_counter += 1;
-  loopWebserver();
+  //loopWebserver();
   
   loopOTA();
 

+ 4 - 2
includes.h

@@ -4,12 +4,14 @@
 #include <ESP8266WiFi.h>
 #include <WiFiClient.h>
 #include <ESP8266WebServer.h>
+
 #include <Ticker.h>
 #include <EEPROM.h>
 #include <WiFiUdp.h>
+
 //OTA includes
 #include <ESP8266mDNS.h>
-#include <WiFiUdp.h>
+//#include <WiFiUdp.h>
 #include <ArduinoOTA.h>
 
 
@@ -23,7 +25,7 @@ WiFiUDP UKI_UDP;
 #include "leds.h"     //config and functions relative to leds
 #include "eeprom.h"   //config and functions relative to config permanent storage
 #include "global.h"   //config and functions relative to wifi and access point configuration
-#include "web.h"      //config and functions relative to configuration web server
+//#include "web.h"      //config and functions relative to configuration web server
 #include "ota.h"      //config and functions relative to ota firmware updates
 
 

+ 0 - 206
web.h

@@ -1,206 +0,0 @@
-               // The Webserver
-
-/* NTP things */
-boolean firstStart = true;                    // On firststart = true, NTP will try to get a valid time   
-strDateTime DateTime;                     // Global DateTime structure, will be refreshed every Second
-WiFiUDP UDPNTPClient;                     // NTP Client
-unsigned long UnixTimestamp = 0;                // GLOBALTIME  ( Will be set by NTP)
-boolean Refresh = false; // For Main Loop, to refresh things like GPIO / WS2812
-int cNTP_Update = 0;                      // Counter for Updating the time via NTP
-Ticker tkSecond;                        // Second - Timer for Updating Datetime Structure
-byte Minute_Old = 100;        // Helpvariable for checking, when a new Minute comes up (for Auto Turn On / Off)
-
-
-
-/*
-  Include the HTML, STYLE and Script "Pages"
-*/
-
-#include "web_Root.h"
-#include "web_Admin.h"
-#include "web_Script.js.h"
-#include "web_Style.css.h"
-#include "web_NTPSettings.h"
-#include "web_Information.h"
-#include "web_General.h"
-#include "web_NetworkConfiguration.h"
-
-
-
-/*
-**
-**  NTP 
-**
-*/
-
-const int NTP_PACKET_SIZE = 48; 
-byte packetBuffer[ NTP_PACKET_SIZE]; 
-void NTPRefresh()
-{
-
-  
-
-
-  if (WiFi.status() == WL_CONNECTED)
-  {
-    IPAddress timeServerIP; 
-    WiFi.hostByName(config.ntpServerName.c_str(), timeServerIP); 
-    //sendNTPpacket(timeServerIP); // send an NTP packet to a time server
-
-
-    Serial.println("sending NTP packet...");
-    memset(packetBuffer, 0, NTP_PACKET_SIZE);
-    packetBuffer[0] = 0b11100011;   // LI, Version, Mode
-    packetBuffer[1] = 0;     // Stratum, or type of clock
-    packetBuffer[2] = 6;     // Polling Interval
-    packetBuffer[3] = 0xEC;  // Peer Clock Precision
-    packetBuffer[12]  = 49;
-    packetBuffer[13]  = 0x4E;
-    packetBuffer[14]  = 49;
-    packetBuffer[15]  = 52;
-    UDPNTPClient.beginPacket(timeServerIP, 123); 
-    UDPNTPClient.write(packetBuffer, NTP_PACKET_SIZE);
-    UDPNTPClient.endPacket();
-
-
-    delay(1000);
-  
-    int cb = UDPNTPClient.parsePacket();
-    if (!cb) {
-      Serial.println("NTP no packet yet");
-    }
-    else 
-    {
-      Serial.print("NTP packet received, length=");
-      Serial.println(cb);
-      UDPNTPClient.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer
-      unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
-      unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
-      unsigned long secsSince1900 = highWord << 16 | lowWord;
-      const unsigned long seventyYears = 2208988800UL;
-      unsigned long epoch = secsSince1900 - seventyYears;
-      UnixTimestamp = epoch;
-    }
-  }
-}
-
-void Second_Tick()
-{
-  strDateTime tempDateTime;
-  AdminTimeOutCounter++;
-  cNTP_Update++;
-  UnixTimestamp++;
-  ConvertUnixTimeStamp(UnixTimestamp +  (config.timezone *  360) , &tempDateTime);
-  if (config.daylight) // Sommerzeit beachten
-    if (summertime(tempDateTime.year,tempDateTime.month,tempDateTime.day,tempDateTime.hour,0))
-    {
-      ConvertUnixTimeStamp(UnixTimestamp +  (config.timezone *  360) + 3600, &DateTime);
-    }
-    else
-    {
-      DateTime = tempDateTime;
-    }
-  else
-  {
-      DateTime = tempDateTime;
-  }
-  Refresh = true;
-}
-
-
-
-
-
-void setupWebserver(){
-  server.on ( "/", []() {server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(web_AdminMainPage) ); } );
-  server.on ( "/admin.html", []() {Serial.println("admin.html"); server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(web_AdminMainPage) ); }  );
-  server.on ( "/config.html", send_network_configuration_html );
-  server.on ( "/info.html", []() { Serial.println("info.html"); server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(web_Information) ); }  );
-  server.on ( "/ntp.html", send_NTP_configuration_html  );
-  server.on ( "/general.html",  send_general_html );
-  server.on ( "/style.css", []() { Serial.println("style.css"); server.send ( 200, "text/plain", reinterpret_cast<const __FlashStringHelper *>(web_Style_css ));} );
-  server.on ( "/microajax.js", []() { Serial.println("microajax.js"); server.send ( 200, "text/plain", reinterpret_cast<const __FlashStringHelper *>(web_microajax_js )); } );
-  server.on ( "/admin/values", send_network_configuration_values_html );
-  server.on ( "/admin/connectionstate", send_connection_state_values_html );
-  server.on ( "/admin/infovalues", send_information_values_html );
-  server.on ( "/admin/ntpvalues", send_NTP_configuration_values_html );
-  server.on ( "/admin/generalvalues", send_general_configuration_values_html);
-  //server.on ( "/admin/devicename", [] () {Serial.println("devicename");    send_devicename_value_html;});
-  server.on ( "/admin/devicename",     send_devicename_value_html);
-  /* old led management
-  server.on ( "/", []() {digitalWrite(Blue_Led, LOW); Serial.println("admin.html"); server.send ( 200, "text/html", web_AdminMainPage ); digitalWrite(Blue_Led, HIGH);  }  );
-  server.on ( "/admin.html", []() {digitalWrite(Blue_Led, LOW); Serial.println("admin.html"); server.send ( 200, "text/html", web_AdminMainPage ); digitalWrite(Blue_Led, HIGH);  }  );
-  server.on ( "/config.html", send_network_configuration_html );
-  server.on ( "/info.html", []() { digitalWrite(Blue_Led, LOW) ; Serial.println("info.html"); server.send ( 200, "text/html", web_Information ); digitalWrite(Blue_Led, HIGH) ; }  );
-  server.on ( "/ntp.html", send_NTP_configuration_html  );
-  server.on ( "/general.html",  send_general_html );
-  server.on ( "/style.css", []() { digitalWrite(Blue_Led, LOW) ; Serial.println("style.css"); server.send ( 200, "text/plain", web_Style_css ); digitalWrite(Blue_Led, HIGH) ; } );
-  server.on ( "/microajax.js", []() { digitalWrite(Blue_Led, LOW) ; Serial.println("microajax.js"); server.send ( 200, "text/plain", web_microajax_js ); digitalWrite(Blue_Led, HIGH); } );
-  server.on ( "/admin/values", send_network_configuration_values_html );
-  server.on ( "/admin/connectionstate", send_connection_state_values_html );
-  server.on ( "/admin/infovalues", send_information_values_html );
-  server.on ( "/admin/ntpvalues", send_NTP_configuration_values_html );
-  server.on ( "/admin/generalvalues", send_general_configuration_values_html);
-  server.on ( "/admin/devicename",     send_devicename_value_html);
-  */
-
-  server.onNotFound ( []() {
-    Serial.println("Page Not Found");
-    server.send ( 400, "text/html", "Page not Found" );
-  }  );
-  server.begin();
-  Serial.println( "HTTP server started" );
-  tkSecond.attach(1, Second_Tick);
-  UDPNTPClient.begin(2390);  // Port for NTP receive
-}
-
-
-
-void loopWebserver(){
-//  if (AdminEnabled)  {
-//    if (AdminTimeOutCounter > AdminTimeOut)   {
-//      AdminEnabled = false;
-//      Serial.println("Admin Mode disabled!");
-//      WiFi.mode(WIFI_STA);
-//    }
-//  }
-  server.handleClient();
-//  if (loop_counter == 10)  {
-//    loop_counter = 0;
-//    server.handleClient();
-//    Red_Led_State = !Red_Led_State;
-//    digitalWrite(Red_Led, Red_Led_State);
-//    delay(10);
-//    }
-//    
-  if (config.Update_Time_Via_NTP_Every  > 0 )  {
-    if (cNTP_Update > 5 && firstStart)    {
-      NTPRefresh();
-      cNTP_Update = 0;
-      firstStart = false;
-    }
-    else if ( cNTP_Update > (config.Update_Time_Via_NTP_Every * 60) )    {
-      NTPRefresh();
-      cNTP_Update = 0;
-    }
-  }
-
-  if (DateTime.minute != Minute_Old)  {
-    Minute_Old = DateTime.minute;
-    if (config.AutoTurnOn)
-      if (DateTime.hour == config.TurnOnHour && DateTime.minute == config.TurnOnMinute)      {
-        Serial.println("SwitchON");
-      }
-    }
-
-    Minute_Old = DateTime.minute;
-    if (config.AutoTurnOff)    {
-      if (DateTime.hour == config.TurnOffHour && DateTime.minute == config.TurnOffMinute)      {
-        Serial.println("SwitchOff");
-      }
-    }
-  }
-
-
- 
-

+ 0 - 34
web_Admin.h

@@ -1,34 +0,0 @@
-
-
-//
-//  HTML PAGE
-//
-
-const char web_AdminMainPage[] PROGMEM = R"=====(
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<strong>Administration</strong>
-<hr>
-<a href="general.html" style="width:250px" class="btn btn--m btn--blue" >General Configuration</a><br>
-<a href="config.html" style="width:250px" class="btn btn--m btn--blue" >Network Configuration</a><br>
-<a href="info.html"   style="width:250px"  class="btn btn--m btn--blue" >Network Information</a><br>
-<a href="ntp.html"   style="width:250px"  class="btn btn--m btn--blue" >NTP Settings</a><br>
-
-
-<script>
-window.onload = function ()
-{
-	load("style.css","css", function() 
-	{
-		load("microajax.js","js", function() 
-		{
-				// Do something after load...
-		});
-	});
-}
-function load(e,t,n){if("js"==t){var a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}else if("css"==t){var a=document.createElement("link");a.href=e,a.rel="stylesheet",a.type="text/css",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}}
-
-</script>
-
-)=====";
-
-

+ 0 - 120
web_General.h

@@ -1,120 +0,0 @@
-//
-//  HTML PAGE
-//
-
-const char web_AdminGeneralSettings[] PROGMEM =  R"=====(
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<a href="admin.html"  class="btn btn--s"><</a>&nbsp;&nbsp;<strong>General Settings</strong>
-<hr>
-<form action="" method="post">
-<table border="0"  cellspacing="0" cellpadding="3" >
-<tr>
-	<td align="right">Name of Device</td>
-	<td><input type="text" id="devicename" name="devicename" value=""></td>
-</tr>
-
-<tr>
-	<td align="left" colspan="2"><hr></td>
-</tr>
-
-<tr>
-	<td align="left" colspan="2">Turn on at</td>
-</tr>
-<tr>
-	<td align="right"> Enabled:</td>
-	<td><input type="checkbox" id="tonenabled" name="tonenabled"></td>
-</tr>
-
-<tr>
-	<td align="right"> Time:</td>
-	<td><input type="text" id="tonhour" name="tonhour" size="2" value="00">:<input type="text" id="tonminute" name="tonminute" size="2" value="00"></td>
-</tr>
-
-<tr>
-	<td align="left" colspan="2">Turn off at:</td>
-<tr>
-	<td align="right"> Enabled:</td>
-	<td><input type="checkbox" id="toffenabled" name="toffenabled"></td>
-</tr>
-<tr>
-	<td align="right"> Time:</td>
-	<td><input type="text" id="toffhour" name="toffhour" size="2" value="00">:<input type="text" id="toffminute" name="toffminute" size="2" value="00"></td>
-</tr>
-<tr><td colspan="2" align="center"><input type="submit" style="width:150px" class="btn btn--m btn--blue" value="Save"></td></tr>
-</table>
-</form>
-<script>
-
- 
-
-window.onload = function ()
-{
-	load("style.css","css", function() 
-	{
-		load("microajax.js","js", function() 
-		{
-				setValues("/admin/generalvalues");
-		});
-	});
-}
-function load(e,t,n){if("js"==t){var a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}else if("css"==t){var a=document.createElement("link");a.href=e,a.rel="stylesheet",a.type="text/css",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}}
-
-
-
-</script>
-)=====";
-
-
-// Functions for this Page
-void send_devicename_value_html()
-{
-//	digitalWrite(Blue_Led, LOW);
-	String values ="";
-	values += "devicename|" + (String) config.DeviceName + "|div\n";
-	server.send ( 200, "text/plain", values);
-	Serial.println(__FUNCTION__); 
-//	digitalWrite(Blue_Led, HIGH);
-}
-
-void send_general_html()
-{
-//	digitalWrite(Blue_Led, LOW);
-	if (server.args() > 0 )  // Save Settings
-	{
-		config.AutoTurnOn = false;
-		config.AutoTurnOff = false;
-		String temp = "";
-		for ( uint8_t i = 0; i < server.args(); i++ ) {
-			if (server.argName(i) == "devicename") config.DeviceName = urldecode(server.arg(i)); 
-			if (server.argName(i) == "tonenabled") config.AutoTurnOn = true; 
-			if (server.argName(i) == "toffenabled") config.AutoTurnOff = true; 
-			if (server.argName(i) == "tonhour") config.TurnOnHour =  server.arg(i).toInt(); 
-			if (server.argName(i) == "tonminute") config.TurnOnMinute =  server.arg(i).toInt(); 
-			if (server.argName(i) == "toffhour") config.TurnOffHour =  server.arg(i).toInt(); 
-			if (server.argName(i) == "toffminute") config.TurnOffMinute =  server.arg(i).toInt(); 
-		}
-		WriteConfig();
-		firstStart = true;
-	}
-	server.send ( 200, "text/html", web_AdminGeneralSettings ); 
-	Serial.println(__FUNCTION__); 
-	
-//	digitalWrite(Blue_Led, HIGH);
-}
-
-void send_general_configuration_values_html()
-{
-//  digitalWrite(Blue_Led, LOW);
-	String values ="";
-	values += "devicename|" +  (String)  config.DeviceName +  "|input\n";
-	values += "tonhour|" +  (String)  config.TurnOnHour +  "|input\n";
-	values += "tonminute|" +   (String) config.TurnOnMinute +  "|input\n";
-	values += "toffhour|" +  (String)  config.TurnOffHour +  "|input\n";
-	values += "toffminute|" +   (String)  config.TurnOffMinute +  "|input\n";
-	values += "toffenabled|" +  (String) (config.AutoTurnOff ? "checked" : "") + "|chk\n";
-	values += "tonenabled|" +  (String) (config.AutoTurnOn ? "checked" : "") + "|chk\n";
-	server.send ( 200, "text/plain", values);
-	Serial.println(__FUNCTION__); 
-//  digitalWrite(Blue_Led, HIGH);
-}

+ 0 - 74
web_Information.h

@@ -1,74 +0,0 @@
-#ifndef web_INFOMATION_H
-#define web_INFOMATION_H
-
-
-//
-//   The HTML PAGE
-//
-const char web_Information[] PROGMEM = R"=====(
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" href="style.css" type="text/css" />
-<script src="microajax.js"></script> 
-<a href="admin.html"  class="btn btn--s"><</a>&nbsp;&nbsp;<strong>Network Information</strong>
-<hr>
-<table border="0"  cellspacing="0" cellpadding="3" style="width:310px" >
-<tr><td align="right">SSID :</td><td><span id="x_ssid"></span></td></tr>
-<tr><td align="right">IP :</td><td><span id="x_ip"></span></td></tr>
-<tr><td align="right">Netmask :</td><td><span id="x_netmask"></span></td></tr>
-<tr><td align="right">Gateway :</td><td><span id="x_gateway"></span></td></tr>
-<tr><td align="right">Mac :</td><td><span id="x_mac"></span></td></tr>
-
-<tr><td colspan="2"><hr></span></td></tr>
-<tr><td align="right">NTP Time:</td><td><span id="x_ntp"></span></td></tr>
-
-
-<tr><td colspan="2" align="center"><a href="javascript:GetState()" class="btn btn--m btn--blue">Refresh</a></td></tr>
-</table>
-<script>
-
-function GetState()
-{
-	setValues("/admin/infovalues");
-}
-
-window.onload = function ()
-{
-	load("style.css","css", function() 
-	{
-		load("microajax.js","js", function() 
-		{
-				GetState();
-		});
-	});
-}
-function load(e,t,n){if("js"==t){var a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}else if("css"==t){var a=document.createElement("link");a.href=e,a.rel="stylesheet",a.type="text/css",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}}
-
-
-
-</script>
-)=====" ;
-
-
-//
-// FILL WITH INFOMATION
-// 
-
-void send_information_values_html ()
-{
-//  digitalWrite(Blue_Led, LOW);
-	String values ="";
-
-	values += "x_ssid|" + (String)WiFi.SSID() +  "|div\n";
-	values += "x_ip|" +  (String) WiFi.localIP()[0] + "." +  (String) WiFi.localIP()[1] + "." +  (String) WiFi.localIP()[2] + "." + (String) WiFi.localIP()[3] +  "|div\n";
-	values += "x_gateway|" +  (String) WiFi.gatewayIP()[0] + "." +  (String) WiFi.gatewayIP()[1] + "." +  (String) WiFi.gatewayIP()[2] + "." + (String) WiFi.gatewayIP()[3] +  "|div\n";
-	values += "x_netmask|" +  (String) WiFi.subnetMask()[0] + "." +  (String) WiFi.subnetMask()[1] + "." +  (String) WiFi.subnetMask()[2] + "." + (String) WiFi.subnetMask()[3] +  "|div\n";
-	values += "x_mac|" + GetMacAddress() +  "|div\n";
-	values += "x_ntp|" +  (String) DateTime.hour + ":" + (String) + DateTime.minute +  ":"  + (String)  DateTime.second + " " + (String)   DateTime.year + "-" + (String)  DateTime.month + "-" + (String)  DateTime.day +  "|div\n";
-	server.send ( 200, "text/plain", values);
-	Serial.println(__FUNCTION__); 
-//  digitalWrite(Blue_Led, HIGH);
-}
-
-
-#endif

+ 0 - 112
web_NTPSettings.h

@@ -1,112 +0,0 @@
-
-const char web_NTPConfiguration[] PROGMEM = R"=====(
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<a href="admin.html"  class="btn btn--s"><</a>&nbsp;&nbsp;<strong>NTP Settings</strong>
-<hr>
-<form action="" method="get">
-<table border="0"  cellspacing="0" cellpadding="3" >
-<tr><td align="right">NTP Server:</td><td><input type="text" id="ntpserver" name="ntpserver" maxlength="172" value=""></td></tr>
-<tr><td align="right">Update:</td><td><input type="text" id="update" name="update" size="3"maxlength="6" value=""> minutes (0=disable)</td></tr>
-<tr><td>Timezone</td><td>
-<select  id="tz" name="tz">
-	<option value="-120">(GMT-12:00)</option>
-	<option value="-110">(GMT-11:00)</option>
-	<option value="-100">(GMT-10:00)</option>
-	<option value="-90">(GMT-09:00)</option>
-	<option value="-80">(GMT-08:00)</option>
-	<option value="-70">(GMT-07:00)</option>
-	<option value="-60">(GMT-06:00)</option>
-	<option value="-50">(GMT-05:00)</option>
-	<option value="-40">(GMT-04:00)</option>
-	<option value="-35">(GMT-03:30)</option>
-	<option value="-30">(GMT-03:00)</option>
-	<option value="-20">(GMT-02:00)</option>
-	<option value="-10">(GMT-01:00)</option>
-	<option value="0">(GMT+00:00)</option>
-	<option value="10">(GMT+01:00)</option>
-	<option value="20">(GMT+02:00)</option>
-	<option value="30">(GMT+03:00)</option>
-	<option value="35">(GMT+03:30)</option>
-	<option value="40">(GMT+04:00)</option>
-	<option value="45">(GMT+04:30)</option>
-	<option value="50">(GMT+05:00)</option>
-	<option value="55">(GMT+05:30)</option>
-	<option value="57">(GMT+05:45)</option>
-	<option value="60">(GMT+06:00)</option>
-	<option value="65">(GMT+06:30)</option>
-	<option value="70">(GMT+07:00)</option>
-	<option value="80">(GMT+08:00)</option>
-	<option value="90">(GMT+09:00)</option>
-	<option value="95">(GMT+09:30)</option>
-	<option value="100">(GMT+10:00)</option>
-	<option value="110">(GMT+11:00)</option>
-	<option value="120">(GMT+12:00)</option>
-	<option value="120">(GMT+12:00)</option>
-	<option value="130">(GMT+13:00)</option>
-</select>
-</td></tr>
-<tr><td align="right">Daylight saving:</td><td><input type="checkbox" id="dst" name="dst"></td></tr>
-<tr><td colspan="2" align="center"><input type="submit" style="width:150px" class="btn btn--m btn--blue" value="Save"></td></tr>
-</table>
-</form>
-<script>
-	
-
-window.onload = function ()
-{
-	load("style.css","css", function() 
-	{
-		load("microajax.js","js", function() 
-		{
-				setValues("/admin/ntpvalues");
-		});
-	});
-}
-function load(e,t,n){if("js"==t){var a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}else if("css"==t){var a=document.createElement("link");a.href=e,a.rel="stylesheet",a.type="text/css",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}}
-
-
-
-</script>
-)=====";
-
-
-void send_NTP_configuration_html()
-{
-	
-//	digitalWrite(Blue_Led, LOW);
-	if (server.args() > 0 )  // Save Settings
-	{
-		config.daylight = false;
-		String temp = "";
-		for ( uint8_t i = 0; i < server.args(); i++ ) {
-			if (server.argName(i) == "ntpserver") config.ntpServerName = urldecode( server.arg(i)); 
-			if (server.argName(i) == "update") config.Update_Time_Via_NTP_Every =  server.arg(i).toInt(); 
-			if (server.argName(i) == "tz") config.timezone =  server.arg(i).toInt(); 
-			if (server.argName(i) == "dst") config.daylight = true; 
-		}
-		WriteConfig();
-		firstStart = true;
-	}
-	server.send ( 200, "text/html", web_NTPConfiguration ); 
-	Serial.println(__FUNCTION__); 
-//	digitalWrite(Blue_Led, HIGH);
-}
-
-
-
-
-
-
-void send_NTP_configuration_values_html()
-{
-		
-	String values ="";
-	values += "ntpserver|" + (String) config.ntpServerName + "|input\n";
-	values += "update|" +  (String) config.Update_Time_Via_NTP_Every + "|input\n";
-	values += "tz|" +  (String) config.timezone + "|input\n";
-	values += "dst|" +  (String) (config.daylight ? "checked" : "") + "|chk\n";
-	server.send ( 200, "text/plain", values);
-	Serial.println(__FUNCTION__); 
-	
-}

+ 0 - 206
web_NetworkConfiguration.h

@@ -1,206 +0,0 @@
-
-
-//
-//  HTML PAGE
-//
-const char web_NetworkConfiguration[] PROGMEM = R"=====(
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<a href="admin.html"  class="btn btn--s"><</a>&nbsp;&nbsp;<strong>Network Configuration</strong>
-<hr>
-Connect to Router with these settings:<br>
-<form action="" method="get">
-<table border="0"  cellspacing="0" cellpadding="3" style="width:310px" >
-<tr><td align="right">SSID:</td><td><input type="text" id="ssid" name="ssid" value=""></td></tr>
-<tr><td align="right">Password:</td><td><input type="text" id="password" name="password" value=""></td></tr>
-<tr><td align="right">DHCP:</td><td><input type="checkbox" id="dhcp" name="dhcp"></td></tr>
-<tr><td align="right">IP:     </td><td><input type="text" id="ip_0" name="ip_0" size="3">.<input type="text" id="ip_1" name="ip_1" size="3">.<input type="text" id="ip_2" name="ip_2" size="3">.<input type="text" id="ip_3" name="ip_3" value="" size="3"></td></tr>
-<tr><td align="right">Netmask:</td><td><input type="text" id="nm_0" name="nm_0" size="3">.<input type="text" id="nm_1" name="nm_1" size="3">.<input type="text" id="nm_2" name="nm_2" size="3">.<input type="text" id="nm_3" name="nm_3" size="3"></td></tr>
-<tr><td align="right">Gateway:</td><td><input type="text" id="gw_0" name="gw_0" size="3">.<input type="text" id="gw_1" name="gw_1" size="3">.<input type="text" id="gw_2" name="gw_2" size="3">.<input type="text" id="gw_3" name="gw_3" size="3"></td></tr>
-<tr><td colspan="2" align="center"><input type="submit" style="width:150px" class="btn btn--m btn--blue" value="Save"></td></tr>
-</table>
-</form>
-<hr>
-<strong>Connection State:</strong><div id="connectionstate">N/A</div>
-<hr>
-<strong>Networks:</strong><br>
-<table border="0"  cellspacing="3" style="width:310px" >
-<tr><td><div id="networks">Scanning...</div></td></tr>
-<tr><td align="center"><a href="javascript:GetState()" style="width:150px" class="btn btn--m btn--blue">Refresh</a></td></tr>
-</table>
-
-
-<script>
-
-function GetState()
-{
-	setValues("/admin/connectionstate");
-}
-function selssid(value)
-{
-	document.getElementById("ssid").value = value; 
-}
-
-
-window.onload = function ()
-{
-	load("style.css","css", function() 
-	{
-		load("microajax.js","js", function() 
-		{
-					setValues("/admin/values");
-					setTimeout(GetState,3000);
-		});
-	});
-}
-function load(e,t,n){if("js"==t){var a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}else if("css"==t){var a=document.createElement("link");a.href=e,a.rel="stylesheet",a.type="text/css",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}}
-
-
-
-
-</script>
-
-
-)=====";
-
-const char web_WaitAndReload[] PROGMEM = R"=====(
-<meta http-equiv="refresh" content="5; URL=config.html">
-Please Wait....Configuring and Restarting.
-)=====";
-
-
-//
-//  SEND HTML PAGE OR IF A FORM SUMBITTED VALUES, PROCESS THESE VALUES
-// 
-
-void send_network_configuration_html()
-{
-//	digitalWrite(Blue_Led, LOW);
-	if (server.args() > 0 )  // Save Settings
-	{
-		String temp = "";
-		config.dhcp = false;
-		for ( uint8_t i = 0; i < server.args(); i++ ) {
-			if (server.argName(i) == "ssid") config.ssid =   urldecode(server.arg(i));
-			if (server.argName(i) == "password") config.password =    urldecode(server.arg(i)); 
-			if (server.argName(i) == "ip_0") if (checkRange(server.arg(i))) 	config.IP[0] =  server.arg(i).toInt();
-			if (server.argName(i) == "ip_1") if (checkRange(server.arg(i))) 	config.IP[1] =  server.arg(i).toInt();
-			if (server.argName(i) == "ip_2") if (checkRange(server.arg(i))) 	config.IP[2] =  server.arg(i).toInt();
-			if (server.argName(i) == "ip_3") if (checkRange(server.arg(i))) 	config.IP[3] =  server.arg(i).toInt();
-			if (server.argName(i) == "nm_0") if (checkRange(server.arg(i))) 	config.Netmask[0] =  server.arg(i).toInt();
-			if (server.argName(i) == "nm_1") if (checkRange(server.arg(i))) 	config.Netmask[1] =  server.arg(i).toInt();
-			if (server.argName(i) == "nm_2") if (checkRange(server.arg(i))) 	config.Netmask[2] =  server.arg(i).toInt();
-			if (server.argName(i) == "nm_3") if (checkRange(server.arg(i))) 	config.Netmask[3] =  server.arg(i).toInt();
-			if (server.argName(i) == "gw_0") if (checkRange(server.arg(i))) 	config.Gateway[0] =  server.arg(i).toInt();
-			if (server.argName(i) == "gw_1") if (checkRange(server.arg(i))) 	config.Gateway[1] =  server.arg(i).toInt();
-			if (server.argName(i) == "gw_2") if (checkRange(server.arg(i))) 	config.Gateway[2] =  server.arg(i).toInt();
-			if (server.argName(i) == "gw_3") if (checkRange(server.arg(i))) 	config.Gateway[3] =  server.arg(i).toInt();
-			if (server.argName(i) == "dhcp") config.dhcp = true;
-		}
-		 server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(web_WaitAndReload) );
-		WriteConfig();
-		ConfigureWifi();
-		AdminTimeOutCounter=0;
-		
-	}
-	else
-	{
-		server.send ( 200, "text/html", web_NetworkConfiguration ); 
-	}
-	Serial.println(__FUNCTION__); 
-//  digitalWrite(Blue_Led, HIGH);
-}
-
-
-
-//
-//   FILL THE PAGE WITH VALUES
-//
-
-void send_network_configuration_values_html()
-{
-  //digitalWrite(Blue_Led, LOW);
-	String values ="";
-
-	values += "ssid|" + (String) config.ssid + "|input\n";
-	values += "password|" +  (String) config.password + "|input\n";
-	values += "ip_0|" +  (String) config.IP[0] + "|input\n";
-	values += "ip_1|" +  (String) config.IP[1] + "|input\n";
-	values += "ip_2|" +  (String) config.IP[2] + "|input\n";
-	values += "ip_3|" +  (String) config.IP[3] + "|input\n";
-	values += "nm_0|" +  (String) config.Netmask[0] + "|input\n";
-	values += "nm_1|" +  (String) config.Netmask[1] + "|input\n";
-	values += "nm_2|" +  (String) config.Netmask[2] + "|input\n";
-	values += "nm_3|" +  (String) config.Netmask[3] + "|input\n";
-	values += "gw_0|" +  (String) config.Gateway[0] + "|input\n";
-	values += "gw_1|" +  (String) config.Gateway[1] + "|input\n";
-	values += "gw_2|" +  (String) config.Gateway[2] + "|input\n";
-	values += "gw_3|" +  (String) config.Gateway[3] + "|input\n";
-	values += "dhcp|" +  (String) (config.dhcp ? "checked" : "") + "|chk\n";
-	server.send ( 200, "text/plain", values);
-	Serial.println(__FUNCTION__); 
-	//digitalWrite(Blue_Led, HIGH);
-}
-
-
-//
-//   FILL THE PAGE WITH NETWORKSTATE & NETWORKS
-//
-
-void send_connection_state_values_html()
-{
-  //digitalWrite(Blue_Led, LOW);
-	String state = "N/A";
-	String Networks = "";
-	if (WiFi.status() == 0) state = "Idle";
-	else if (WiFi.status() == 1) state = "NO SSID AVAILBLE";
-	else if (WiFi.status() == 2) state = "SCAN COMPLETED";
-	else if (WiFi.status() == 3) state = "CONNECTED";
-	else if (WiFi.status() == 4) state = "CONNECT FAILED";
-	else if (WiFi.status() == 5) state = "CONNECTION LOST";
-	else if (WiFi.status() == 6) state = "DISCONNECTED";
-
-
-
-	 int n = WiFi.scanNetworks();
- 
-	 if (n == 0)
-	 {
-		 Networks = "<font color='#FF0000'>No networks found!</font>";
-	 }
-	else
-    {
-	 
-		
-		Networks = "Found " +String(n) + " Networks<br>";
-		Networks += "<table border='0' cellspacing='0' cellpadding='3'>";
-		Networks += "<tr bgcolor='#DDDDDD' ><td><strong>Name</strong></td><td><strong>Quality</strong></td><td><strong>Enc</strong></td><tr>";
-		for (int i = 0; i < n; ++i)
-		{
-			int quality=0;
-			if(WiFi.RSSI(i) <= -100)
-			{
-					quality = 0;
-			}
-			else if(WiFi.RSSI(i) >= -50)
-			{
-					quality = 100;
-			}
-			else
-			{
-				quality = 2 * (WiFi.RSSI(i) + 100);
-			}
-
-
-			Networks += "<tr><td><a href='javascript:selssid(\""  +  String(WiFi.SSID(i))  + "\")'>"  +  String(WiFi.SSID(i))  + "</a></td><td>" +  String(quality) + "%</td><td>" +  String((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*")  + "</td></tr>";
-		}
-		Networks += "</table>";
-	}
-   
-	String values ="";
-	values += "connectionstate|" +  state + "|div\n";
-	values += "networks|" +  Networks + "|div\n";
-	server.send ( 200, "text/plain", values);
-	Serial.println(__FUNCTION__); 
-	//digitalWrite(Blue_Led, HIGH);
-}

+ 0 - 32
web_Root.h

@@ -1,32 +0,0 @@
-
-
-const char web_Root[] PROGMEM = R"=====(
-<!doctype html>
-<meta name="viewport" content="width=device-width, initial-scale=1" />
-<script src="microajax.js"></script> 
-<html>
-	<head>
-	<title></title>
-	<meta charset="utf-8" />
-	</head>
-	<body>
-	<link rel="stylesheet" href="style.css" type="text/css" />
-	It work's!
-	</body>
-</html>
-
-)=====";
-
-void sendRootPage()
-{        
-//    digitalWrite(Blue_Led, LOW);
-    if (server.args() > 0 )  // Are there any POST/GET Fields ? 
-    {
-       for ( uint8_t i = 0; i < server.args(); i++ ) {  // Iterate through the fields
-            
-        }
-    }
-    server.send ( 200, "text/html", web_Root ); 
-    digitalWrite(Blue_Led, HIGH);
-}
- 

File diff suppressed because it is too large
+ 0 - 31
web_Script.js.h


+ 0 - 68
web_Style.css.h

@@ -1,68 +0,0 @@
-
-const char web_Style_css[] PROGMEM = R"=====(
-body { color: #000000; font-family: avenir, helvetica, arial, sans-serif;  letter-spacing: 0.15em;} 
-hr {    background-color: #eee;    border: 0 none;   color: #eee;    height: 1px; } 
-.btn, .btn:link, .btn:visited {  
-	border-radius: 0.3em;  
-	border-style: solid;  
-	border-width: 1px;  
-color: #111;  
-display: inline-block;  
-	font-family: avenir, helvetica, arial, sans-serif;  
-	letter-spacing: 0.15em;  
-	margin-bottom: 0.5em;  
-padding: 1em 0.75em;  
-	text-decoration: none;  
-	text-transform: uppercase;  
-	-webkit-transition: color 0.4s, background-color 0.4s, border 0.4s;  
-transition: color 0.4s, background-color 0.4s, border 0.4s; 
-} 
-.btn:hover, .btn:focus {
-color: #7FDBFF;  
-border: 1px solid #7FDBFF;  
-	-webkit-transition: background-color 0.3s, color 0.3s, border 0.3s;  
-transition: background-color 0.3s, color 0.3s, border 0.3s; 
-}
-	.btn:active {  
-color: #0074D9;  
-border: 1px solid #0074D9;  
-		-webkit-transition: background-color 0.3s, color 0.3s, border 0.3s;  
-transition: background-color 0.3s, color 0.3s, border 0.3s; 
-	} 
-	.btn--s 
-	{  
-		font-size: 12px; 
-	}
-	.btn--m { 
-		font-size: 14px; 
-	}
-	.btn--l {  
-		font-size: 20px;  border-radius: 0.25em !important; 
-	} 
-	.btn--full, .btn--full:link {
-		border-radius: 0.25em; 
-display: block;  
-			margin-left: auto; 
-			margin-right: auto; 
-			text-align: center; 
-width: 100%; 
-	} 
-	.btn--blue:link, .btn--blue:visited {
-color: #fff;  
-		background-color: #0074D9; 
-	}
-	.btn--blue:hover, .btn--blue:focus {
-color: #fff !important;  
-		background-color: #0063aa;  
-		border-color: #0063aa; 
-	}
-	.btn--blue:active {
-color: #fff; 
-		background-color: #001F3F;  border-color: #001F3F; 
-	}
-	@media screen and (min-width: 32em) {
-		.btn--full {  
-			max-width: 16em !important; } 
-	}
-)=====";
-