Set up scheduled program cycles #24
|
@ -11,7 +11,7 @@
|
|||
[env:esp32doit-devkit-v1]
|
||||
platform = espressif32
|
||||
build_flags =
|
||||
-std=c++11
|
||||
; -std=c++11
|
||||
; -std=gnu++11
|
||||
board = esp32doit-devkit-v1
|
||||
framework = arduino
|
||||
|
|
|
@ -63,24 +63,29 @@ const char index_html[] PROGMEM = R"rawliteral(
|
|||
<!DOCTYPE HTML><html><head>
|
||||
<title>ESP Input Form</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script>
|
||||
<script type="text/javascript">
|
||||
console.log("JS");
|
||||
// Submit timestamps as unix seconds
|
||||
var putDate = function(form) {
|
||||
console.log("putDate");
|
||||
form.inputTimeUnix.value = Math.floor(Date.now() / 1000) - new Date().getTimezoneOffset()*60;
|
||||
document.getElementById("js_start_time_unix").value = ((Date.parse(js_start_time_unix_entry.value))/1000);
|
||||
};
|
||||
}
|
||||
// Refresh page after submit so values are right https://stackoverflow.com/a/1860732/2152245
|
||||
window.onload = function() {
|
||||
document.getElementById("hidden-form").onload = function() {
|
||||
top.location.reload();
|
||||
console.log("Reloading");
|
||||
}
|
||||
// Current start date to string
|
||||
s = %inputStartTimeUnix%;
|
||||
//s = %inputStartTimeUnix%;
|
||||
s = "1694019170";
|
||||
console.log(s);
|
||||
current_start = new Date(s * 1000);
|
||||
//current_start_utc = current_start.toUTCString();
|
||||
document.getElementById('current-start').innerHTML = current_start.toString();
|
||||
// Show the local time
|
||||
local_time_unix = new Date().toString(); //Math.floor(Date.now() / 1000) - new Date().getTimezoneOffset()*60;
|
||||
local_time_unix = new Date().toString();
|
||||
document.getElementById('local-time-unix').innerHTML = local_time_unix.toString();
|
||||
}
|
||||
|
||||
|
@ -212,10 +217,6 @@ String processor(const String& var){
|
|||
}
|
||||
else if(var == "inputFloat"){
|
||||
return readFile(SPIFFS, "/inputFloat.txt");
|
||||
// } else if(var == "inputTimeUnix"){
|
||||
// //return rtc.now().timestamp();
|
||||
// Serial.print("RTC time: ");
|
||||
// Serial.println(rtc.now().unixtime());
|
||||
} else if(var == "inputStartTimeUnix"){
|
||||
return readFile(SPIFFS, "/inputStartTimeUnix.txt");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user