Implementing Web Portal

This commit is contained in:
Skylar Grant 2022-12-21 21:07:46 -05:00
parent 8890e8acbd
commit f0ef52d5c0
7 changed files with 160 additions and 15 deletions

View File

@ -1 +1 @@
{"debugMode":true,"status":{"igniter":0,"blower":0,"auger":0,"igniterFinished":true,"seenFire":false,"shutdown":0,"vacuum":1,"pof":1},"timestamps":{"procStart":1671648471606,"blowerOn":1671648232716,"blowerOff":1671648326617,"igniterOn":1671648232717,"igniterOff":1671648263542},"intervals":{"augerOn":500,"augerOff":1500,"pause":3000,"igniterStart":30000,"blowerStop":10000},"web":{"port":8080,"ip":"127.0.0.1"}}
{"debugMode":true,"status":{"igniter":0,"blower":1,"auger":1,"igniterFinished":true,"seenFire":false,"shutdown":0,"vacuum":1,"pof":1},"timestamps":{"procStart":1671671326941,"blowerOn":1671670035064,"blowerOff":1671660280248,"igniterOn":1671670035064,"igniterOff":1671670065800},"intervals":{"augerOn":500,"augerOff":1500,"pause":3000,"igniterStart":30000,"blowerStop":10000},"web":{"port":8080,"ip":"0.0.0.0"}}

80
log.txt
View File

@ -0,0 +1,80 @@
[0] I: Not running on a Raspberry Pi.
== Lennox Winslow PS40
== Pellet Stove Control Panel
== Author: Skylar Grant
== Version: v0.2.1
==
== Startup Time: 2022-12-21T22:02:46.124Z
==
== Environment variables:
== == ONTIME=500
== == OFFTIME=1500
== == PAUSETIME=3000
== == DEBUG=true
== == ONPI=false
[0.008] I: == GPIO Not Available
[0.008] I: Pausing for 3000ms
[3.012] I: Pausing for 3000ms
[6.015] I: Pausing for 3000ms
[9.016] I: Pausing for 3000ms
[12.018] I: Pausing for 3000ms
[15.02] I: Pausing for 3000ms
[18.021] I: Pausing for 3000ms
[21.023] I: Pausing for 3000ms
[21.995] I: Blower turned on.
[21.995] I: Igniter turned on.
[21.995] I: Auger enabled.
[24.024] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[26.027] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[28.03] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[30.034] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[32.037] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[34.04] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[36.045] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[38.047] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[40.05] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[42.053] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[44.056] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[46.06] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[48.063] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[50.066] I: The igniter is on. Started: 17:3:8. Stopping: 17:3:38.
[52.069] I: Igniter turned off.
[52.069] I: The igniter is on.
[71.858] I: Auger disabled.
A shutdown has already been initiated and the blower is preventing shutdown.
[72.094] I: Pausing for 3000ms
A shutdown has already been initiated and the blower is preventing shutdown.
[75.096] I: Pausing for 3000ms
A shutdown has already been initiated and the blower is preventing shutdown.
[78.098] I: Pausing for 3000ms
A shutdown has already been initiated and the blower is preventing shutdown.
[81.1] I: Pausing for 3000ms
[84.101] I: Blower can be turned off.
Shutting down...
[84.102] I: Pausing for 3000ms
[87.103] I: Pausing for 3000ms
[90.105] I: Pausing for 3000ms
[93.106] I: Pausing for 3000ms
[96.108] I: Pausing for 3000ms
[98.989] I: Blower turned on.
[98.99] I: Igniter turned on.
[98.99] I: Auger enabled.
[99.11] I: The igniter is on. Started: 17:4:25. Stopping: 17:4:55.
[101.113] I: The igniter is on. Started: 17:4:25. Stopping: 17:4:55.
[103.115] I: The igniter is on. Started: 17:4:25. Stopping: 17:4:55.
[103.441] I: Auger disabled.
[103.441] I: Igniter turned off.
A shutdown has already been initiated and the blower is preventing shutdown.
[105.119] I: Pausing for 3000ms
A shutdown has already been initiated and the blower is preventing shutdown.
[108.12] I: Pausing for 3000ms
A shutdown has already been initiated and the blower is preventing shutdown.
[111.123] I: Pausing for 3000ms
[114.124] I: Blower can be turned off.
Shutting down...
[114.125] I: Pausing for 3000ms
[117.126] I: Pausing for 3000ms
[120.128] I: Pausing for 3000ms
[123.129] I: Pausing for 3000ms
[126.131] I: Pausing for 3000ms
[129.132] I: Pausing for 3000ms

View File

@ -1 +1 @@
/Users/voidf1sh/pscontrolpanel/config.json
../../config.json

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

View File

@ -1 +1 @@
/Users/voidf1sh/pscontrolpanel/log.txt
../../log.txt

View File

@ -1,4 +1,6 @@
html, body {
padding: 0;
margin: 0;
background-color: #333;
color: aqua;
font-family: sans-serif;
@ -33,6 +35,12 @@ html, body {
margin: 5px;
}
.subheading {
font-size: 20px;
font-weight: bold;
text-align: center;
}
#log-container {
text-align: center;
}
@ -49,3 +57,37 @@ html, body {
font-size: 20px;
background-color: red;
}
.button-container {
padding: 0;
margin-top: 20px;
margin-bottom: 20px;
text-align: center;
}
.button-unselected {
margin: 5px;
border-width: 0px;
font-family: times;
font-size: 20px;
height: 35px;
width: 100px;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
background-color: #ccc;
}
.button-selected {
margin: 5px;
border-width: 0px;
font-family: times;
font-size: 20px;
height: 35px;
width: 100px;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
}

View File

@ -12,15 +12,24 @@
<div id="controls-container">
<form action="/" method="post">
<!-- Start | Shutdown | Reload Settings -->
<div id="buttons">
<input type="submit" id="ignite" value="Start" name="start"><input type="submit" id="shutdown" value="Shutdown" name="shutdown"><input type="submit" id="reload" value="Reload" name="reload"><br>
<div class="button-container">
<input class="button-unselected" type="submit" id="ignite" value="Start" name="start"><input class="button-unselected" type="submit" id="shutdown" value="Shutdown" name="shutdown"><input class="button-unselected" type="submit" id="reload" value="Reload" name="reload"><br>
</div>
<!-- Set feed rates -->
<label for="augerOn">Auger On Interval: </label><input type="number" id="auger-on" name="augerOn" min="500" max="1000" value="<%= intervals.augerOn %>">ms<br>
<label for="augerOff">Auger Off Interval: </label><input type="number" id="auger-off" name="augerOff" min="1000" max="2000" value="<%= intervals.augerOff %>">ms<br>
<label for="pauseInt">App Pause Interval: </label><input type="number" id="pause-int" name="pauseInt" min="1000" max="600000" value="<%= intervals.pause %>">ms<br>
<!-- <label for="augerOn">Auger On Interval: </label><input type="number" id="auger-on" name="augerOn" min="500" max="1000" value="<%= intervals.augerOn %>">ms<br> -->
<!-- <label for="augerOff">Auger Off Interval: </label><input type="number" id="auger-off" name="augerOff" min="1000" max="2000" value="<%= intervals.augerOff %>">ms<br> -->
<!-- <label for="pauseInt">App Pause Interval: </label><input type="number" id="pause-int" name="pauseInt" min="1000" max="600000" value="<%= intervals.pause %>">ms<br> -->
</form>
</div>
<div class="subheading">
Pellet Feed Rate
</div>
<div class="button-container">
<button class="button-unselected" id="low-level">LOW</button><button class="button-unselected" id="med-level">MED</button><button class="button-unselected" id="hi-level">HI</button>
</div>
<div class="button-container">
<img src="./dancing_jesus.gif">
</div>
<div id="log-container">
<button id="refresh-log" onclick="refreshLog()">Refresh Log</button><br>
<!-- <textarea id="log-area"></textarea> -->
@ -43,6 +52,20 @@
return JSONObj;
}
function parseStatus(data) {
switch (data) {
case 0:
return "Off";
break;
case 1:
return "On";
break
default:
return "Error";
break;
}
}
function refreshData() {
const log = document.getElementById('log-area');
log.contentWindow.location.reload();
@ -59,12 +82,12 @@
const config = readJSON('./config.json');
augerStatus.innerHTML = config.status.auger;
augerOn.innerHTML = config.intervals.augerOn;
augerOff.innerHTML = config.intervals.augerOff;
igniterStatus.innerHTML = config.status.igniter;
blowerStatus.innerHTML = config.status.blower;
pauseInt.innerHTML = config.intervals.pause;
augerStatus.innerHTML = parseStatus(config.status.auger);
augerOn.innerHTML = parseStatus(config.intervals.augerOn);
augerOff.innerHTML = parseStatus(config.intervals.augerOff);
igniterStatus.innerHTML = parseStatus(config.status.igniter);
blowerStatus.innerHTML = parseStatus(config.status.blower);
pauseInt.innerHTML = parseStatus(config.intervals.pause);
sleep(2000).then(() => {
refreshData();