mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-06 16:49:00 +03:00
Merge branch 'rolling' of https://github.com/haverland/AI-on-the-edge-device into rolling
This commit is contained in:
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
@@ -253,7 +253,7 @@ jobs:
|
|||||||
./code/.pio/build/esp32cam/partitions.bin
|
./code/.pio/build/esp32cam/partitions.bin
|
||||||
./code/.pio/build/esp32cam/bootloader.bin
|
./code/.pio/build/esp32cam/bootloader.bin
|
||||||
./sd-card/html/version.txt
|
./sd-card/html/version.txt
|
||||||
key: ${{ github.run_number }}
|
key: ${{ steps.vars.outputs.branch }}
|
||||||
|
|
||||||
# import the changes from
|
# import the changes from
|
||||||
- name: Get generated files from cache
|
- name: Get generated files from cache
|
||||||
|
|||||||
48
Changelog.md
48
Changelog.md
@@ -2,43 +2,56 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
Home Assistant Discovery Support
|
**Home Assistant MQTT Discovery Support**
|
||||||
|
|
||||||
**Make sure to read the instructions below carfully!**.
|
### Update Procedure
|
||||||
|
:bangbang: **Make sure to read the instructions below carfully!**.
|
||||||
|
|
||||||
1. Backup your configuration (use the `System -> Backup/Restore` page)!
|
1. Backup your configuration (use the `System -> Backup/Restore` page)!
|
||||||
1. You should update to `12.0.1` before you update to this release. All other migrations are not tested.
|
1. You should update to `12.0.1` before you update to this release. All other migrations are untested.
|
||||||
1. Upload and update the `update-*.zip` file from this release.
|
1. Upload and update the `update-*.zip` file from this release.
|
||||||
1. Let it restart and check on the `System -> Info` page that the Firmware as well as the Web UI got updated. If only one got updated, redo the update. If it fails several times, you also can update the Firmware and the Web UI separately.
|
1. Let it restart and check on the `System -> Info` page that the Firmware as well as the Web UI got updated. If only one got updated, redo the update. If it fails several times, you also can update the Firmware and the Web UI separately.
|
||||||
1. Please go to `Settings -> Configuration` and address the changed parameters.
|
1. Safe way:
|
||||||
|
1. Update first the `firmware.bin` (extract from zip file) and do the Reboot
|
||||||
|
1. Update with the full zip file (`update-*.zip`, ignore the version warning after the reboot)
|
||||||
|
|
||||||
|
1. Please go to `Settings -> Configuration` and address the changed parameters:
|
||||||
* DataLogging (storing the values for data graph)
|
* DataLogging (storing the values for data graph)
|
||||||
* Debug (extended by different debug reporting levels)
|
* Debug (extended by different debug reporting levels)
|
||||||
|
|
||||||
If anything breaks you can try to
|
If anything breaks you can try to enforce manual update as following:
|
||||||
- Call `http://<IP>/ota?task=update&file=firmware.bin` resp. `http://<IP>/ota?task=update&file=update-*.zip` if the upload successed but the extraction failed (`update-*.zip` is the name of the uploaded file).
|
|
||||||
- Use the initial_esp32_setup.zip ( <https://github.com/jomjol/AI-on-the-edge-device/wiki/Installation> ) as alternative to have a clean install.
|
**OTA:**
|
||||||
|
1. Make sure the last run of the update completed the **Uploading** step.
|
||||||
|
1. Call `http://<IP>/ota?task=update&file=<UPLOAD_FILENAME>` to enforce the extraction/flashing.
|
||||||
|
|
||||||
|
**Initial Setup:**
|
||||||
|
1. Use the initial_esp32_setup.zip ( <https://github.com/jomjol/AI-on-the-edge-device/wiki/Installation> ) as alternative to have a clean install.
|
||||||
|
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Implementation of [Home Assistant MQTT Discovery](https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery)
|
- Implementation of [Home Assistant MQTT Discovery](https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery)
|
||||||
- Improved ROIs configuration: locked ROI geometry, equidistant delta x
|
- Improved ROIs configuration: locked ROI geometry, equidistant delta x
|
||||||
- `/graph.html` to fetch measurements from the debug log and display them as a graph. Activate debug logging for this feature to work.
|
- Improved OTA Update mechanism (only working after installation for next update)
|
||||||
- PreValue is now contained in `/json` ([#1154](https://github.com/jomjol/AI-on-the-edge-device/issues/1154))
|
- Added data logging in `/log/data` - One day per file and each measurement is on one line
|
||||||
- Show graph of values direct in the user interface (thanks to [@rdmueller](https://github.com/rdmueller))
|
|
||||||
- Using new data logging (see below)
|
|
||||||
- Possibility to choose different values and switch between different numbers (if present)
|
|
||||||
|
|
||||||
- SD card info into the `System>Info` menu (thanks to [@Slider007]( https://github.com/Slider0007))
|
|
||||||
- Added a logging of the values in a text table in `/log/data` - each measurement is on one line
|
|
||||||
- Format: csv - comma separated
|
- Format: csv - comma separated
|
||||||
- Content: `time`, `name-of-number`, `raw-value`, `return-value`, `pre-value`, `change-rate`, `change-absolute`, `error-text`, `cnn-digital`, `cnn-analog`
|
- Content: `time`, `name-of-number`, `raw-value`, `return-value`, `pre-value`, `change-rate`, `change-absolute`, `error-text`, `cnn-digital`, `cnn-analog`
|
||||||
|
- Show graph of values direct in the user interface (thanks to [@rdmueller](https://github.com/rdmueller))
|
||||||
|
- Using new data logging (see above)
|
||||||
|
- Possibility to choose different values and switch between different numbers (if present)
|
||||||
|
|
||||||
|
Note: You need to activate data logging for this feature to work, see above!
|
||||||
|
- PreValue is now contained in `/json` ([#1154](https://github.com/jomjol/AI-on-the-edge-device/issues/1154))
|
||||||
|
- SD card info into the `System>Info` menu (thanks to [@Slider007]( https://github.com/Slider0007))
|
||||||
- Version check (Firmware vs. Web UI)
|
- Version check (Firmware vs. Web UI)
|
||||||
|
- Various minor new features
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Updated tflite (`dig-cont_0600_s3.tflite`)
|
- Updated tflite (`dig-cont_0600_s3.tflite`)
|
||||||
- Update mode (more robust, not fully bullet prove yet)
|
- Updated OTA functionality (more robust, but not fully bullet prove yet)
|
||||||
- Updated Espressif library to `espressif32@v5.2.0`
|
- Updated Espressif library to `espressif32@v5.2.0`
|
||||||
- [#1176](https://github.com/jomjol/AI-on-the-edge-device/discussions/1176) accept minor negative values (-0.2) if extended resolution is enabled
|
- [#1176](https://github.com/jomjol/AI-on-the-edge-device/discussions/1176) accept minor negative values (-0.2) if extended resolution is enabled
|
||||||
- [#1143](https://github.com/jomjol/AI-on-the-edge-device/issues/1143) added config parameter `AnalogDigitalTransitionStart`. It can setup very early and very late digit transition starts.
|
- [#1143](https://github.com/jomjol/AI-on-the-edge-device/issues/1143) added config parameter `AnalogDigitalTransitionStart`. It can setup very early and very late digit transition starts.
|
||||||
@@ -58,7 +71,8 @@ If anything breaks you can try to
|
|||||||
|
|
||||||
- n.a.
|
- n.a.
|
||||||
|
|
||||||
## [12.0.1] 2022-09-29
|
|
||||||
|
## [12.0.1](https://github.com/jomjol/AI-on-the-edge-device/releases/tag/v12.0.1), 2022-09-29
|
||||||
|
|
||||||
Improve **u**ser e**x**perience
|
Improve **u**ser e**x**perience
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,68 @@ static const char *TAG = "OTA";
|
|||||||
|
|
||||||
esp_err_t handler_reboot(httpd_req_t *req);
|
esp_err_t handler_reboot(httpd_req_t *req);
|
||||||
|
|
||||||
|
std::string _file_name_update;
|
||||||
|
|
||||||
|
|
||||||
|
void task_do_Update_ZIP(void *pvParameter)
|
||||||
|
{
|
||||||
|
std::string filetype = toUpper(getFileType(_file_name_update));
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "File: " + _file_name_update + " Filetype: " + filetype);
|
||||||
|
|
||||||
|
|
||||||
|
if (filetype == "ZIP")
|
||||||
|
{
|
||||||
|
std::string in, out, outbin, zw, retfirmware;
|
||||||
|
|
||||||
|
out = "/sdcard/html";
|
||||||
|
outbin = "/sdcard/firmware";
|
||||||
|
|
||||||
|
retfirmware = unzip_new(_file_name_update, out+"/", outbin+"/");
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Files unzipped.");
|
||||||
|
|
||||||
|
if (retfirmware.length() > 0)
|
||||||
|
{
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Found firmware.bin");
|
||||||
|
ota_update_task(retfirmware);
|
||||||
|
}
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Trigger reboot due to firmware update.");
|
||||||
|
doReboot();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Only ZIP-Files support for update during startup!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CheckUpdate()
|
||||||
|
{
|
||||||
|
FILE *pfile;
|
||||||
|
if ((pfile = fopen("/sdcard/update.txt", "r")) == NULL)
|
||||||
|
{
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "No update triggered.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
char zw[1024] = "";
|
||||||
|
fgets(zw, 1024, pfile);
|
||||||
|
_file_name_update = std::string(zw);
|
||||||
|
fclose(pfile);
|
||||||
|
DeleteFile("/sdcard/update.txt"); // Prevent Boot Loop!!!
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Update during boot triggered - Update File: " + _file_name_update);
|
||||||
|
|
||||||
|
|
||||||
|
BaseType_t xReturned;
|
||||||
|
int _i = configMINIMAL_STACK_SIZE;
|
||||||
|
xReturned = xTaskCreate(&task_do_Update_ZIP, "task_do_Update_ZIP", configMINIMAL_STACK_SIZE * 35, NULL, tskIDLE_PRIORITY+1, NULL);
|
||||||
|
TickType_t xDelay;
|
||||||
|
xDelay = 2000000 / portTICK_PERIOD_MS;
|
||||||
|
ESP_LOGD(TAG, "Wait for Update to be finished: sleep for: %ldms", (long) xDelay);
|
||||||
|
vTaskDelay( xDelay );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void infinite_loop(void)
|
static void infinite_loop(void)
|
||||||
{
|
{
|
||||||
@@ -373,6 +435,21 @@ esp_err_t handler_ota_update(httpd_req_t *req)
|
|||||||
|
|
||||||
if (filetype == "ZIP")
|
if (filetype == "ZIP")
|
||||||
{
|
{
|
||||||
|
FILE *pfile;
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Update for reboot.");
|
||||||
|
pfile = fopen("/sdcard/update.txt", "w");
|
||||||
|
fwrite(fn.c_str(), fn.length(), 1, pfile);
|
||||||
|
fclose(pfile);
|
||||||
|
|
||||||
|
std::string zw = "reboot\n";
|
||||||
|
httpd_resp_sendstr_chunk(req, zw.c_str());
|
||||||
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
|
ESP_LOGD(TAG, "Send reboot");
|
||||||
|
return ESP_OK;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
std::string in, out, outbin, zw, retfirmware;
|
std::string in, out, outbin, zw, retfirmware;
|
||||||
|
|
||||||
out = "/sdcard/html";
|
out = "/sdcard/html";
|
||||||
@@ -392,6 +469,7 @@ esp_err_t handler_ota_update(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -537,7 +615,7 @@ esp_err_t handler_reboot(httpd_req_t *req)
|
|||||||
|
|
||||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "handler_reboot");
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "handler_reboot");
|
||||||
ESP_LOGI(TAG, "!!! System will restart within 5 sec!!!");
|
ESP_LOGI(TAG, "!!! System will restart within 5 sec!!!");
|
||||||
const char* resp_str = "<body style='font-family: arial'> <h3 id=t></h3></body><script>var h='Rebooting!<br>The page will automatically reload in around 25..60s.<br>'; document.getElementById('t').innerHTML=h; setInterval(function (){h +='.'; document.getElementById('t').innerHTML=h; fetch(window.location.hostname,{mode: 'no-cors'}).then(r=>{parent.location.href=('/index.html');})}, 1000);</script>";
|
const char* resp_str = "<body style='font-family: arial'> <h3 id=t></h3></body><script>var h='Rebooting!<br>The page will automatically reload in around 25..60s<br>(in case of a firmware update it can take up to 180s).<br>'; document.getElementById('t').innerHTML=h; setInterval(function (){h +='.'; document.getElementById('t').innerHTML=h; fetch(window.location.hostname,{mode: 'no-cors'}).then(r=>{parent.location.href=('/index.html');})}, 1000);</script>";
|
||||||
httpd_resp_send(req, resp_str, strlen(resp_str));
|
httpd_resp_send(req, resp_str, strlen(resp_str));
|
||||||
|
|
||||||
doReboot();
|
doReboot();
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
#include <esp_http_server.h>
|
#include <esp_http_server.h>
|
||||||
|
|
||||||
//#include "ClassControllCamera.h"
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
void register_server_ota_sdcard_uri(httpd_handle_t server);
|
void register_server_ota_sdcard_uri(httpd_handle_t server);
|
||||||
void CheckOTAUpdate();
|
void CheckOTAUpdate();
|
||||||
void doReboot();
|
void doReboot();
|
||||||
void hard_restart();
|
void hard_restart();
|
||||||
|
void CheckUpdate();
|
||||||
|
static bool ota_update_task(std::string fn);
|
||||||
@@ -39,7 +39,12 @@ set(VERSION "const char* GIT_REV=\"${GIT_REV}${GIT_DIFF}\";
|
|||||||
const char* GIT_TAG=\"${GIT_TAG}\";
|
const char* GIT_TAG=\"${GIT_TAG}\";
|
||||||
const char* GIT_BRANCH=\"${GIT_BRANCH}\";
|
const char* GIT_BRANCH=\"${GIT_BRANCH}\";
|
||||||
const char* BUILD_TIME=\"${BUILD_TIME}\";")
|
const char* BUILD_TIME=\"${BUILD_TIME}\";")
|
||||||
set(VERSION_HTML "${GIT_BRANCH}, ${GIT_TAG}, ${GIT_REV}${GIT_DIFF}")
|
|
||||||
|
if ("${GIT_TAG}" STREQUAL "") # Tag not set, show branch
|
||||||
|
set(VERSION_HTML "Development-Branch: ${GIT_BRANCH} (Commit: ${GIT_REV}${GIT_DIFF})")
|
||||||
|
else() # Tag is set, ignore branch
|
||||||
|
set(VERSION_HTML "Release: ${GIT_TAG} (Commit: ${GIT_REV}${GIT_DIFF})")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp)
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp)
|
||||||
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp VERSION_)
|
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp VERSION_)
|
||||||
|
|||||||
@@ -174,9 +174,12 @@ extern "C" void app_main(void)
|
|||||||
ESP_LOGD(TAG, "=============================================================================================");
|
ESP_LOGD(TAG, "=============================================================================================");
|
||||||
ESP_LOGD(TAG, "Reset reason: %s", getResetReason().c_str());
|
ESP_LOGD(TAG, "Reset reason: %s", getResetReason().c_str());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CheckOTAUpdate();
|
CheckOTAUpdate();
|
||||||
|
|
||||||
LogFile.CreateLogDirectories();
|
LogFile.CreateLogDirectories();
|
||||||
|
CheckUpdate();
|
||||||
/*
|
/*
|
||||||
int mk_ret = mkdir("/sdcard/new_fd_mkdir", 0775);
|
int mk_ret = mkdir("/sdcard/new_fd_mkdir", 0775);
|
||||||
ESP_LOGI(TAG, "mkdir ret %d", mk_ret);
|
ESP_LOGI(TAG, "mkdir ret %d", mk_ret);
|
||||||
|
|||||||
@@ -58,50 +58,45 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("GitTag") == 0)
|
||||||
|
|
||||||
if (_task.compare("GitTag") == 0)
|
|
||||||
{
|
{
|
||||||
httpd_resp_sendstr_chunk(req, libfive_git_version());
|
httpd_resp_sendstr_chunk(req, libfive_git_version());
|
||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("GitRevision") == 0)
|
||||||
|
|
||||||
|
|
||||||
if (_task.compare("GitRevision") == 0)
|
|
||||||
{
|
{
|
||||||
httpd_resp_sendstr_chunk(req, libfive_git_revision());
|
httpd_resp_sendstr_chunk(req, libfive_git_revision());
|
||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("BuildTime") == 0)
|
||||||
if (_task.compare("BuildTime") == 0)
|
|
||||||
{
|
{
|
||||||
httpd_resp_sendstr_chunk(req, build_time());
|
httpd_resp_sendstr_chunk(req, build_time());
|
||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("FirmwareVersion") == 0)
|
||||||
if (_task.compare("GitBaseBranch") == 0)
|
|
||||||
{
|
{
|
||||||
string buf = "Branch: '" + std::string(GIT_BRANCH) + "', Tag: '" + std::string(GIT_TAG) + \
|
string buf;
|
||||||
"', Revision: " + std::string(GIT_REV);
|
if (std::string(GIT_TAG) == "") { // Tag not set, show branch
|
||||||
|
buf = "Development-Branch: " + std::string(GIT_BRANCH);
|
||||||
|
}
|
||||||
|
else { // Tag is set, ignore branch
|
||||||
|
buf = "Release: " + std::string(GIT_TAG);
|
||||||
|
}
|
||||||
|
buf = buf + " (Commit: " + std::string(GIT_REV) + ")";
|
||||||
httpd_resp_sendstr_chunk(req, buf.c_str());
|
httpd_resp_sendstr_chunk(req, buf.c_str());
|
||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("HTMLVersion") == 0)
|
||||||
if (_task.compare("HTMLVersion") == 0)
|
|
||||||
{
|
{
|
||||||
// std::string zw;
|
|
||||||
// zw = std::string(getHTMLversion());
|
|
||||||
httpd_resp_sendstr_chunk(req, getHTMLversion());
|
httpd_resp_sendstr_chunk(req, getHTMLversion());
|
||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("Hostname") == 0)
|
||||||
if (_task.compare("Hostname") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = std::string(hostname);
|
zw = std::string(hostname);
|
||||||
@@ -109,8 +104,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("IP") == 0)
|
||||||
if (_task.compare("IP") == 0)
|
|
||||||
{
|
{
|
||||||
std::string *zw;
|
std::string *zw;
|
||||||
zw = getIPAddress();
|
zw = getIPAddress();
|
||||||
@@ -118,8 +112,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("SSID") == 0)
|
||||||
if (_task.compare("SSID") == 0)
|
|
||||||
{
|
{
|
||||||
std::string *zw;
|
std::string *zw;
|
||||||
zw = getSSID();
|
zw = getSSID();
|
||||||
@@ -127,8 +120,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("FlowStatus") == 0)
|
||||||
if (_task.compare("FlowStatus") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = std::string("FlowStatus");
|
zw = std::string("FlowStatus");
|
||||||
@@ -136,8 +128,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("SDCardPartitionSize") == 0)
|
||||||
if (_task.compare("SDCardPartitionSize") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = getSDCardPartitionSize();
|
zw = getSDCardPartitionSize();
|
||||||
@@ -145,8 +136,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("SDCardFreePartitionSpace") == 0)
|
||||||
if (_task.compare("SDCardFreePartitionSpace") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = getSDCardFreePartitionSpace();
|
zw = getSDCardFreePartitionSpace();
|
||||||
@@ -154,8 +144,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("SDCardPartitionAllocationSize") == 0)
|
||||||
if (_task.compare("SDCardPartitionAllocationSize") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = getSDCardPartitionAllocationSize();
|
zw = getSDCardPartitionAllocationSize();
|
||||||
@@ -163,8 +152,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("SDCardManufacturer") == 0)
|
||||||
if (_task.compare("SDCardManufacturer") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = getSDCardManufacturer();
|
zw = getSDCardManufacturer();
|
||||||
@@ -172,8 +160,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("SDCardName") == 0)
|
||||||
if (_task.compare("SDCardName") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = getSDCardName();
|
zw = getSDCardName();
|
||||||
@@ -181,8 +168,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("SDCardCapacity") == 0)
|
||||||
if (_task.compare("SDCardCapacity") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = getSDCardCapacity();
|
zw = getSDCardCapacity();
|
||||||
@@ -190,8 +176,7 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
httpd_resp_sendstr_chunk(req, NULL);
|
httpd_resp_sendstr_chunk(req, NULL);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
else if (_task.compare("SDCardSectorSize") == 0)
|
||||||
if (_task.compare("SDCardSectorSize") == 0)
|
|
||||||
{
|
{
|
||||||
std::string zw;
|
std::string zw;
|
||||||
zw = getSDCardSectorSize();
|
zw = getSDCardSectorSize();
|
||||||
@@ -200,8 +185,6 @@ esp_err_t info_get_handler(httpd_req_t *req)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +377,7 @@ esp_err_t sysinfo_handler(httpd_req_t *req)
|
|||||||
void register_server_main_uri(httpd_handle_t server, const char *base_path)
|
void register_server_main_uri(httpd_handle_t server, const char *base_path)
|
||||||
{
|
{
|
||||||
httpd_uri_t info_get_handle = {
|
httpd_uri_t info_get_handle = {
|
||||||
.uri = "/version", // Match all URIs of type /path/to/file
|
.uri = "/info", // Match all URIs of type /path/to/file
|
||||||
.method = HTTP_GET,
|
.method = HTTP_GET,
|
||||||
.handler = info_get_handler,
|
.handler = info_get_handler,
|
||||||
.user_ctx = (void*) base_path // Pass server data as context
|
.user_ctx = (void*) base_path // Pass server data as context
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const char* libfive_git_branch(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char _char_getHTMLversion[50]="NaN\0";
|
char _char_getHTMLversion[100]="?\0";
|
||||||
|
|
||||||
const char* getHTMLversion(void){
|
const char* getHTMLversion(void){
|
||||||
FILE* pFile;
|
FILE* pFile;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ function doBackup() {
|
|||||||
// Get hostname
|
// Get hostname
|
||||||
try {
|
try {
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
xhttp.open("GET", "/version?type=Hostname", false);
|
xhttp.open("GET", "/info?type=Hostname", false);
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
hostname = xhttp.responseText;
|
hostname = xhttp.responseText;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function LoadHostname() {
|
|||||||
|
|
||||||
// var xhttp = new XMLHttpRequest();
|
// var xhttp = new XMLHttpRequest();
|
||||||
try {
|
try {
|
||||||
url = _basepath + '/version?type=Hostname';
|
url = _basepath + '/info?type=Hostname';
|
||||||
xhttp.open("GET", url, true);
|
xhttp.open("GET", url, true);
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ function LoadFwVersion() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
url = _basepath + '/version?type=GitBaseBranch';
|
url = _basepath + '/info?type=FirmwareVersion';
|
||||||
xhttp.open("GET", url, true);
|
xhttp.open("GET", url, true);
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ function LoadWebUiVersion() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
url = _basepath + '/version?type=HTMLVersion';
|
url = _basepath + '/info?type=HTMLVersion';
|
||||||
xhttp.open("GET", url, true);
|
xhttp.open("GET", url, true);
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,20 +25,55 @@ div {
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="font-family: arial; padding: 0px 10px;">
|
<body style="font-family: arial; padding: 0px 10px;">
|
||||||
<h3>Current</h3>
|
<h3>Runtime Information</h3>
|
||||||
<table style="font-family: arial">
|
<table style="font-family: arial">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
Last restart:
|
Last restart:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="gitbranch">
|
<div id="starttime">
|
||||||
<object data="/starttime"></object>
|
<object data="/starttime"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<h3>Build Info</h3>
|
||||||
|
<table style="font-family: arial">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Firmware Version:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div id="firmware" style="width: 700px">
|
||||||
|
<object data="/info?type=FirmwareVersion" style="width: 700px"></object>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Firmware Build Time:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div id="build-time">
|
||||||
|
<object data="/info?type=BuildTime"></object>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Web Interface Version:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div id="web-ui" style="width: 700px">
|
||||||
|
<object data="/info?type=HTMLVersion" style="width: 700px"></object>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
<h3>Host Info</h3>
|
<h3>Host Info</h3>
|
||||||
<table style="font-family: arial">
|
<table style="font-family: arial">
|
||||||
@@ -47,8 +82,8 @@ div {
|
|||||||
Hostname:
|
Hostname:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="gitbranch">
|
<div id="Hostname">
|
||||||
<object data="/version?type=Hostname"></object>
|
<object data="/info?type=Hostname"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -57,8 +92,8 @@ div {
|
|||||||
IP-Address:
|
IP-Address:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="gitbranch">
|
<div id="IP">
|
||||||
<object data="/version?type=IP"></object>
|
<object data="/info?type=IP"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -67,66 +102,8 @@ div {
|
|||||||
WLan-SSID:
|
WLan-SSID:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="gitbranch">
|
<div id="SSID">
|
||||||
<object data="/version?type=SSID"></object>
|
<object data="/info?type=SSID"></object>
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h3>Version Info</h3>
|
|
||||||
<table style="font-family: arial">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
Git-Branch:
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div id="gitbranch">
|
|
||||||
<object data="/version?type=GitBranch"></object>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
Git-Tag:
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div>
|
|
||||||
<object data="/version?type=GitTag"></object>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
Git-Revision:
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div>
|
|
||||||
<object data="/version?type=GitRevision"></object>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
Build Time:
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div>
|
|
||||||
<object data="/version?type=BuildTime"></object>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
HTML Version:
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div>
|
|
||||||
<object data="/version?type=HTMLVersion"></object>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -140,7 +117,7 @@ div {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="SDCardManufacturer">
|
<div id="SDCardManufacturer">
|
||||||
<object data="/version?type=SDCardManufacturer"></object>
|
<object data="/info?type=SDCardManufacturer"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -150,7 +127,7 @@ div {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="SDCardName">
|
<div id="SDCardName">
|
||||||
<object data="/version?type=SDCardName"></object>
|
<object data="/info?type=SDCardName"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -160,7 +137,7 @@ div {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="SDCardCapacity">
|
<div id="SDCardCapacity">
|
||||||
<object data="/version?type=SDCardCapacity"></object>
|
<object data="/info?type=SDCardCapacity"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -170,7 +147,7 @@ div {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="SDCardSectorSize">
|
<div id="SDCardSectorSize">
|
||||||
<object data="/version?type=SDCardSectorSize"></object>
|
<object data="/info?type=SDCardSectorSize"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -180,7 +157,7 @@ div {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="SDPartitionSize">
|
<div id="SDPartitionSize">
|
||||||
<object data="/version?type=SDCardPartitionSize"></object>
|
<object data="/info?type=SDCardPartitionSize"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -190,7 +167,7 @@ div {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="SDFreePartitionSpace">
|
<div id="SDFreePartitionSpace">
|
||||||
<object data="/version?type=SDCardFreePartitionSpace"></object>
|
<object data="/info?type=SDCardFreePartitionSpace"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -200,7 +177,7 @@ div {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="SDCardPartitionAllocationSize">
|
<div id="SDCardPartitionAllocationSize">
|
||||||
<object data="/version?type=SDCardPartitionAllocationSize"></object>
|
<object data="/info?type=SDCardPartitionAllocationSize"></object>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ function init(){
|
|||||||
|
|
||||||
|
|
||||||
function doRebootAfterUpdate() {
|
function doRebootAfterUpdate() {
|
||||||
if (confirm("Update completed!\nThe ESP32 will reboot now!")) {
|
if (confirm("Upload completed!\nThe device will reboot now and complete the update.\nThis will take up to 180s!")) {
|
||||||
var stringota = "/reboot";
|
var stringota = "/reboot";
|
||||||
window.location = stringota;
|
window.location = stringota;
|
||||||
window.location.href = stringota;
|
window.location.href = stringota;
|
||||||
@@ -132,7 +132,7 @@ function prepareOnServer() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("status").innerText = "Status: Preparations on ESP32";
|
document.getElementById("status").innerText = "Status: Preparations on device";
|
||||||
document.getElementById("doUpdate").disabled = true;
|
document.getElementById("doUpdate").disabled = true;
|
||||||
|
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
@@ -199,7 +199,7 @@ function upload() {
|
|||||||
|
|
||||||
|
|
||||||
function extract() {
|
function extract() {
|
||||||
document.getElementById("status").innerText = "Status: Processing on ESP32 (takes up to 3 minutes)...";
|
document.getElementById("status").innerText = "Status: Processing on device (takes up to 3 minutes)...";
|
||||||
|
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
/* first delete the old firmware */
|
/* first delete the old firmware */
|
||||||
@@ -210,6 +210,7 @@ function extract() {
|
|||||||
document.getElementById("status").innerText = "Status: Update completed!";
|
document.getElementById("status").innerText = "Status: Update completed!";
|
||||||
document.getElementById("doUpdate").disabled = true;
|
document.getElementById("doUpdate").disabled = true;
|
||||||
document.getElementById("newfile").disabled = false;
|
document.getElementById("newfile").disabled = false;
|
||||||
|
document.cookie = "overview.html"; // Make sure after the reboot we go to the overview page
|
||||||
|
|
||||||
if (xhttp.responseText.startsWith("reboot"))
|
if (xhttp.responseText.startsWith("reboot"))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user