Files
AI-on-the-edge-device/sd-card/html/common.js
jomjol 2a7f3b33a3 Extend InfluxDBv1 with individual topic names (#2319)
* Implement individual influx topic

* Update interface_influxdb.cpp

* Update interface_influxdb.cpp

* Update FieldName

* analogROI: Activate save button after ROI creation (#2326)

* Migration of PlatformIO 5.2.0 to 6.1.0 (resp. ESP IDF from 4.4.2 to 5.0.1) (#2305)

* Migration to PlatformIO 6.1.0

* Disable RMTMEM usage as it is no longer allowed -> Smart LEDs not functional!

* moved miniz into subfolder of jomjol_fileserver_ota, else it does not build anymore.

* cleanup

* fix leading NaN (#2310)

* Migration to PlatformIO 6.1.0

* Disable RMTMEM usage as it is no longer allowed -> Smart LEDs not functional!

* moved miniz into subfolder of jomjol_fileserver_ota, else it does not build anymore.

* cleanup

* Task watchdog has new config name

* Fix return value check. It must be something else than ESP_FAIL, but it does not need to be ESP_OK!

* add missing strucures to work around new RMTMEM restriction (untested)

---------

Co-authored-by: CaCO3 <caco@ruinelli.ch>

* Keep MainFlowTask alive to handle reboot (#2325)

* Shared PSRAM memory (#2285)

* enable PSRAM logging

* add extra functions for psram shared memroy handling

* CImageBasis objects still should used dynamic memory (eg. rawImage), haw ever tmpImage must be placed inside the shared memory

* Place all STBI allocs inside the shared memory

* The models are placed in the shared PSRAM reagion and must be allocated through the dedicated functions

* .

* renaming

* fix cast warning

* add flag to switch STBI PSRAM usage

* improve PSRAM shared handling

* reserve shared PSRAM as early as possible

* init logging eralier so we can use it in PSRAM shared alloc

* move Wifi_LWIP, BSS_SEG and MQTT Outbox into PSRAM to ffree internal memory

* Check if model fits into reserved shared memory

* Update code/components/jomjol_tfliteclass/CTfLiteClass.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_flowcontroll/ClassFlowControll.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_image_proc/CImageBasis.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* Update code/components/jomjol_helper/psram.cpp

* .

* .

* .

* .

* Korrektur Merge Conflict in main.cpp

---------

Co-authored-by: CaCO3 <caco@ruinelli.ch>
Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com>

* fix PSRAM init return value check

* Extend incl. indiv. Measurement

* Implement UX

* Update ClassFlowInfluxDBv2.cpp

* Implement individual influx topic

* Update interface_influxdb.cpp

* Update interface_influxdb.cpp

* Update FieldName

* Extend incl. indiv. Measurement

* Implement UX

* Update ClassFlowInfluxDBv2.cpp

* Update main.cpp

---------

Co-authored-by: Slider0007 <115730895+Slider0007@users.noreply.github.com>
Co-authored-by: CaCO3 <caco3@ruinelli.ch>
Co-authored-by: CaCO3 <caco@ruinelli.ch>
2023-04-20 22:00:13 +02:00

153 lines
4.1 KiB
JavaScript

/* The UI can also be run locally, but you have to set the IP of your devide accordingly.
* And you also might have to disable CORS in your webbrowser! */
var domainname_for_testing = "192.168.178.23";
function gethost_Version(){
return "1.0.0 - 20200910";
}
/* 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 (((host == "127.0.0.1") || (host == "localhost") || (host == ""))
// && ((window.location.port == "80") || (window.location.port == ""))
)
{
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 UpdatePage(_dosession = true){
var zw = location.href;
zw = zw.substr(0, zw.indexOf("?"));
if (_dosession) {
window.location = zw + '?session=' + Math.floor((Math.random() * 1000000) + 1);
}
else {
window.location = zw;
}
}
function LoadHostname() {
_domainname = getDomainname();
var xhttp = new XMLHttpRequest();
xhttp.addEventListener('load', function(event) {
if (xhttp.status >= 200 && xhttp.status < 300) {
hostname = xhttp.responseText;
document.title = hostname + " - AI on the edge";
document.getElementById("id_title").innerHTML = "Digitizer - AI on the edge - " + hostname;
}
else {
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 = "";
function LoadFwVersion() {
_domainname = getDomainname();
var xhttp = new XMLHttpRequest();
xhttp.addEventListener('load', function(event) {
if (xhttp.status >= 200 && xhttp.status < 300) {
fwVersion = xhttp.responseText;
document.getElementById("Version").innerHTML = fwVersion;
console.log(fwVersion);
compareVersions();
}
else {
console.warn(request.statusText, request.responseText);
fwVersion = "NaN";
}
});
try {
url = _domainname + '/info?type=FirmwareVersion';
xhttp.open("GET", url, true);
xhttp.send();
}
catch (error) {
fwVersion = "NaN";
}
}
function LoadWebUiVersion() {
_domainname = getDomainname();
var xhttp = new XMLHttpRequest();
xhttp.addEventListener('load', function(event) {
if (xhttp.status >= 200 && xhttp.status < 300) {
webUiVersion = xhttp.responseText;
console.log("Web UI Version: " + webUiVersion);
compareVersions();
}
else {
console.warn(request.statusText, request.responseText);
webUiVersion = "NaN";
}
});
try {
url = _domainname + '/info?type=HTMLVersion';
console.log("url");
xhttp.open("GET", url, true);
xhttp.send();
}
catch (error) {
webUiVersion = "NaN";
}
}
function compareVersions() {
if (fwVersion == "" || webUiVersion == "") {
return;
}
arr = fwVersion.split(" ");
fWGitHash = arr[arr.length - 1].substring(0, 7);
arr = webUiVersion.split(" ");
webUiHash = arr[arr.length - 1].substring(0, 7);
console.log("FW Hash: " + fWGitHash + ", Web UI Hash: " + webUiHash);
if (fWGitHash != webUiHash) {
firework.launch("The Version of the Web Interface (" + webUiHash +
") does not match the Firmware Version (" +
fWGitHash + ")! It is suggested to keep them on the same version!", 'warning', 30000);
}
}