Skip to content

Commit 83b110e

Browse files
Merge branch 'main' into add-esp32-s3-support
2 parents 2464d02 + b72d809 commit 83b110e

File tree

23 files changed

+380
-132
lines changed

23 files changed

+380
-132
lines changed

Changelog.md

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## [16.0.0-RC6] - 2024-xx-xx
2+
3+
For a full list of changes see [Full list of changes](https://github.com/jomjol/AI-on-the-edge-device/compare/v15.7.0...v16.0.0)
4+
5+
#### Known issues
6+
Please check the [issues](https://github.com/jomjol/AI-on-the-edge-device/issues) and
7+
[discussions](https://github.com/jomjol/AI-on-the-edge-device/discussions) before reporting a new issue.
8+
9+
#### Core Changes
10+
Only changes since RC5 are listed:
11+
- [#3436](https://github.com/jomjol/AI-on-the-edge-device/pull/3436) Added basic authentification of the Web Interface and the REST API, see https://jomjol.github.io/AI-on-the-edge-device-docs/Password-Protection
12+
- xxx
13+
14+
**:warning: Please check your Homeassistant instance to make sure it is handled correctly!**
15+
16+
#### Bug Fixes
17+
Only changes since RC5 are listed:
18+
- xxx
19+
120
## [16.0.0-RC5] - 2024-12-05
221

322
For a full list of changes see [Full list of changes](https://github.com/jomjol/AI-on-the-edge-device/compare/v15.7.0...v16.0.0)
@@ -8,25 +27,25 @@ Please check the [issues](https://github.com/jomjol/AI-on-the-edge-device/issues
827

928
#### Core Changes
1029
Only changes since RC4 are listed:
11-
- Removed `Autostart` parameter and make the flow to be always enabled (#3423)
12-
- Enable `Flow start` menu entry in UI (#3423)
13-
- Updated the Homeassistant Discovery topics (#3332):
30+
- [#3423](https://github.com/jomjol/AI-on-the-edge-device/pull/3423) Removed `Autostart` parameter and make the flow to be always enabled
31+
- [#3423](https://github.com/jomjol/AI-on-the-edge-device/pull/3423) Enable `Flow start` menu entry in UI
32+
- [#3332](https://github.com/jomjol/AI-on-the-edge-device/pull/3332) Updated the Homeassistant Discovery topics :
1433
- `raw` has now set the `State Class` to `measurement`. Before it was always set to `""`.
1534
- `value` has now only set the `State Class` to `total_increasing` if the parameter `Allow Negative Rates` is **not** set. Else it uses `measurement` since the rate could also be negative. Before it was always set to `total_increasing`.
1635
- The `rate_per_time_unit` topic of an **Energy** meter needs a `Device Class`=`power`. For `gas` and `water` it should be `volume_flow_rate`. Before it was always set to `""`.
17-
- Added button for `flow start` (#3415)
18-
- Added support for Domoticz MQTT integration (#3359)
36+
- [#3415](https://github.com/jomjol/AI-on-the-edge-device/pull/3415) Added button for `flow start`
37+
- [#3359](https://github.com/jomjol/AI-on-the-edge-device/pull/3359) Added support for Domoticz MQTT integration
1938
- Added Date and time to overview page
2039
- Updated submodules and models
2140

2241
**:warning: Please check your Homeassistant instance to make sure it is handled correctly!**
2342

2443
#### Bug Fixes
25-
Only changes since RC3 are listed:
26-
- Added fix for ledintensity (#3418)
27-
- Added fix for OV2640 brightness contrast saturation (#3417)
28-
- Added fix for 'AnalogToDigitTransitionStart' always using 9.2 regardless of the configured value (#3393)
29-
- Addef fix for HA menu entry (#3342)
44+
Only changes since RC4 are listed:
45+
- [#3418](https://github.com/jomjol/AI-on-the-edge-device/pull/3418) Added fix for ledintensity
46+
- [#3417](https://github.com/jomjol/AI-on-the-edge-device/pull/3417) Added fix for OV2640 brightness contrast saturation
47+
- [#3393](https://github.com/jomjol/AI-on-the-edge-device/pull/3393) Added fix for 'AnalogToDigitTransitionStart' always using 9.2 regardless of the configured value
48+
- [#3342](https://github.com/jomjol/AI-on-the-edge-device/pull/3342) Added fix for HA menu entry
3049

3150

3251
## [16.0.0-RC4] - 2024-10-06
@@ -39,13 +58,13 @@ Please check the [issues](https://github.com/jomjol/AI-on-the-edge-device/issues
3958

4059
#### Core Changes
4160
Only changes since RC3 are listed:
42-
- Update esp32-camera submodule to `v2.0.13` (#3316)
43-
- Added contributor list (#3317)
44-
- Added files for demo mode (#3315)
61+
- [#3316](https://github.com/jomjol/AI-on-the-edge-device/pull/3316) Update esp32-camera submodule to `v2.0.13`
62+
- [#3317](https://github.com/jomjol/AI-on-the-edge-device/pull/3317) Added contributor list
63+
- [#3315](https://github.com/jomjol/AI-on-the-edge-device/pull/3315) Added files for demo mode
4564

4665
#### Bug Fixes
4766
Only changes since RC2 are listed:
48-
- Added delay in InitCam (#3313) to fix `Camera not detected` issues
67+
- [#3313](https://github.com/jomjol/AI-on-the-edge-device/pull/3313) Added delay in InitCam to fix `Camera not detected` issues
4968

5069

5170
## [16.0.0-RC3] - 2024-10-05
@@ -62,7 +81,7 @@ Only changes since RC2 are listed:
6281

6382
#### Bug Fixes
6483
Only changes since RC2 are listed:
65-
- Re-did revertion of TFlite submodule update as certain modules crash with it (#3269) (change was lost)
84+
- [#3269](https://github.com/jomjol/AI-on-the-edge-device/pull/3269) Re-did revertion of TFlite submodule update as certain modules crash with it (change was lost)
6685

6786

6887
## [16.0.0-RC2] - 2024-10-04
@@ -76,13 +95,13 @@ Please check the [issues](https://github.com/jomjol/AI-on-the-edge-device/issues
7695
#### Core Changes
7796
Only changes since RC1 are listed:
7897
- Updated parameter documentation pages
79-
- Rename/remove unused parameters (#3291)
80-
- Migrate-cam-parameters (#3288)
98+
- [#3291](https://github.com/jomjol/AI-on-the-edge-device/pull/3291) Rename/remove unused parameters
99+
- [#3288](https://github.com/jomjol/AI-on-the-edge-device/pull/3288) Migrate-cam-parameters
81100

82101
#### Bug Fixes
83102
Only changes since RC1 are listed:
84-
- Reverted TFlite submodule update as certain modules crash with it (#3269)
85-
- Changed the webhook UploadImg to false (#3279)
103+
- [#3269](https://github.com/jomjol/AI-on-the-edge-device/pull/3269) Reverted TFlite submodule update as certain modules crash with it
104+
- [#3279](https://github.com/jomjol/AI-on-the-edge-device/pull/3279) Changed the webhook UploadImg to false
86105
- Changed default value from boolean to numeric value in parameter camDenoise documentation
87106
- Updated config page
88107

@@ -96,24 +115,24 @@ Please check the [issues](https://github.com/jomjol/AI-on-the-edge-device/issues
96115

97116
#### Core Changes
98117
Those are just the major changes:
99-
- Add support for OV5640 camera (#3063)
118+
- [#3063](https://github.com/jomjol/AI-on-the-edge-device/pull/3063) Add support for OV5640 camera
100119
- New tflite-Models
101-
- Homeassistant service discovery: derive node_id when using nested topics (#3088)
102-
- Added Prometheus/OpenMetrics exporter (#3081)
103-
- Added Webhook (#3148, #3163, #3174)
104-
- Add rate threshold parameter (#3195)
105-
- Added a Delay between the WiFi reconnections (#3068)
120+
- [#3088](https://github.com/jomjol/AI-on-the-edge-device/pull/3088) Homeassistant service discovery: derive node_id when using nested topics
121+
- [#3081](https://github.com/jomjol/AI-on-the-edge-device/pull/3081) Added Prometheus/OpenMetrics exporter
122+
- [#3148](https://github.com/jomjol/AI-on-the-edge-device/pull/3148), [#3163](https://github.com/jomjol/AI-on-the-edge-device/pull/3163), [#3174](https://github.com/jomjol/AI-on-the-edge-device/pull/3148), [#3163](https://github.com/jomjol/AI-on-the-edge-device/pull/3163), [#3174](https://github.com/jomjol/AI-on-the-edge-device/pull/3174) Added Webhook
123+
- [#3195](https://github.com/jomjol/AI-on-the-edge-device/pull/3195) Add rate threshold parameter
124+
- [#3068](https://github.com/jomjol/AI-on-the-edge-device/pull/3068) Added a Delay between the WiFi reconnections
106125
- Web UI improvements
107126
- Various minor changes
108127
- Update platformIO to 6.9.0 (Contains ESP IDF 5.3.1)
109128

110129
#### Bug Fixes
111130
Those are just the major changes:
112-
- Handle crash on corrupted model (#3220)
113-
- Bugfix for boot loop (#3175)
114-
- Bugfix for time stamp (#3180)
115-
- Handle empty prevalue.ini gracefully (#3162)
116-
- Added note about only TLS 1.2 is supported (#3213)
131+
- [#3220](https://github.com/jomjol/AI-on-the-edge-device/pull/3220) Handle crash on corrupted model
132+
- [#3175](https://github.com/jomjol/AI-on-the-edge-device/pull/3175) Bugfix for boot loop
133+
- [#3180](https://github.com/jomjol/AI-on-the-edge-device/pull/3180) Bugfix for time stamp
134+
- [#3162](https://github.com/jomjol/AI-on-the-edge-device/pull/3162) Handle empty prevalue.ini gracefully
135+
- [#3213](https://github.com/jomjol/AI-on-the-edge-device/pull/3213) Added note about only TLS 1.2 is supported
117136

118137
## [15.7.0] - 2024-02-17
119138

code/components/jomjol_controlGPIO/server_GPIO.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "server_mqtt.h"
2626
#endif //ENABLE_MQTT
2727

28+
#include "basic_auth.h"
2829

2930
static const char *TAG = "GPIO";
3031
QueueHandle_t gpio_queue_handle = NULL;
@@ -458,7 +459,7 @@ void GpioHandler::registerGpioUri()
458459
httpd_uri_t camuri = { };
459460
camuri.method = HTTP_GET;
460461
camuri.uri = "/GPIO";
461-
camuri.handler = callHandleHttpRequest;
462+
camuri.handler = APPLY_BASIC_AUTH_FILTER(callHandleHttpRequest);
462463
camuri.user_ctx = (void*)this;
463464
httpd_register_uri_handler(_httpServer, &camuri);
464465
}

code/components/jomjol_controlcamera/server_camera.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "ClassLogFile.h"
1111
#include "esp_log.h"
1212

13+
#include "basic_auth.h"
14+
1315
#include "../../include/defines.h"
1416

1517
static const char *TAG = "server_cam";
@@ -280,27 +282,27 @@ void register_server_camera_uri(httpd_handle_t server)
280282
camuri.method = HTTP_GET;
281283

282284
camuri.uri = "/lighton";
283-
camuri.handler = handler_lightOn;
285+
camuri.handler = APPLY_BASIC_AUTH_FILTER(handler_lightOn);
284286
camuri.user_ctx = (void *)"Light On";
285287
httpd_register_uri_handler(server, &camuri);
286288

287289
camuri.uri = "/lightoff";
288-
camuri.handler = handler_lightOff;
290+
camuri.handler = APPLY_BASIC_AUTH_FILTER(handler_lightOff);
289291
camuri.user_ctx = (void *)"Light Off";
290292
httpd_register_uri_handler(server, &camuri);
291293

292294
camuri.uri = "/capture";
293-
camuri.handler = handler_capture;
295+
camuri.handler = APPLY_BASIC_AUTH_FILTER(handler_capture);
294296
camuri.user_ctx = NULL;
295297
httpd_register_uri_handler(server, &camuri);
296298

297299
camuri.uri = "/capture_with_flashlight";
298-
camuri.handler = handler_capture_with_light;
300+
camuri.handler = APPLY_BASIC_AUTH_FILTER(handler_capture_with_light);
299301
camuri.user_ctx = NULL;
300302
httpd_register_uri_handler(server, &camuri);
301303

302304
camuri.uri = "/save";
303-
camuri.handler = handler_capture_save_to_file;
305+
camuri.handler = APPLY_BASIC_AUTH_FILTER(handler_capture_save_to_file);
304306
camuri.user_ctx = NULL;
305307
httpd_register_uri_handler(server, &camuri);
306308
}

code/components/jomjol_fileserver_ota/server_file.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ extern "C" {
4646

4747
#include "Helper.h"
4848
#include "miniz.h"
49+
#include "basic_auth.h"
4950

5051
static const char *TAG = "OTA FILE";
5152

@@ -1174,7 +1175,7 @@ void register_server_file_uri(httpd_handle_t server, const char *base_path)
11741175
httpd_uri_t file_download = {
11751176
.uri = "/fileserver*", // Match all URIs of type /path/to/file
11761177
.method = HTTP_GET,
1177-
.handler = download_get_handler,
1178+
.handler = APPLY_BASIC_AUTH_FILTER(download_get_handler),
11781179
.user_ctx = server_data // Pass server data as context
11791180
};
11801181
httpd_register_uri_handler(server, &file_download);
@@ -1183,7 +1184,7 @@ void register_server_file_uri(httpd_handle_t server, const char *base_path)
11831184
httpd_uri_t file_datafileact = {
11841185
.uri = "/datafileact", // Match all URIs of type /path/to/file
11851186
.method = HTTP_GET,
1186-
.handler = datafileact_get_full_handler,
1187+
.handler = APPLY_BASIC_AUTH_FILTER(datafileact_get_full_handler),
11871188
.user_ctx = server_data // Pass server data as context
11881189
};
11891190
httpd_register_uri_handler(server, &file_datafileact);
@@ -1192,15 +1193,15 @@ void register_server_file_uri(httpd_handle_t server, const char *base_path)
11921193
httpd_uri_t file_datafile_last_part_handle = {
11931194
.uri = "/data", // Match all URIs of type /path/to/file
11941195
.method = HTTP_GET,
1195-
.handler = datafileact_get_last_part_handler,
1196+
.handler = APPLY_BASIC_AUTH_FILTER(datafileact_get_last_part_handler),
11961197
.user_ctx = server_data // Pass server data as context
11971198
};
11981199
httpd_register_uri_handler(server, &file_datafile_last_part_handle);
11991200

12001201
httpd_uri_t file_logfileact = {
12011202
.uri = "/logfileact", // Match all URIs of type /path/to/file
12021203
.method = HTTP_GET,
1203-
.handler = logfileact_get_full_handler,
1204+
.handler = APPLY_BASIC_AUTH_FILTER(logfileact_get_full_handler),
12041205
.user_ctx = server_data // Pass server data as context
12051206
};
12061207
httpd_register_uri_handler(server, &file_logfileact);
@@ -1209,7 +1210,7 @@ void register_server_file_uri(httpd_handle_t server, const char *base_path)
12091210
httpd_uri_t file_logfile_last_part_handle = {
12101211
.uri = "/log", // Match all URIs of type /path/to/file
12111212
.method = HTTP_GET,
1212-
.handler = logfileact_get_last_part_handler,
1213+
.handler = APPLY_BASIC_AUTH_FILTER(logfileact_get_last_part_handler),
12131214
.user_ctx = server_data // Pass server data as context
12141215
};
12151216
httpd_register_uri_handler(server, &file_logfile_last_part_handle);
@@ -1219,7 +1220,7 @@ void register_server_file_uri(httpd_handle_t server, const char *base_path)
12191220
httpd_uri_t file_upload = {
12201221
.uri = "/upload/*", // Match all URIs of type /upload/path/to/file
12211222
.method = HTTP_POST,
1222-
.handler = upload_post_handler,
1223+
.handler = APPLY_BASIC_AUTH_FILTER(upload_post_handler),
12231224
.user_ctx = server_data // Pass server data as context
12241225
};
12251226
httpd_register_uri_handler(server, &file_upload);
@@ -1228,7 +1229,7 @@ void register_server_file_uri(httpd_handle_t server, const char *base_path)
12281229
httpd_uri_t file_delete = {
12291230
.uri = "/delete/*", // Match all URIs of type /delete/path/to/file
12301231
.method = HTTP_POST,
1231-
.handler = delete_post_handler,
1232+
.handler = APPLY_BASIC_AUTH_FILTER(delete_post_handler),
12321233
.user_ctx = server_data // Pass server data as context
12331234
};
12341235
httpd_register_uri_handler(server, &file_delete);

code/components/jomjol_fileserver_ota/server_ota.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
#include "Helper.h"
4444
#include "statusled.h"
45+
#include "basic_auth.h"
4546
#include "../../include/defines.h"
4647

4748
/*an ota data write buffer ready to write to the flash*/
@@ -690,13 +691,13 @@ void register_server_ota_sdcard_uri(httpd_handle_t server)
690691
httpd_uri_t camuri = { };
691692
camuri.method = HTTP_GET;
692693
camuri.uri = "/ota";
693-
camuri.handler = handler_ota_update;
694+
camuri.handler = APPLY_BASIC_AUTH_FILTER(handler_ota_update);
694695
camuri.user_ctx = (void*) "Do OTA";
695696
httpd_register_uri_handler(server, &camuri);
696697

697698
camuri.method = HTTP_GET;
698699
camuri.uri = "/reboot";
699-
camuri.handler = handler_reboot;
700+
camuri.handler = APPLY_BASIC_AUTH_FILTER(handler_reboot);
700701
camuri.user_ctx = (void*) "Reboot";
701702
httpd_register_uri_handler(server, &camuri);
702703

code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
6565

6666
if (CNNType == Digit) {
6767
for (int i = 0; i < GENERAL[_analog]->ROI.size(); ++i) {
68-
if (GENERAL[_analog]->ROI[i]->result_klasse >= 10) {
69-
result = result + "N";
68+
if ((GENERAL[_analog]->ROI[i]->result_klasse >= 0) && (GENERAL[_analog]->ROI[i]->result_klasse < 10)) {
69+
result = result + std::to_string(GENERAL[_analog]->ROI[i]->result_klasse);
7070
}
7171
else {
72-
result = result + std::to_string(GENERAL[_analog]->ROI[i]->result_klasse);
72+
result = result + "N";
7373
}
7474
}
7575
return result;
@@ -78,7 +78,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
7878
if ((CNNType == DoubleHyprid10) || (CNNType == Digit100)) {
7979
float number = GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float;
8080
// NaN?
81-
if (number >= 0) {
81+
if ((number >= 0) && (number < 10)) {
8282
// is only set if it is the first digit (no analogue before!)
8383
if (_extendedResolution) {
8484
int result_after_decimal_point = ((int) floor(number * 10)) % 10;
@@ -95,8 +95,15 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
9595
else {
9696
prev = PointerEvalHybridNew(GENERAL[_analog]->ROI[GENERAL[_analog]->ROI.size() - 1]->result_float, prev, prev);
9797
}
98-
result = std::to_string(prev);
99-
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "getReadout(dig100) prev=" + std::to_string(prev));
98+
99+
// is necessary because a number greater than 9.994999 returns a 10! (for further details see check in PointerEvalHybridNew)
100+
if ((prev >= 0) && (prev < 10)) {
101+
result = std::to_string(prev);
102+
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "getReadout(dig100) prev=" + std::to_string(prev));
103+
}
104+
else {
105+
result = "N";
106+
}
100107
}
101108
}
102109
else {
@@ -107,7 +114,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
107114
}
108115

109116
for (int i = GENERAL[_analog]->ROI.size() - 2; i >= 0; --i) {
110-
if (GENERAL[_analog]->ROI[i]->result_float >= 0) {
117+
if ((GENERAL[_analog]->ROI[i]->result_float >= 0) && (GENERAL[_analog]->ROI[i]->result_float < 10)) {
111118
prev = PointerEvalHybridNew(GENERAL[_analog]->ROI[i]->result_float, GENERAL[_analog]->ROI[i+1]->result_float, prev);
112119
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "getReadout#PointerEvalHybridNew()= " + std::to_string(prev));
113120
result = std::to_string(prev) + result;
@@ -117,7 +124,6 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution
117124
prev = -1;
118125
result = "N" + result;
119126
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "getReadout(result_float<0 /'N') result_float=" + std::to_string(GENERAL[_analog]->ROI[i]->result_float));
120-
121127
}
122128
}
123129
return result;
@@ -150,6 +156,9 @@ int ClassFlowCNNGeneral::PointerEvalHybridNew(float number, float number_of_pred
150156
// on first digit is no spezial logic for transition needed
151157
// we use the recognition as given. The result is the int value of the recognition
152158
// add precisition of 2 digits and round before trunc
159+
// a number greater than 9.994999 is returned as 10, this leads to an error during the decimal shift because the NUMBERS[j]->ReturnRawValue is one digit longer.
160+
// To avoid this, an additional test must be carried out, see "if ((CNNType == DoubleHyprid10) || (CNNType == Digit100))" check in getReadout()
161+
// Another alternative would be "result = (int) ((int) trunc(round((number+10 % 10)*1000))) / 1000;", which could, however, lead to other errors?
153162
result = (int) ((int) trunc(round((number+10 % 10)*100)) ) / 100;
154163

155164
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalHybridNew - No predecessor - Result = " + std::to_string(result) +

code/components/jomjol_flowcontroll/ClassFlowControll.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ extern "C" {
2626

2727
#include "server_help.h"
2828
#include "MainFlowControl.h"
29+
#include "basic_auth.h"
2930
#include "../../include/defines.h"
3031

3132
static const char* TAG = "FLOWCTRL";

0 commit comments

Comments
 (0)