mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-31 14:51:02 +03:00
test1
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
[TakeImage]
|
||||
;RawImagesLocation = /log/source
|
||||
;RawImagesRetention = 15
|
||||
SaveAllFiles = false
|
||||
WaitBeforeTakingPicture = 2
|
||||
CamXclkFreqMhz = 20
|
||||
CamGainceiling = x8
|
||||
CamQuality = 10
|
||||
CamBrightness = 0
|
||||
@@ -35,9 +37,10 @@ LEDIntensity = 50
|
||||
Demo = false
|
||||
|
||||
[Alignment]
|
||||
InitialRotate = 0.0
|
||||
SearchFieldX = 20
|
||||
SearchFieldY = 20
|
||||
SearchMaxAngle = 15
|
||||
InitialRotate = 0.0
|
||||
AlignmentAlgo = default
|
||||
/config/ref0.jpg 103 271
|
||||
/config/ref1.jpg 442 142
|
||||
@@ -62,18 +65,19 @@ main.ana3 283 374 92 92 false
|
||||
main.ana4 155 328 92 92 false
|
||||
|
||||
[PostProcessing]
|
||||
main.DecimalShift = 0
|
||||
main.AnalogDigitTransitionStart = 9.2
|
||||
main.ChangeRateThreshold = 2
|
||||
PreValueUse = true
|
||||
PreValueAgeStartup = 720
|
||||
ErrorMessage = true
|
||||
main.AllowNegativeRates = false
|
||||
main.DecimalShift = 0
|
||||
main.AnalogToDigitTransitionStart = 9.8
|
||||
;main.MaxFlowRate = 4.0
|
||||
main.MaxRateValue = 0.05
|
||||
;main.MaxRateType = AbsoluteChange
|
||||
main.MaxRateType = AbsoluteChange
|
||||
main.ChangeRateThreshold = 2
|
||||
main.ExtendedResolution = false
|
||||
main.IgnoreLeadingNaN = false
|
||||
ErrorMessage = true
|
||||
main.CheckDigitIncreaseConsistency = false
|
||||
main.ProcessAlgoNew = false
|
||||
|
||||
;[MQTT]
|
||||
;Uri = mqtt://IP-ADRESS:1883
|
||||
@@ -81,8 +85,9 @@ main.CheckDigitIncreaseConsistency = false
|
||||
;ClientID = watermeter
|
||||
;user = USERNAME
|
||||
;password = PASSWORD
|
||||
RetainMessages = false
|
||||
HomeassistantDiscovery = false
|
||||
;RetainMessages = false
|
||||
;HomeassistantDiscovery = false
|
||||
;DiscoveryPrefix = 1
|
||||
;MeterType = other
|
||||
;CACert = /config/certs/RootCA.pem
|
||||
;ClientCert = /config/certs/client.pem.crt
|
||||
@@ -139,7 +144,7 @@ LogfilesRetention = 3
|
||||
TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
|
||||
;TimeServer = pool.ntp.org
|
||||
;Hostname = undefined
|
||||
RSSIThreshold = -75
|
||||
RSSIThreshold = 0
|
||||
CPUFrequency = 160
|
||||
Tooltip = true
|
||||
SetupMode = true
|
||||
SetupMode = true
|
||||
BIN
sd-card/html/Flowstate_at_work.jpg
Normal file
BIN
sd-card/html/Flowstate_at_work.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
@@ -7,7 +7,6 @@
|
||||
var domainname_for_testing = "";
|
||||
//var domainname_for_testing = "192.168.1.151";
|
||||
|
||||
|
||||
/* Returns the domainname with prepended protocol.
|
||||
Eg. http://watermeter.fritz.box or http://192.168.1.5 */
|
||||
function getDomainname(){
|
||||
@@ -37,12 +36,10 @@ function UpdatePage(_dosession = true){
|
||||
window.location = zw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function LoadHostname() {
|
||||
_domainname = getDomainname();
|
||||
|
||||
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.addEventListener('load', function(event) {
|
||||
if (xhttp.status >= 200 && xhttp.status < 300) {
|
||||
@@ -54,21 +51,16 @@ function LoadHostname() {
|
||||
console.warn(request.statusText, request.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
// var xhttp = new XMLHttpRequest();
|
||||
try {
|
||||
url = _domainname + '/info?type=Hostname';
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
// alert("Loading Hostname failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var fwVersion = "";
|
||||
var webUiVersion = "";
|
||||
|
||||
@@ -126,7 +118,6 @@ function LoadWebUiVersion() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function compareVersions() {
|
||||
if (fwVersion == "" || webUiVersion == "") {
|
||||
return;
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var ret = MakeRefImageZW(refInfo[aktindex], enhanceCon, domainname);
|
||||
var ret = MakeTempRefImage(refInfo[aktindex], enhanceCon, domainname);
|
||||
|
||||
if (ret) {
|
||||
UpdateReference();
|
||||
@@ -484,7 +484,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var ret = MakeRefImageZW(refInfo[aktindex], enhanceCon, domainname);
|
||||
var ret = MakeTempRefImage(refInfo[aktindex], enhanceCon, domainname);
|
||||
|
||||
if (ret) {
|
||||
UpdateReference();
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
<script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="firework.js?v=$COMMIT_HASH"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body style="font-family: arial; padding: 0px 10px;">
|
||||
@@ -945,4 +944,4 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,6 @@ p {font-size: 1em;}
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
||||
<script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
<input required type="number" id="FineRotate_value1" value=0.0 min="-1" max="1" step="0.1" onchange="cameraParameterChangedDR()"
|
||||
oninput="(!validity.rangeOverflow||(value=1)) && (!validity.rangeUnderflow||(value=-1)) && (!validity.stepMismatch||(value=parseInt(this.value)));">degree
|
||||
</td>
|
||||
<td></td>
|
||||
<td class="tooltip" style="display:none;"></td>
|
||||
|
||||
<td class="indent1">
|
||||
<class id="TakeImage_CamSaturation_text" style="color:black;">Saturation: </class>
|
||||
@@ -389,7 +389,6 @@
|
||||
<b>Reference Image:</b><br>
|
||||
<canvas id="canvas"></canvas>
|
||||
|
||||
|
||||
<script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
p += parseInt($(this).height()) + 30
|
||||
});
|
||||
|
||||
$('<div id="'+ fid +'" class="'+ c +'">'+ m +'<a onclick="firework.remove(\'#'+ fid +'\')"><img style="height:28px;" src=close.png></a></div>')
|
||||
$('<div id="'+ fid +'" class="'+ c +'">'+ m +'<a onclick="firework.remove(\'#'+ fid +'\')"><img style="height:28px;" src="close.png"></a></div>')
|
||||
.appendTo('body')
|
||||
.animate({
|
||||
opacity: 1,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Data Graph</title>
|
||||
|
||||
<script type="text/javascript" src='plotly-basic-2.18.2.min.js?v=$COMMIT_HASH'></script>
|
||||
|
||||
<script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>AI on the edge</title>
|
||||
|
||||
<style>
|
||||
/* Add these styles to your existing CSS file or in a <style> tag in the head */
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
background-color: #d8d8d8;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.footer-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.footer-section img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.donation-cards img {
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
||||
<link rel="apple-touch-icon" href="watermeter.svg?v=$COMMIT_HASH" />
|
||||
<title>AI on the edge</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="style.css?v=$COMMIT_HASH" type="text/css" >
|
||||
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
||||
@@ -16,6 +42,8 @@
|
||||
<script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="firework.js?v=$COMMIT_HASH"></script>
|
||||
|
||||
<script type="text/javascript">var domainname = getDomainname();</script>
|
||||
|
||||
<script>
|
||||
var streamPopup;
|
||||
var streamFlashlight = false;
|
||||
@@ -69,30 +97,6 @@
|
||||
return "";
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
/* Add these styles to your existing CSS file or in a <style> tag in the head */
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
background-color: #d8d8d8;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.footer-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.footer-section img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.donation-cards img {
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -107,7 +111,6 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<div class="menu" onmouseover="resetMenu()">
|
||||
<ul>
|
||||
<li><a href="#" onclick="loadPage('overview.html?v=$COMMIT_HASH');">Overview</a></li>
|
||||
@@ -129,10 +132,9 @@
|
||||
<li style="width: 260px"><a href="#" onclick="loadPage('edit_config.html?v=$COMMIT_HASH');">Configuration</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<li><a>Data<i class="arrow down"></i></a>
|
||||
<ul class="submenu">
|
||||
<li><a href="#" onclick="loadPage(getDomainname() + '/value?full');">Recognition</a></li>
|
||||
<li><a href="#" onclick="loadPage(domainname + '/value?full');">Recognition</a></li>
|
||||
<li><a>Livestream <i class="arrow right"></i></a>
|
||||
<ul>
|
||||
<li><a href="#" onclick="start_livestream(false);">Live Stream (Light off)</a></li>
|
||||
@@ -141,29 +143,33 @@
|
||||
</li>
|
||||
<li><a href="#" onclick="loadPage('graph.html?v=$COMMIT_HASH');">Data Graph</a></li>
|
||||
<li><a href="#" onclick="loadPage('data.html?v=$COMMIT_HASH');">Data Table</a></li>
|
||||
<li><a href="#" onclick="loadPage(getDomainname() + '/fileserver/log/data/');">Data Files</a></li>
|
||||
<li><a href="#" onclick="loadPage(domainname + '/fileserver/log/data/');">Data Files</a></li>
|
||||
<li><a href="#" onclick="loadPage('data_export.html?v=$COMMIT_HASH');">Data Export</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<li><a>System <i class="arrow down"></i></a>
|
||||
<ul class="submenu">
|
||||
<li><a href="#" onclick="loadPage('backup.html?v=$COMMIT_HASH');">Backup/Restore</a></li>
|
||||
<li><a href="#" onclick="loadPage('ota_page.html?v=$COMMIT_HASH');">OTA Update</a></li>
|
||||
<li><a href="#" onclick="loadPage('log.html?v=$COMMIT_HASH');">Log Viewer</a></li>
|
||||
<li><a href="#" onclick="loadPage(getDomainname() + '/fileserver/');">File Server</a></li>
|
||||
<li><a href="#" onclick="loadPage(domainname + '/fileserver/');">File Server</a></li>
|
||||
<li><a href="#" onclick="loadPage('reboot_page.html?v=$COMMIT_HASH');">Reboot</a></li>
|
||||
<li><a href="#" onclick="loadPage('info.html?v=$COMMIT_HASH');">Info</a></li>
|
||||
<li><a href="https://jomjol.github.io/AI-on-the-edge-device-docs/" target="_blank">Help</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li id="ManualControl" style="display:none;"><a>Manual Control <i class="arrow down"></i></a> <!-- Workaround: Hide menu if no entry is available -->
|
||||
<ul class="submenu" style="width: 300px">
|
||||
<li><a href="#" onclick="flow_start()">Start Round</a></li>
|
||||
<li id="HASendDiscovery" style="width: 300px" style="display:none;"><a href="#" onclick="HA_send_discovery()">Resend Homeassistant Discovery</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li style="float: right; padding-right: 10px;">
|
||||
<div style="font-size: 12px; color: white; padding-top: 20px;" id="system_date"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -193,82 +199,114 @@
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<script type="text/javascript">
|
||||
LoadHostname();
|
||||
LoadFwVersion();
|
||||
LoadWebUiVersion();
|
||||
HA_send_discovery_visibility();
|
||||
|
||||
if (getCookie("page") == "" || getCookie("page") == "reboot_page.html?v=$COMMIT_HASH") {
|
||||
document.cookie = "page=overview.html?v=$COMMIT_HASH" + "; path=/";
|
||||
}
|
||||
console.log("Loading page: " + getCookie("page"));
|
||||
document.getElementById('maincontent').src = getCookie("page");
|
||||
|
||||
|
||||
function flow_start() {
|
||||
var url = getDomainname() + '/flow_start';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
firework.launch(xhttp.responseText, 'success', 5000);
|
||||
/*if (xhttp.responseText.substring(0,3) == "001") {
|
||||
firework.launch('Flow start triggered', 'success', 5000);
|
||||
window.location.reload();
|
||||
}
|
||||
else if (xhttp.responseText.substring(0,3) == "002") {
|
||||
firework.launch('Flow start scheduled. Start after round is completed', 'success', 5000);
|
||||
}
|
||||
else if (xhttp.responseText.substring(0,3) == "099") {
|
||||
firework.launch('Flow start triggered, but start not possible (no flow task available)', 'danger', 5000);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
|
||||
function HA_send_discovery_visibility() {
|
||||
loadConfig(domainname);
|
||||
ParseConfig();
|
||||
category = getConfigCategory();
|
||||
param = getConfigParameters();
|
||||
<script type="text/javascript">
|
||||
var param, category;
|
||||
|
||||
if (category["MQTT"]["enabled"] && param["MQTT"]["HomeassistantDiscovery"].value1 == "true") {
|
||||
document.getElementById("ManualControl").style.display="";
|
||||
document.getElementById("HASendDiscovery").style.display="";
|
||||
function updateTime() {
|
||||
var _system_date = new Date();
|
||||
|
||||
var _year = _system_date.getFullYear();
|
||||
var _month = _system_date.getMonth() + 1;
|
||||
var _day = _system_date.getDate();
|
||||
|
||||
var _hours = _system_date.getHours();
|
||||
var _minutes = _system_date.getMinutes();
|
||||
var _seconds = _system_date.getSeconds();
|
||||
|
||||
if (_month < 10) {_month = '0' + _month;}
|
||||
if (_day < 10) {_day = '0' + _day;}
|
||||
|
||||
if (_hours < 10) {_hours = '0' + _hours;}
|
||||
if (_minutes < 10) {_minutes = '0' + _minutes;}
|
||||
if (_seconds < 10) {_seconds = '0' + _seconds;}
|
||||
|
||||
var day_in_week = _system_date.getDay();
|
||||
var weekday = new Array("Sonntag", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
|
||||
|
||||
var _date = weekday[day_in_week] + ", " + _day + "." + _month + "." + _year + " " + _hours + ":" + _minutes + ":" + _seconds;
|
||||
document.getElementById('system_date').innerHTML = _date;
|
||||
|
||||
setTimeout(updateTime, 1);
|
||||
}
|
||||
|
||||
function flow_start() {
|
||||
var url = domainname + '/flow_start';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
firework.launch(xhttp.responseText, 'success', 5000);
|
||||
/*if (xhttp.responseText.substring(0,3) == "001") {
|
||||
firework.launch('Flow start triggered', 'success', 5000);
|
||||
window.location.reload();
|
||||
}
|
||||
else if (xhttp.responseText.substring(0,3) == "002") {
|
||||
firework.launch('Flow start scheduled. Start after round is completed', 'success', 5000);
|
||||
}
|
||||
else if (xhttp.responseText.substring(0,3) == "099") {
|
||||
firework.launch('Flow start triggered, but start not possible (no flow task available)', 'danger', 5000);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
function HA_send_discovery_visibility() {
|
||||
loadConfig(domainname);
|
||||
ParseConfig();
|
||||
|
||||
category = getConfigCategory();
|
||||
param = getConfigParameters();
|
||||
|
||||
if (category["MQTT"]["enabled"] && param["MQTT"]["HomeassistantDiscovery"].value1 == "true") {
|
||||
document.getElementById("ManualControl").style.display="";
|
||||
document.getElementById("HASendDiscovery").style.display="";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function HA_send_discovery() {
|
||||
console.log("Homeassistant Discovery topic sending scheduled");
|
||||
var url = getDomainname() + '/mqtt_publish_discovery';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
firework.launch('Sending Homeassistant discovery topics scheduled. It will get sent in the step "Publish to MQTT" of the next digitization round', 'success', 5000);
|
||||
}
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
function HA_send_discovery() {
|
||||
console.log("Homeassistant Discovery topic sending scheduled");
|
||||
var url = domainname + '/mqtt_publish_discovery';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
firework.launch('Sending Homeassistant discovery topics scheduled. It will get sent in the step "Publish to MQTT" of the next digitization round', 'success', 5000);
|
||||
}
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
function start_livestream(streamFlashlight) {
|
||||
if (streamPopup) {
|
||||
streamPopup.close();
|
||||
}
|
||||
function start_livestream(streamFlashlight) {
|
||||
if (streamPopup) {
|
||||
streamPopup.close();
|
||||
}
|
||||
|
||||
if (streamFlashlight) {
|
||||
streamPopup = window.open(getDomainname() + '/stream?flashlight=true','LivestreamWithlight',streamWindowFeatures);
|
||||
}
|
||||
else {
|
||||
streamPopup = window.open(getDomainname() + '/stream','Livestream',streamWindowFeatures);
|
||||
}
|
||||
if (streamFlashlight) {
|
||||
streamPopup = window.open(domainname + '/stream?flashlight=true','LivestreamWithlight',streamWindowFeatures);
|
||||
}
|
||||
else {
|
||||
streamPopup = window.open(domainname + '/stream','Livestream',streamWindowFeatures);
|
||||
}
|
||||
|
||||
streamPopup.focus();
|
||||
}
|
||||
</script>
|
||||
streamPopup.focus();
|
||||
}
|
||||
|
||||
function init() {
|
||||
LoadHostname();
|
||||
LoadFwVersion();
|
||||
LoadWebUiVersion();
|
||||
HA_send_discovery_visibility();
|
||||
|
||||
if (getCookie("page") == "" || getCookie("page") == "reboot_page.html?v=$COMMIT_HASH") {
|
||||
document.cookie = "page=overview.html?v=$COMMIT_HASH" + "; path=/";
|
||||
}
|
||||
console.log("Loading page: " + getCookie("page"));
|
||||
document.getElementById('maincontent').src = getCookie("page");
|
||||
|
||||
updateTime();
|
||||
}
|
||||
init();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Info</title>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<style>
|
||||
h1 {font-size: 2em;}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Log Viewer</title>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>OTA Update</title>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<style>
|
||||
h1 {font-size: 2em;}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Overview</title>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<style>
|
||||
.tg {
|
||||
@@ -294,7 +294,7 @@
|
||||
}
|
||||
|
||||
if (_split.length == 1) {
|
||||
var _zer = ZerlegeZeile(_split[0], "\t")
|
||||
var _zer = split_line(_split[0], "\t")
|
||||
|
||||
if (_zer.length > 1) {
|
||||
out = _zer[1];
|
||||
@@ -305,7 +305,7 @@
|
||||
}
|
||||
else {
|
||||
for (var j = 0; j < _split.length; ++j) {
|
||||
var _zer = ZerlegeZeile(_split[j], "\t")
|
||||
var _zer = split_line(_split[j], "\t")
|
||||
|
||||
if (_zer.length == 1) {
|
||||
out = out + "<tr><td style=\"width: 22%; padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\">" +
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Set PreValue</title>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<style>
|
||||
h1 {font-size: 2em;}
|
||||
|
||||
@@ -1,31 +1,3 @@
|
||||
function SaveConfigToServer(_domainname){
|
||||
// leere Zeilen am Ende löschen
|
||||
var zw = config_split.length - 1;
|
||||
|
||||
while (config_split[zw] == "") {
|
||||
config_split.pop();
|
||||
}
|
||||
|
||||
var config_gesamt = "";
|
||||
|
||||
for (var i = 0; i < config_split.length; ++i)
|
||||
{
|
||||
config_gesamt = config_gesamt + config_split[i] + "\n";
|
||||
}
|
||||
|
||||
FileDeleteOnServer("/config/config.ini", _domainname);
|
||||
|
||||
FileSendContent(config_gesamt, "/config/config.ini", _domainname);
|
||||
}
|
||||
|
||||
function UpdateConfig(zw, _index, _enhance, _domainname){
|
||||
var namezw = zw["name"];
|
||||
FileCopyOnServer("/img_tmp/ref_zw.jpg", namezw, _domainname);
|
||||
var namezw = zw["name"].replace(".jpg", "_org.jpg");
|
||||
FileCopyOnServer("/img_tmp/ref_zw_org.jpg", namezw, _domainname);
|
||||
}
|
||||
|
||||
|
||||
function createReader(file) {
|
||||
var image = new Image();
|
||||
|
||||
@@ -43,32 +15,26 @@ function createReader(file) {
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
|
||||
|
||||
function ZerlegeZeile(input, delimiter = " =\t\r") {
|
||||
function split_line(input, delimiter = " =\t\r") {
|
||||
var Output = Array(0);
|
||||
// delimiter = " =,\t";
|
||||
|
||||
/* The input can have multiple formats:
|
||||
* - key = value
|
||||
* - key = value1 value2 value3 ...
|
||||
* - key value1 value2 value3 ...
|
||||
*
|
||||
* Examples:
|
||||
* - ImageSize = VGA
|
||||
* - IO0 = input disabled 10 false false
|
||||
* - main.dig1 28 144 55 100 false
|
||||
*
|
||||
* This causes issues eg. if a password key has a whitespace or equal sign in its value.
|
||||
* As a workaround and to not break any legacy usage, we enforce to only use the
|
||||
* equal sign, if the key is "password"
|
||||
*/
|
||||
if (input.includes("password") || input.includes("Token")) { // Line contains a password, use the equal sign as the only delimiter and only split on first occurrence
|
||||
var upper_input = input.toUpperCase();
|
||||
|
||||
// if (input.includes("password") || input.includes("EapId") || input.includes("Token") || input.includes("ApiKey") || input.includes("http_password")) {
|
||||
if (upper_input.includes("PASSWORD") || upper_input.includes("EAPID") || upper_input.includes("TOKEN") || upper_input.includes("APIKEY") || upper_input.includes("HTTP_PASSWORD")) {
|
||||
var pos = input.indexOf("=");
|
||||
delimiter = " \t\r"
|
||||
delimiter = " \t\r";
|
||||
Output.push(trim(input.substr(0, pos), delimiter));
|
||||
Output.push(trim(input.substr(pos +1, input.length), delimiter));
|
||||
|
||||
var is_pw_encrypted = input.substr(pos + 2, 6);
|
||||
|
||||
if (is_pw_encrypted == "**##**") {
|
||||
Output.push(encryptDecrypt(input.substr(pos + 8, input.length)));
|
||||
}
|
||||
else {
|
||||
Output.push(trim(input.substr(pos + 1, input.length), delimiter));
|
||||
}
|
||||
}
|
||||
else { // Legacy Mode
|
||||
else {
|
||||
input = trim(input, delimiter);
|
||||
var pos = findDelimiterPos(input, delimiter);
|
||||
var token;
|
||||
@@ -77,7 +43,8 @@ function ZerlegeZeile(input, delimiter = " =\t\r") {
|
||||
token = input.substr(0, pos);
|
||||
token = trim(token, delimiter);
|
||||
Output.push(token);
|
||||
input = input.substr(pos+1, input.length);
|
||||
|
||||
input = input.substr(pos + 1, input.length);
|
||||
input = trim(input, delimiter);
|
||||
pos = findDelimiterPos(input, delimiter);
|
||||
}
|
||||
@@ -86,33 +53,31 @@ function ZerlegeZeile(input, delimiter = " =\t\r") {
|
||||
}
|
||||
|
||||
return Output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function findDelimiterPos(input, delimiter) {
|
||||
var pos = -1;
|
||||
var zw;
|
||||
var input_temp;
|
||||
var akt_del;
|
||||
|
||||
for (var anz = 0; anz < delimiter.length; ++anz) {
|
||||
akt_del = delimiter[anz];
|
||||
zw = input.indexOf(akt_del);
|
||||
input_temp = input.indexOf(akt_del);
|
||||
|
||||
if (zw > -1) {
|
||||
if (input_temp > -1) {
|
||||
if (pos > -1) {
|
||||
if (zw < pos) {
|
||||
pos = zw;
|
||||
if (input_temp < pos) {
|
||||
pos = input_temp;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pos = zw;
|
||||
pos = input_temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
function trim(istring, adddelimiter) {
|
||||
while ((istring.length > 0) && (adddelimiter.indexOf(istring[0]) >= 0)) {
|
||||
@@ -126,27 +91,6 @@ function trim(istring, adddelimiter) {
|
||||
return istring;
|
||||
}
|
||||
|
||||
|
||||
function getConfig() {
|
||||
return config_gesamt;
|
||||
}
|
||||
|
||||
|
||||
function loadConfig(_domainname) {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
||||
try {
|
||||
url = _domainname + '/fileserver/config/config.ini';
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
config_gesamt = xhttp.responseText;
|
||||
config_gesamt = config_gesamt.replace("InitalRotate", "InitialRotate"); // Korrigiere Schreibfehler in config.ini !!!!!
|
||||
} catch (error) {}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function dataURLtoBlob(dataurl) {
|
||||
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
|
||||
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
||||
@@ -157,7 +101,6 @@ function dataURLtoBlob(dataurl) {
|
||||
|
||||
return new Blob([u8arr], {type:mime});
|
||||
}
|
||||
|
||||
|
||||
function FileCopyOnServer(_source, _target, _domainname = "") {
|
||||
url = _domainname + "/editflow?task=copy&in=" + _source + "&out=" + _target;
|
||||
@@ -169,7 +112,6 @@ function FileCopyOnServer(_source, _target, _domainname = "") {
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
|
||||
function FileDeleteOnServer(_filename, _domainname = "") {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
var okay = false;
|
||||
@@ -179,14 +121,6 @@ function FileDeleteOnServer(_filename, _domainname = "") {
|
||||
if (xhttp.status == 200) {
|
||||
okay = true;
|
||||
}
|
||||
else if (xhttp.status == 0) {
|
||||
// firework.launch('Server closed the connection abruptly!', 'danger', 30000);
|
||||
// location.reload()
|
||||
}
|
||||
else {
|
||||
// firework.launch('An error occured: ' + xhttp.responseText, 'danger', 30000);
|
||||
// location.reload()
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -199,7 +133,6 @@ function FileDeleteOnServer(_filename, _domainname = "") {
|
||||
return okay;
|
||||
}
|
||||
|
||||
|
||||
function FileSendContent(_content, _filename, _domainname = "") {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
var okay = false;
|
||||
@@ -227,11 +160,10 @@ function FileSendContent(_content, _filename, _domainname = "") {
|
||||
return okay;
|
||||
}
|
||||
|
||||
|
||||
function MakeRefImageZW(zw, _enhance, _domainname){
|
||||
var _filename = zw["name"].replace("/config/", "/img_tmp/");
|
||||
function MakeTempRefImage(_filename, _enhance, _domainname){
|
||||
var filename = _filename["name"].replace("/config/", "/img_tmp/");
|
||||
|
||||
var url = _domainname + "/editflow?task=cutref&in=/config/reference.jpg&out=" + _filename + "&x=" + zw["x"] + "&y=" + zw["y"] + "&dx=" + zw["dx"] + "&dy=" + zw["dy"];
|
||||
var url = _domainname + "/editflow?task=cutref&in=/config/reference.jpg&out=" + filename + "&x=" + _filename["x"] + "&y=" + _filename["y"] + "&dx=" + _filename["dx"] + "&dy=" + _filename["dy"];
|
||||
|
||||
if (_enhance == true){
|
||||
url = url + "&enhance=true";
|
||||
@@ -257,3 +189,82 @@ function MakeRefImageZW(zw, _enhance, _domainname){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Encrypt password
|
||||
function EncryptPwString(pwToEncrypt) {
|
||||
var _pw_temp = "**##**";
|
||||
var pw_temp = "";
|
||||
|
||||
if (isInString(pwToEncrypt, _pw_temp)) {
|
||||
pw_temp = pwToEncrypt;
|
||||
}
|
||||
else {
|
||||
pw_temp = _pw_temp + encryptDecrypt(pwToEncrypt);
|
||||
}
|
||||
|
||||
return pw_temp;
|
||||
}
|
||||
|
||||
// Decrypt password
|
||||
function DecryptPwString(pwToDencrypt) {
|
||||
var _pw_temp = "**##**";
|
||||
var pw_temp = "";
|
||||
|
||||
if (isInString(pwToDencrypt, _pw_temp))
|
||||
{
|
||||
var _temp = ReplaceString(pwToDencrypt, _pw_temp, "");
|
||||
pw_temp = encryptDecrypt(_temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
pw_temp = pwToDencrypt;
|
||||
}
|
||||
|
||||
return pw_temp;
|
||||
}
|
||||
|
||||
function decryptConfigPwOnSD(_domainname = getDomainname()) {
|
||||
var url = _domainname + "/edit_flow?task=pw_decrypt&config_decrypt=true";
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
||||
try {
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
} catch (error) {}
|
||||
|
||||
if (xhttp.responseText == "decrypted") {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function decryptWifiPwOnSD(_domainname = getDomainname()) {
|
||||
var url = _domainname + "/edit_flow?task=pw_decrypt&wifi_decrypt=true";
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
||||
try {
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
} catch (error) {}
|
||||
|
||||
if (xhttp.responseText == "decrypted") {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function encryptDecrypt(input) {
|
||||
var key = ['K', 'C', 'Q']; //Can be any chars, and any size array
|
||||
var output = [];
|
||||
|
||||
for (var i = 0; i < input.length; i++) {
|
||||
var charCode = input.charCodeAt(i) ^ key[i % key.length].charCodeAt(0);
|
||||
output.push(String.fromCharCode(charCode));
|
||||
}
|
||||
|
||||
return output.join("");
|
||||
}
|
||||
|
||||
@@ -6,6 +6,84 @@ var ref = new Array(2);
|
||||
var NUMBERS = new Array(0);
|
||||
var REFERENCES = new Array(0);
|
||||
|
||||
var domainname_for_testing = "";
|
||||
|
||||
/* Returns the domainname with prepended protocol.
|
||||
Eg. http://watermeter.fritz.box or http://192.168.1.5 */
|
||||
function getDomainname(){
|
||||
var host = window.location.hostname;
|
||||
if (domainname_for_testing != "") {
|
||||
console.log("Using pre-defined domainname for testing: " + domainname_for_testing);
|
||||
domainname = "http://" + domainname_for_testing;
|
||||
}
|
||||
else
|
||||
{
|
||||
domainname = window.location.protocol + "//" + host;
|
||||
if (window.location.port != "") {
|
||||
domainname = domainname + ":" + window.location.port;
|
||||
}
|
||||
}
|
||||
|
||||
return domainname;
|
||||
}
|
||||
|
||||
function getConfig() {
|
||||
return config_gesamt;
|
||||
}
|
||||
|
||||
function loadConfig(_domainname) {
|
||||
config_gesamt = "";
|
||||
|
||||
var url = _domainname + "/fileserver/config/config.ini";
|
||||
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.addEventListener('load', function(event) {
|
||||
if (xhttp.status >= 200 && xhttp.status < 300) {
|
||||
config_gesamt = xhttp.responseText;
|
||||
}
|
||||
else {
|
||||
console.warn('Response status: ${response.status}');
|
||||
}
|
||||
});
|
||||
try {
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
} catch (error) {}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function loadConfig1(_domainname) {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
||||
try {
|
||||
url = _domainname + '/fileserver/config/config.ini';
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
config_gesamt = xhttp.responseText;
|
||||
} catch (error) {}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function SaveConfigToServer(_domainname){
|
||||
// leere Zeilen am Ende löschen
|
||||
var _config_split_length = config_split.length - 1;
|
||||
|
||||
while (config_split[_config_split_length] == "") {
|
||||
config_split.pop();
|
||||
}
|
||||
|
||||
var _config_gesamt = "";
|
||||
|
||||
for (var i = 0; i < config_split.length; ++i) {
|
||||
_config_gesamt = _config_gesamt + config_split[i] + "\n";
|
||||
}
|
||||
|
||||
FileDeleteOnServer("/config/config.ini", _domainname);
|
||||
FileSendContent(_config_gesamt, "/config/config.ini", _domainname);
|
||||
}
|
||||
|
||||
function getNUMBERSList() {
|
||||
_domainname = getDomainname();
|
||||
var namenumberslist = "";
|
||||
@@ -99,50 +177,54 @@ function ParseConfig() {
|
||||
category[catname]["enabled"] = false;
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "RawImagesLocation");
|
||||
ParamAddValue(param, catname, "RawImagesRetention");
|
||||
ParamAddValue(param, catname, "WaitBeforeTakingPicture");
|
||||
ParamAddValue(param, catname, "CamGainceiling"); // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
||||
ParamAddValue(param, catname, "CamQuality"); // 0 - 63
|
||||
ParamAddValue(param, catname, "CamBrightness"); // (-2 to 2) - set brightness
|
||||
ParamAddValue(param, catname, "CamContrast"); //-2 - 2
|
||||
ParamAddValue(param, catname, "CamSaturation"); //-2 - 2
|
||||
ParamAddValue(param, catname, "CamSharpness"); //-2 - 2
|
||||
ParamAddValue(param, catname, "CamAutoSharpness"); // (1 or 0)
|
||||
ParamAddValue(param, catname, "CamSpecialEffect"); // 0 - 6
|
||||
ParamAddValue(param, catname, "CamWbMode"); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
||||
ParamAddValue(param, catname, "CamAwb"); // white balance enable (0 or 1)
|
||||
ParamAddValue(param, catname, "CamAwbGain"); // Auto White Balance enable (0 or 1)
|
||||
ParamAddValue(param, catname, "CamAec"); // auto exposure off (1 or 0)
|
||||
ParamAddValue(param, catname, "CamAec2"); // automatic exposure sensor (0 or 1)
|
||||
ParamAddValue(param, catname, "CamAeLevel"); // auto exposure levels (-2 to 2)
|
||||
ParamAddValue(param, catname, "CamAecValue"); // set exposure manually (0-1200)
|
||||
ParamAddValue(param, catname, "CamAgc"); // auto gain off (1 or 0)
|
||||
ParamAddValue(param, catname, "CamAgcGain"); // set gain manually (0 - 30)
|
||||
ParamAddValue(param, catname, "CamBpc"); // black pixel correction
|
||||
ParamAddValue(param, catname, "CamWpc"); // white pixel correction
|
||||
ParamAddValue(param, catname, "CamRawGma"); // (1 or 0)
|
||||
ParamAddValue(param, catname, "CamLenc"); // lens correction (1 or 0)
|
||||
ParamAddValue(param, catname, "CamHmirror"); // (0 or 1) flip horizontally
|
||||
ParamAddValue(param, catname, "CamVflip"); // Invert image (0 or 1)
|
||||
ParamAddValue(param, catname, "CamDcw"); // downsize enable (1 or 0)
|
||||
ParamAddValue(param, catname, "CamDenoise"); // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
||||
ParamAddValue(param, catname, "CamZoom");
|
||||
ParamAddValue(param, catname, "CamZoomOffsetX");
|
||||
ParamAddValue(param, catname, "CamZoomOffsetY");
|
||||
ParamAddValue(param, catname, "CamZoomSize");
|
||||
ParamAddValue(param, catname, "LEDIntensity");
|
||||
ParamAddValue(param, catname, "Demo");
|
||||
ParamAddValue(param, catname, "RawImagesLocation", 1, false, "/log/source");
|
||||
ParamAddValue(param, catname, "RawImagesRetention", 1, false, "15");
|
||||
ParamAddValue(param, catname, "SaveAllFiles", 1, false, "false");
|
||||
ParamAddValue(param, catname, "WaitBeforeTakingPicture", 1, false, "2");
|
||||
ParamAddValue(param, catname, "CamXclkFreqMhz", 1, false, "20");
|
||||
ParamAddValue(param, catname, "CamGainceiling", 1, false, "x8"); // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
|
||||
ParamAddValue(param, catname, "CamQuality", 1, false, "10"); // 0 - 63
|
||||
ParamAddValue(param, catname, "CamBrightness", 1, false, "0"); // (-2 to 2) - set brightness
|
||||
ParamAddValue(param, catname, "CamContrast", 1, false, "0"); //-2 - 2
|
||||
ParamAddValue(param, catname, "CamSaturation", 1, false, "0"); //-2 - 2
|
||||
ParamAddValue(param, catname, "CamSharpness", 1, false, "0"); //-2 - 2
|
||||
ParamAddValue(param, catname, "CamAutoSharpness", 1, false, "false"); // (1 or 0)
|
||||
ParamAddValue(param, catname, "CamSpecialEffect", 1, false, "no_effect"); // 0 - 6
|
||||
ParamAddValue(param, catname, "CamWbMode", 1, false, "auto"); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
|
||||
ParamAddValue(param, catname, "CamAwb", 1, false, "true"); // white balance enable (0 or 1)
|
||||
ParamAddValue(param, catname, "CamAwbGain", 1, false, "true"); // Auto White Balance enable (0 or 1)
|
||||
ParamAddValue(param, catname, "CamAec", 1, false, "true"); // auto exposure off (1 or 0)
|
||||
ParamAddValue(param, catname, "CamAec2", 1, false, "true"); // automatic exposure sensor (0 or 1)
|
||||
ParamAddValue(param, catname, "CamAeLevel", 1, false, "2"); // auto exposure levels (-2 to 2)
|
||||
ParamAddValue(param, catname, "CamAecValue", 1, false, "600"); // set exposure manually (0-1200)
|
||||
ParamAddValue(param, catname, "CamAgc", 1, false, "true"); // auto gain off (1 or 0)
|
||||
ParamAddValue(param, catname, "CamAgcGain", 1, false, "8"); // set gain manually (0 - 30)
|
||||
ParamAddValue(param, catname, "CamBpc", 1, false, "true"); // black pixel correction
|
||||
ParamAddValue(param, catname, "CamWpc", 1, false, "true"); // white pixel correction
|
||||
ParamAddValue(param, catname, "CamRawGma", 1, false, "true"); // (1 or 0)
|
||||
ParamAddValue(param, catname, "CamLenc", 1, false, "true"); // lens correction (1 or 0)
|
||||
ParamAddValue(param, catname, "CamHmirror", 1, false, "false"); // (0 or 1) flip horizontally
|
||||
ParamAddValue(param, catname, "CamVflip", 1, false, "false"); // Invert image (0 or 1)
|
||||
ParamAddValue(param, catname, "CamDcw", 1, false, "true"); // downsize enable (1 or 0)
|
||||
ParamAddValue(param, catname, "CamDenoise", 1, false, "0"); // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
|
||||
ParamAddValue(param, catname, "CamZoom", 1, false, "false");
|
||||
ParamAddValue(param, catname, "CamZoomSize", 1, false, "0");
|
||||
ParamAddValue(param, catname, "CamZoomOffsetX", 1, false, "0");
|
||||
ParamAddValue(param, catname, "CamZoomOffsetY", 1, false, "0");
|
||||
ParamAddValue(param, catname, "LEDIntensity", 1, false, "50");
|
||||
ParamAddValue(param, catname, "Demo", 1, false, "false");
|
||||
|
||||
var catname = "Alignment";
|
||||
category[catname] = new Object();
|
||||
category[catname]["enabled"] = false;
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "InitialRotate");
|
||||
ParamAddValue(param, catname, "SearchFieldX");
|
||||
ParamAddValue(param, catname, "SearchFieldY");
|
||||
ParamAddValue(param, catname, "AlignmentAlgo");
|
||||
ParamAddValue(param, catname, "SearchFieldX", 1, false, "20");
|
||||
ParamAddValue(param, catname, "SearchFieldY", 1, false, "20");
|
||||
ParamAddValue(param, catname, "SearchMaxAngle", 1, false, "45");
|
||||
ParamAddValue(param, catname, "Antialiasing", 1, false, "true");
|
||||
ParamAddValue(param, catname, "AlignmentAlgo", 1, false, "default");
|
||||
ParamAddValue(param, catname, "InitialRotate", 1, false, "0");
|
||||
|
||||
var catname = "Digits";
|
||||
category[catname] = new Object();
|
||||
@@ -150,9 +232,9 @@ function ParseConfig() {
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "Model");
|
||||
ParamAddValue(param, catname, "CNNGoodThreshold", 1);
|
||||
ParamAddValue(param, catname, "ROIImagesLocation");
|
||||
ParamAddValue(param, catname, "ROIImagesRetention");
|
||||
ParamAddValue(param, catname, "CNNGoodThreshold", 1, false, "0.5");
|
||||
ParamAddValue(param, catname, "ROIImagesLocation", 1, false, "/log/digit");
|
||||
ParamAddValue(param, catname, "ROIImagesRetention", 1, false, "3");
|
||||
|
||||
var catname = "Analog";
|
||||
category[catname] = new Object();
|
||||
@@ -160,28 +242,27 @@ function ParseConfig() {
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "Model");
|
||||
ParamAddValue(param, catname, "ROIImagesLocation");
|
||||
ParamAddValue(param, catname, "ROIImagesRetention");
|
||||
ParamAddValue(param, catname, "ROIImagesLocation", 1, false, "/log/analog");
|
||||
ParamAddValue(param, catname, "ROIImagesRetention", 1, false, "3");
|
||||
|
||||
var catname = "PostProcessing";
|
||||
category[catname] = new Object();
|
||||
category[catname]["enabled"] = false;
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
// ParamAddValue(param, catname, "PreValueUse", 1, true, "true");
|
||||
ParamAddValue(param, catname, "PreValueUse", 1, false, "true");
|
||||
ParamAddValue(param, catname, "PreValueAgeStartup", 1, false, "720");
|
||||
ParamAddValue(param, catname, "ErrorMessage", 1, false, "true");
|
||||
ParamAddValue(param, catname, "AllowNegativeRates", 1, true, "false");
|
||||
ParamAddValue(param, catname, "DecimalShift", 1, true, "0");
|
||||
ParamAddValue(param, catname, "AnalogToDigitTransitionStart", 1, true, "9.2");
|
||||
ParamAddValue(param, catname, "ChangeRateThreshold", 1, true, "2");
|
||||
// ParamAddValue(param, catname, "PreValueUse", 1, true, "true");
|
||||
ParamAddValue(param, catname, "PreValueUse");
|
||||
ParamAddValue(param, catname, "PreValueAgeStartup");
|
||||
ParamAddValue(param, catname, "AllowNegativeRates", 1, true, "false");
|
||||
ParamAddValue(param, catname, "MaxFlowRate", 1, true, "4.0");
|
||||
ParamAddValue(param, catname, "MaxRateValue", 1, true, "0.05");
|
||||
ParamAddValue(param, catname, "MaxRateType", 1, true);
|
||||
ParamAddValue(param, catname, "ChangeRateThreshold", 1, true, "2");
|
||||
ParamAddValue(param, catname, "ExtendedResolution", 1, true, "false");
|
||||
ParamAddValue(param, catname, "IgnoreLeadingNaN", 1, true, "false");
|
||||
// ParamAddValue(param, catname, "IgnoreAllNaN", 1, true, "false");
|
||||
ParamAddValue(param, catname, "ErrorMessage");
|
||||
ParamAddValue(param, catname, "CheckDigitIncreaseConsistency", 1, true, "false");
|
||||
|
||||
var catname = "MQTT";
|
||||
category[catname] = new Object();
|
||||
@@ -197,6 +278,7 @@ function ParseConfig() {
|
||||
ParamAddValue(param, catname, "DomoticzTopicIn");
|
||||
ParamAddValue(param, catname, "DomoticzIDX", 1, true);
|
||||
ParamAddValue(param, catname, "HomeassistantDiscovery");
|
||||
ParamAddValue(param, catname, "DiscoveryPrefix", 1, false);
|
||||
ParamAddValue(param, catname, "MeterType");
|
||||
ParamAddValue(param, catname, "CACert");
|
||||
ParamAddValue(param, catname, "ClientCert");
|
||||
@@ -210,7 +292,6 @@ function ParseConfig() {
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "Uri");
|
||||
ParamAddValue(param, catname, "Database");
|
||||
// ParamAddValue(param, catname, "Measurement");
|
||||
ParamAddValue(param, catname, "user");
|
||||
ParamAddValue(param, catname, "password");
|
||||
ParamAddValue(param, catname, "Measurement", 1, true);
|
||||
@@ -223,7 +304,6 @@ function ParseConfig() {
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "Uri");
|
||||
ParamAddValue(param, catname, "Bucket");
|
||||
// ParamAddValue(param, catname, "Measurement");
|
||||
ParamAddValue(param, catname, "Org");
|
||||
ParamAddValue(param, catname, "Token");
|
||||
ParamAddValue(param, catname, "Measurement", 1, true);
|
||||
@@ -234,9 +314,9 @@ function ParseConfig() {
|
||||
category[catname]["enabled"] = false;
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "Uri");
|
||||
ParamAddValue(param, catname, "ApiKey");
|
||||
ParamAddValue(param, catname, "UploadImg");
|
||||
ParamAddValue(param, catname, "Uri", 1, false);
|
||||
ParamAddValue(param, catname, "ApiKey", 1, false);
|
||||
ParamAddValue(param, catname, "UploadImg", 1, false);
|
||||
|
||||
var catname = "GPIO";
|
||||
category[catname] = new Object();
|
||||
@@ -264,37 +344,37 @@ function ParseConfig() {
|
||||
category[catname]["enabled"] = false;
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
//ParamAddValue(param, catname, "AutoStart");
|
||||
ParamAddValue(param, catname, "Interval");
|
||||
//ParamAddValue(param, catname, "AutoStart", 1, false, "true");
|
||||
ParamAddValue(param, catname, "Interval", 1, false, "5");
|
||||
|
||||
var catname = "DataLogging";
|
||||
category[catname] = new Object();
|
||||
category[catname]["enabled"] = false;
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "DataLogActive");
|
||||
ParamAddValue(param, catname, "DataFilesRetention");
|
||||
ParamAddValue(param, catname, "DataLogActive", 1, false, "true");
|
||||
ParamAddValue(param, catname, "DataFilesRetention", 1, false, "3");
|
||||
|
||||
var catname = "Debug";
|
||||
category[catname] = new Object();
|
||||
category[catname]["enabled"] = false;
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "LogLevel");
|
||||
ParamAddValue(param, catname, "LogfilesRetention");
|
||||
ParamAddValue(param, catname, "LogLevel", 1, false, "1");
|
||||
ParamAddValue(param, catname, "LogfilesRetention", 1, false, "3");
|
||||
|
||||
var catname = "System";
|
||||
category[catname] = new Object();
|
||||
category[catname]["enabled"] = false;
|
||||
category[catname]["found"] = false;
|
||||
param[catname] = new Object();
|
||||
ParamAddValue(param, catname, "Tooltip");
|
||||
ParamAddValue(param, catname, "TimeZone");
|
||||
ParamAddValue(param, catname, "TimeServer");
|
||||
ParamAddValue(param, catname, "Hostname");
|
||||
ParamAddValue(param, catname, "RSSIThreshold");
|
||||
ParamAddValue(param, catname, "CPUFrequency");
|
||||
ParamAddValue(param, catname, "SetupMode");
|
||||
ParamAddValue(param, catname, "TimeZone", 1, false, "default");
|
||||
ParamAddValue(param, catname, "TimeServer", 1, false, "default");
|
||||
ParamAddValue(param, catname, "Hostname", 1, false, "watermeter");
|
||||
ParamAddValue(param, catname, "RSSIThreshold", 1, false, "0");
|
||||
ParamAddValue(param, catname, "CPUFrequency", 1, false, "160");
|
||||
ParamAddValue(param, catname, "Tooltip", 1, false, "true");
|
||||
ParamAddValue(param, catname, "SetupMode", 1, false, "false");
|
||||
|
||||
while (aktline < config_split.length){
|
||||
for (var cat in category) {
|
||||
@@ -372,7 +452,7 @@ function ParseConfigParamAll(_aktline, _catname) {
|
||||
while ((_aktline < config_split.length) && !(config_split[_aktline][0] == "[") && !((config_split[_aktline][0] == ";") && (config_split[_aktline][1] == "["))) {
|
||||
var _input = config_split[_aktline];
|
||||
let [isCom, input] = isCommented(_input);
|
||||
var linesplit = ZerlegeZeile(input);
|
||||
var linesplit = split_line(input);
|
||||
ParamExtractValueAll(param, linesplit, _catname, _aktline, isCom);
|
||||
|
||||
if (!isCom && (linesplit.length >= 5) && (_catname == 'Digits')) {
|
||||
@@ -788,7 +868,7 @@ function getConfigCategory() {
|
||||
}
|
||||
|
||||
function ExtractROIs(_aktline, _type){
|
||||
var linesplit = ZerlegeZeile(_aktline);
|
||||
var linesplit = split_line(_aktline);
|
||||
abc = getNUMBERS(linesplit[0], _type);
|
||||
abc["pos_ref"] = _aktline;
|
||||
abc["x"] = linesplit[1];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Reboot</title>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<style>
|
||||
h1 {font-size: 2em;}
|
||||
@@ -41,6 +41,5 @@ function doReboot() {
|
||||
window.location.replace(stringota);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -1,10 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>AI on the edge</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<style>
|
||||
.h_iframe_explain iframe {
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
||||
<script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="firework.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="/common.js?v=$COMMIT_HASH">
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tr><td>WLAN-SSID</td><td><input type="text" name="ssid" id="ssid"></td><td>SSID of the WLAN</td></tr>
|
||||
<tr><td>WLAN-Password</td><td><input type="text" name="password" id="password"></td><td>ATTENTION: the password will not be encrypted during the sending.</td>
|
||||
</tr><tr><td> Hostname</td><td><input type="text" name="hostname" id="hostname"></td><td></td>
|
||||
</tr><tr><td>Fixed IP</td><td><input type="text" name="ip" id="ip"></td><td>Leave emtpy if set by router</td></tr>
|
||||
<tr><td>gateway</td><td><input type="text" name="gateway" id="gateway"></td><td>Leave emtpy if set by router</td></tr>
|
||||
<tr><td>netmask</td><td><input type="text" name="netmask" id="netmask"></td><td>Leave emtpy if set by router</td>
|
||||
</tr><tr><td>DNS</td><td><input type="text" name="dns" id="dns"></td><td>Leave emtpy if set by router</td></tr>
|
||||
<tr><td>RSSI Threshold</td><td><input type="number" name="name" id="threshold" min="-100" max="0" step="1" value = "0"></td><td>WLAN Mesh Parameter: Threshold for RSSI value to check for start switching access point in a mesh system.Possible values: -100 to 0, 0 = disabled - Value will be transfered to wlan.ini at next startup)</td></tr>
|
||||
</table>
|
||||
<button class="button" type="button" onclick="wr();">Write wlan.ini</button>
|
||||
<input id="newfile" type="file">
|
||||
<button class="button" style="width:300px" id="doUpdate" type="button" onclick="upload()">Upload Files</button>
|
||||
|
||||
|
||||
<script language="JavaScript">function wr(){
|
||||
api = "/config?"+"ssid"+document.getElementById("ssid").value+"&pwd="+document.getElementById("password").value;+"&hn="+document.getElementById("hostname").value;+"&ip="+document.getElementById("ip").value;+"&gw="+document.getElementById("gateway").value;+"&nm="+document.getElementById("netmask").value;+"&dns="+document.getElementById("dns").value;+"&rssi="+document.getElementById("threshold").value;
|
||||
fetch(api);}
|
||||
|
||||
|
||||
// var xhttp = new XMLHttpRequest();
|
||||
// xhttp.onreadystatechange = function() {if (xhttp.readyState == 4) {if (xhttp.status == 200) {document.reload();}}};
|
||||
if (!file.name.includes("remote-setup")){
|
||||
if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure you have downloaded the correct file?"))
|
||||
return;
|
||||
}
|
||||
|
||||
function upload() {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (xhttp.readyState == 4) {stopProgressTimer();if (xhttp.status == 200) {extract();} }};
|
||||
var filePath = document.getElementById("newfile").value.split(/[\\\/]/).pop();
|
||||
var file = document.getElementById("newfile").files[0];
|
||||
if (!file.name.includes("remote-setup"))
|
||||
{
|
||||
if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure you have downloaded the correct file?"))
|
||||
return;
|
||||
}
|
||||
|
||||
var upload_path = "/upload/firmware/" + filePath; xhttp.open("POST", upload_path, true); xhttp.send(file);}
|
||||
|
||||
|
||||
function extract() {
|
||||
document.getElementById("status").innerText = "Status: Processing on device (takes up to 3 minutes)...";
|
||||
|
||||
var xhttp = new XMLHttpRequest();
|
||||
/* first delete the old firmware */
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (xhttp.readyState == 4) {
|
||||
stopProgressTimer();
|
||||
if (xhttp.status == 200) {
|
||||
document.getElementById("status").innerText = "Status: Update completed!";
|
||||
document.getElementById("doUpdate").disabled = true;
|
||||
document.getElementById("newfile").disabled = false;
|
||||
document.cookie = "page=overview.html?v=$COMMIT_HASH" + "; path=/"; // Make sure after the reboot we go to the overview page
|
||||
|
||||
if (xhttp.responseText.startsWith("reboot"))
|
||||
{
|
||||
doRebootAfterUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
firework.launch('Processing done! (' + xhttp.responseText + ')', 'success', 5000);
|
||||
}
|
||||
} else if (xhttp.status == 0) {
|
||||
firework.launch('Server closed the connection abruptly!', 'danger', 30000);
|
||||
UpdatePage();
|
||||
} else {
|
||||
firework.launch('An error occured: ' + xhttp.responseText, 'danger', 30000);
|
||||
UpdatePage();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
startProgressTimer("Extraction");
|
||||
|
||||
|
||||
var nameneu = document.getElementById("newfile").value;
|
||||
filePath = nameneu.split(/[\\\/]/).pop();
|
||||
var _toDo = domainname + "/ota?task=update&file=" + filePath;
|
||||
xhttp.open("GET", _toDo, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
|
||||
function startProgressTimer(step) {
|
||||
console.log(step + "...");
|
||||
document.getElementById('progress').innerHTML = "(0s)";
|
||||
action_runtime = 0;
|
||||
progressTimerHandle = setInterval(function() {
|
||||
action_runtime += 1;
|
||||
console.log("Progress: " + action_runtime + "s");
|
||||
document.getElementById('progress').innerHTML = "(" + action_runtime + "s)";
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
function stopProgressTimer() {
|
||||
clearInterval(progressTimerHandle);
|
||||
document.getElementById('progress').innerHTML = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user