mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2025-10-01 08:40:54 +02:00
Bugfix
This commit is contained in:
@@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
## SmartSwitch
|
## SmartSwitch
|
||||||
* Remote Temperature Control application with schedule (example car block heater or battery charger)
|
* Remote Temperature Control application with schedule (example car block heater or battery charger)
|
||||||
* Based on the ESP_AsyncFSBrowser example
|
* Based on ESP_AsyncFSBrowser example
|
||||||
* Wide browser compatibility, no extra server-side needed.
|
* Wide browser compatibility, no extra server-side needed.
|
||||||
* HTTP server and WebSocket, single port
|
* HTTP server and WebSocket, single port
|
||||||
* Standalone, no JS dependencies for the browser from Internet (I hope), ace editor included
|
* Standalone, no JS dependencies for the browser from Internet (I hope), ace editor included
|
||||||
* Added ESPAsyncWiFiManager
|
* Added ESPAsyncWiFiManager
|
||||||
* Real Time (NTP) w/ Time Zones
|
* Real Time (NTP) w/ Time Zones
|
||||||
* Memorized settings to EEPROM
|
* Memorized settings to EEPROM
|
||||||
* Multiple clients can be connected at same time, they see each other requests
|
* Multiple clients can be connected at same time, they see each other' requests
|
||||||
* Use latest ESP8266 core lib (from github)
|
* Default credentials <b>smart:switch</b>
|
||||||
|
* Use latest ESP8266 core lib (from Github)
|
||||||
|
@@ -14,6 +14,9 @@ Use latest ESP core lib (from github)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define USE_WFM // to use ESPAsyncWiFiManager
|
#define USE_WFM // to use ESPAsyncWiFiManager
|
||||||
|
//#define DEL_WFM // delete Wifi credentials stored
|
||||||
|
//(use once then comment and flash again), also HTTP /erase-wifi can do the same live
|
||||||
|
|
||||||
#define USE_AUTH // .setAuthentication for all static
|
#define USE_AUTH // .setAuthentication for all static
|
||||||
|
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
@@ -44,7 +47,7 @@ Use latest ESP core lib (from github)
|
|||||||
#define EECH 104 // fixed eeprom address to keep selected active channel, only for reference here
|
#define EECH 104 // fixed eeprom address to keep selected active channel, only for reference here
|
||||||
#define EEBEGIN EECH + 1
|
#define EEBEGIN EECH + 1
|
||||||
#define EEMARK 0x5A
|
#define EEMARK 0x5A
|
||||||
#define MEMMAX 1 // 0,1,2... last max index (only 2 channels)
|
#define MEMMAX 2 // 0,1,2... last max index (only 3 channels)
|
||||||
#define EEALL 512
|
#define EEALL 512
|
||||||
|
|
||||||
#define HYST 0.5 // C +/- hysteresis
|
#define HYST 0.5 // C +/- hysteresis
|
||||||
@@ -140,8 +143,9 @@ void showTime()
|
|||||||
Serial.printf("RTC: %02d:%02d\n", tm->tm_hour, tm->tm_min);
|
Serial.printf("RTC: %02d:%02d\n", tm->tm_hour, tm->tm_min);
|
||||||
|
|
||||||
if (sched == 0) { // automatic
|
if (sched == 0) { // automatic
|
||||||
if ((tm->tm_wday > 0)&&(tm->tm_wday < 6)) tmpch = 0; //weekdays
|
if ((tm->tm_wday > 0)&&(tm->tm_wday < 6)) tmpch = 0; //Mon - Fri
|
||||||
else tmpch = 0; //weekend
|
else if (tm->tm_wday == 6) tmpch = 1; //Sat
|
||||||
|
else if (tm->tm_wday == 0) tmpch = 2; //Sun
|
||||||
} else { // manual
|
} else { // manual
|
||||||
tmpch = sched - 1; //and stays
|
tmpch = sched - 1; //and stays
|
||||||
}
|
}
|
||||||
@@ -372,8 +376,10 @@ void setup(){
|
|||||||
//Wifi
|
//Wifi
|
||||||
#ifdef USE_WFM
|
#ifdef USE_WFM
|
||||||
AsyncWiFiManager wifiManager(&server,&dns);
|
AsyncWiFiManager wifiManager(&server,&dns);
|
||||||
//wifiManager.resetSettings();
|
#ifdef DEL_WFM
|
||||||
wifiManager.autoConnect("SmartSW");
|
wifiManager.resetSettings();
|
||||||
|
#endif
|
||||||
|
wifiManager.autoConnect(hostName);
|
||||||
#else
|
#else
|
||||||
//WiFi.mode(WIFI_AP_STA); // Core SVN 5179 use STA as default interface in mDNS (#7042)
|
//WiFi.mode(WIFI_AP_STA); // Core SVN 5179 use STA as default interface in mDNS (#7042)
|
||||||
//WiFi.softAP(hostName); // Core SVN 5179 use STA as default interface in mDNS (#7042)
|
//WiFi.softAP(hostName); // Core SVN 5179 use STA as default interface in mDNS (#7042)
|
||||||
|
@@ -251,12 +251,14 @@
|
|||||||
<tr align="center">
|
<tr align="center">
|
||||||
<td colspan=3>
|
<td colspan=3>
|
||||||
<form name="sched">
|
<form name="sched">
|
||||||
<label class="container">Auto
|
<label class="container">Auto
|
||||||
<input type="radio" name="radio" onclick="handleClick(this);" value="Z0"><span class="checkmark"></span></label>
|
<input type="radio" name="radio" onclick="handleClick(this);" value="Z0"><span class="checkmark"></span></label>
|
||||||
<label class="container">Mon-Fri
|
<label class="container">M-F
|
||||||
<input type="radio" name="radio" onclick="handleClick(this);" value="Z1"><span class="checkmark"></span></label>
|
<input type="radio" name="radio" onclick="handleClick(this);" value="Z1"><span class="checkmark"></span></label>
|
||||||
<label class="container">Sat-Sun
|
<label class="container">Sat
|
||||||
<input type="radio" name="radio" onclick="handleClick(this);" value="Z2"><span class="checkmark"></span></label>
|
<input type="radio" name="radio" onclick="handleClick(this);" value="Z2"><span class="checkmark"></span></label>
|
||||||
|
<label class="container">Sun
|
||||||
|
<input type="radio" name="radio" onclick="handleClick(this);" value="Z3"><span class="checkmark"></span></label>
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -327,7 +329,7 @@
|
|||||||
<script src="app.min.js"></script>
|
<script src="app.min.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const MYCORS = '192.168.0.55';
|
const MYCORS = '192.168.0.12';
|
||||||
var g1, g2;
|
var g1, g2;
|
||||||
var Analog0 = new Array();
|
var Analog0 = new Array();
|
||||||
|
|
Binary file not shown.
@@ -251,12 +251,14 @@
|
|||||||
<tr align="center">
|
<tr align="center">
|
||||||
<td colspan=3>
|
<td colspan=3>
|
||||||
<form name="sched">
|
<form name="sched">
|
||||||
<label class="container">Auto
|
<label class="container">Auto
|
||||||
<input type="radio" name="radio" onclick="handleClick(this);" value="Z0"><span class="checkmark"></span></label>
|
<input type="radio" name="radio" onclick="handleClick(this);" value="Z0"><span class="checkmark"></span></label>
|
||||||
<label class="container">Mon-Fri
|
<label class="container">M-F
|
||||||
<input type="radio" name="radio" onclick="handleClick(this);" value="Z1"><span class="checkmark"></span></label>
|
<input type="radio" name="radio" onclick="handleClick(this);" value="Z1"><span class="checkmark"></span></label>
|
||||||
<label class="container">Sat-Sun
|
<label class="container">Sat
|
||||||
<input type="radio" name="radio" onclick="handleClick(this);" value="Z2"><span class="checkmark"></span></label>
|
<input type="radio" name="radio" onclick="handleClick(this);" value="Z2"><span class="checkmark"></span></label>
|
||||||
|
<label class="container">Sun
|
||||||
|
<input type="radio" name="radio" onclick="handleClick(this);" value="Z3"><span class="checkmark"></span></label>
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -327,7 +329,7 @@
|
|||||||
<script src="app.min.js"></script>
|
<script src="app.min.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const MYCORS = '192.168.0.55';
|
const MYCORS = '192.168.0.12';
|
||||||
var g1, g2;
|
var g1, g2;
|
||||||
var Analog0 = new Array();
|
var Analog0 = new Array();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user