mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 20:46:52 +03:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f42e9c71f2 | ||
|
|
00be21f9e1 | ||
|
|
c694d9f363 | ||
|
|
4c407499d2 | ||
|
|
b97d808b54 | ||
|
|
9f2e91a9df | ||
|
|
10e0435383 | ||
|
|
22e4b39f77 | ||
|
|
2c1a7f4c9e | ||
|
|
3960823439 | ||
|
|
d5ef08546a | ||
|
|
3d711f495e | ||
|
|
b21e3c6c9d | ||
|
|
23d2ae627d | ||
|
|
3f62abf878 | ||
|
|
025f4af9f2 | ||
|
|
3d92860c5e | ||
|
|
2ed9fb8eb5 | ||
|
|
598db004ae | ||
|
|
70332fe142 | ||
|
|
10da8c4f94 | ||
|
|
5bac1c68d9 | ||
|
|
008dba7e11 | ||
|
|
7283bfd506 | ||
|
|
56788652ae | ||
|
|
44e186e65b | ||
|
|
55be652dc1 | ||
|
|
1acd72d33e | ||
|
|
795bcd0d21 | ||
|
|
0b2e38935b | ||
|
|
a9c5bebb45 | ||
|
|
876adc51af | ||
|
|
bf090f3762 | ||
|
|
30a50720e5 | ||
|
|
6c891ab7fe | ||
|
|
6adcd90038 | ||
|
|
676b94f57c | ||
|
|
01df45f1e1 | ||
|
|
f7fc55960b | ||
|
|
3dd2b74226 | ||
|
|
3fa16c5624 | ||
|
|
b9134f923e | ||
|
|
06f4d417b5 | ||
|
|
55efc3b3f4 | ||
|
|
800e231301 | ||
|
|
34a3d6d6e3 | ||
|
|
4bfe5422c5 | ||
|
|
d63dc08f33 | ||
|
|
2ee85001eb | ||
|
|
1d2f920819 | ||
|
|
69583db99e |
55
.github/workflows/build.yaml
vendored
55
.github/workflows/build.yaml
vendored
@@ -248,6 +248,8 @@ jobs:
|
|||||||
cp -f "./code/.pio/build/esp32cam/firmware.bin" "manual_setup/firmware.bin"
|
cp -f "./code/.pio/build/esp32cam/firmware.bin" "manual_setup/firmware.bin"
|
||||||
cp -f "./code/.pio/build/esp32cam/bootloader.bin" "manual_setup/bootloader.bin"
|
cp -f "./code/.pio/build/esp32cam/bootloader.bin" "manual_setup/bootloader.bin"
|
||||||
cp -f "./code/.pio/build/esp32cam/partitions.bin" "manual_setup/partitions.bin"
|
cp -f "./code/.pio/build/esp32cam/partitions.bin" "manual_setup/partitions.bin"
|
||||||
|
rm -rf ./sd-card/html
|
||||||
|
cp -r ./html ./sd-card/ # Overwrite the Web UI with the preprocessed files
|
||||||
cd sd-card; zip -r ../manual_setup/sd-card.zip *; cd ..
|
cd sd-card; zip -r ../manual_setup/sd-card.zip *; cd ..
|
||||||
cd ./manual_setup
|
cd ./manual_setup
|
||||||
|
|
||||||
@@ -322,24 +324,23 @@ jobs:
|
|||||||
# extract the version used in next step
|
# extract the version used in next step
|
||||||
- id: get_version
|
- id: get_version
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: battila7/get-version-action@v2
|
uses: Simply007/get-version-action@v2
|
||||||
|
|
||||||
# the changelog [unreleased] will now be changed to the release version
|
# # the changelog [unreleased] will now be changed to the release version
|
||||||
- name: Update changelog
|
# - name: Update changelog
|
||||||
uses: thomaseizinger/keep-a-changelog-new-release@v1
|
# uses: thomaseizinger/keep-a-changelog-new-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
# if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
# with:
|
||||||
changelogPath: Changelog.md
|
# changelogPath: Changelog.md
|
||||||
version: ${{ steps.get_version.outputs.version-without-v }}
|
# version: ${{ steps.get_version.outputs.version-without-v }}
|
||||||
|
|
||||||
# the release notes will be extracted from changelog
|
|
||||||
- name: Extract release notes
|
|
||||||
id: extract-release-notes
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
uses: ffurrer2/extract-release-notes@v1
|
|
||||||
with:
|
|
||||||
changelog_file: Changelog.md
|
|
||||||
|
|
||||||
|
# # the release notes will be extracted from changelog
|
||||||
|
# - name: Extract release notes
|
||||||
|
# id: extract-release-notes
|
||||||
|
# if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
# uses: ffurrer2/extract-release-notes@v1
|
||||||
|
# with:
|
||||||
|
# changelog_file: Changelog.md
|
||||||
|
|
||||||
# Releases should only be created on master by tagging the last commit.
|
# Releases should only be created on master by tagging the last commit.
|
||||||
# all artifacts in firmware folder pushed to the release
|
# all artifacts in firmware folder pushed to the release
|
||||||
@@ -356,15 +357,15 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
release/*
|
release/*
|
||||||
|
|
||||||
# Commit&Push Changelog to master branch. Must be manually merged back to rolling
|
# # Commit&Push Changelog to master branch. Must be manually merged back to rolling
|
||||||
- name: Commit changes and push changes
|
# - name: Commit changes and push changes
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
# if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: |
|
# run: |
|
||||||
git config user.name github-actions
|
# git config user.name github-actions
|
||||||
git config user.email github-actions@github.com
|
# git config user.email github-actions@github.com
|
||||||
git add Changelog.md
|
# git add Changelog.md
|
||||||
git commit Changelog.md -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release"
|
# git commit Changelog.md -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release"
|
||||||
git push origin HEAD:master
|
# git push origin HEAD:master
|
||||||
|
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
@@ -390,10 +391,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Get version of last release
|
- name: Get version of last release
|
||||||
id: last_release
|
id: last_release
|
||||||
uses: InsonusK/get-latest-release@v1.0.1
|
uses: mindojo/get-latest-release@0b8ef1434d7468d6bffcc8263baff5c777f72321
|
||||||
with:
|
with:
|
||||||
myToken: ${{ github.token }}
|
myToken: ${{ github.token }}
|
||||||
exclude_types: "release"
|
exclude_types: "draft|prerelease"
|
||||||
view_top: 1
|
view_top: 1
|
||||||
|
|
||||||
- name: Add binary to Web Installer and update manifest
|
- name: Add binary to Web Installer and update manifest
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Get version of last release
|
- name: Get version of last release
|
||||||
id: last_release
|
id: last_release
|
||||||
uses: InsonusK/get-latest-release@v1.0.1
|
uses: mindojo/get-latest-release@0b8ef1434d7468d6bffcc8263baff5c777f72321
|
||||||
with:
|
with:
|
||||||
myToken: ${{ github.token }}
|
myToken: ${{ github.token }}
|
||||||
exclude_types: "release"
|
exclude_types: "draft|prerelease"
|
||||||
view_top: 1
|
view_top: 1
|
||||||
|
|
||||||
- name: Add binary to Web Installer and update manifest
|
- name: Add binary to Web Installer and update manifest
|
||||||
|
|||||||
58
Changelog.md
58
Changelog.md
@@ -1,6 +1,43 @@
|
|||||||
# Changelog
|
## [15.0.3] - 2023-02-28
|
||||||
|
|
||||||
## [Unreleased]
|
**Parameter Migration**
|
||||||
|
|
||||||
|
### Update Procedure
|
||||||
|
|
||||||
|
Update Procedure see [online documentation](https://jomjol.github.io/AI-on-the-edge-device-docs/Installation/#update-ota-over-the-air)
|
||||||
|
|
||||||
|
:bangbang: Afterwards you should force-reload the Web Interface (usually Ctrl-F5 will do it).
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
This release only migrates some parameters, see #2023 for details and a list of all parameter changes.
|
||||||
|
The parameter migration happens automatically on the next startup. No user interaction is required.
|
||||||
|
A backup of the config is stored on the SD-card as `config.bak`.
|
||||||
|
|
||||||
|
Beside of the parameter change and the bugfix listed below, no changes are contained in this release!
|
||||||
|
|
||||||
|
If you want to revert back to `v14` or earlier, you will have to revert the migration changes in `config.ini` manually!
|
||||||
|
|
||||||
|
#### Added
|
||||||
|
|
||||||
|
- n.a.
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
- [#2023](https://github.com/jomjol/AI-on-the-edge-device/pull/2023) Migrated Parameters
|
||||||
|
- Removed old `Topic` parameter, it is not used anymore
|
||||||
|
|
||||||
|
#### Fixed
|
||||||
|
|
||||||
|
- [#2036](https://github.com/jomjol/AI-on-the-edge-device/issues/2036) Fix wrong url-encoding
|
||||||
|
- **NEW v15.0.2:** [#1933](https://github.com/jomjol/AI-on-the-edge-device/issues/1933) Bugfix InfluxDB Timestamp
|
||||||
|
- **NEW v15.0.3:** Re-added lost dropdownbox filling for Postprocessing Individual Parameters
|
||||||
|
|
||||||
|
#### Removed
|
||||||
|
|
||||||
|
- n.a.
|
||||||
|
|
||||||
|
## [14.0.3] - 2023-02-05
|
||||||
|
|
||||||
**Stabilization and Improved User Experience**
|
**Stabilization and Improved User Experience**
|
||||||
|
|
||||||
@@ -150,8 +187,8 @@ Improve **u**ser e**x**perience
|
|||||||
5. Now you can reboot.
|
5. Now you can reboot.
|
||||||
|
|
||||||
If anything breaks you can try to
|
If anything breaks you can try to
|
||||||
1. Call `http://<IP>/ota?task=update&file=firmware.bin` resp. `http://<IP>/ota?task=update&file=html.zip` if the upload successed but the extraction failed.
|
1\. Call `http://<IP>/ota?task=update&file=firmware.bin` resp. `http://<IP>/ota?task=update&file=html.zip` if the upload successed but the extraction failed.
|
||||||
1. Use the initial_esp32_setup.zip ( <https://github.com/jomjol/AI-on-the-edge-device/wiki/Installation> ) as alternative.
|
1\. Use the initial_esp32_setup.zip ( <https://github.com/jomjol/AI-on-the-edge-device/wiki/Installation> ) as alternative.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
@@ -803,22 +840,15 @@ External Illumination
|
|||||||
|
|
||||||
- Initial Version
|
- Initial Version
|
||||||
|
|
||||||
|
|
||||||
|
[15.0.1]: https://github.com/jomjol/AI-on-the-edge-device/compare/v14.0.3...v15.0.1
|
||||||
|
[14.0.3]: https://github.com/jomjol/AI-on-the-edge-device/compare/v13.0.8...v14.0.3
|
||||||
[13.0.8]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.8
|
[13.0.8]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.8
|
||||||
|
|
||||||
[13.0.7]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.7
|
[13.0.7]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.7
|
||||||
|
|
||||||
[13.0.5]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.5
|
[13.0.5]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.5
|
||||||
|
|
||||||
[13.0.4]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.4
|
[13.0.4]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.4
|
||||||
|
|
||||||
[13.0.1]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.1
|
[13.0.1]: https://github.com/jomjol/AI-on-the-edge-device/compare/v12.0.1...v13.0.1
|
||||||
|
|
||||||
[12.0.1]: https://github.com/jomjol/AI-on-the-edge-device/compare/v11.3.1...v12.0.1
|
[12.0.1]: https://github.com/jomjol/AI-on-the-edge-device/compare/v11.3.1...v12.0.1
|
||||||
|
|
||||||
[11.4.3]: https://github.com/haverland/AI-on-the-edge-device/compare/v10.6.2...v11.4.3
|
[11.4.3]: https://github.com/haverland/AI-on-the-edge-device/compare/v10.6.2...v11.4.3
|
||||||
|
|
||||||
[11.4.2]: https://github.com/haverland/AI-on-the-edge-device/compare/v10.6.2...v11.4.2
|
[11.4.2]: https://github.com/haverland/AI-on-the-edge-device/compare/v10.6.2...v11.4.2
|
||||||
|
|
||||||
[11.3.9]: https://github.com/haverland/AI-on-the-edge-device/compare/v10.6.2...v11.3.9
|
[11.3.9]: https://github.com/haverland/AI-on-the-edge-device/compare/v10.6.2...v11.3.9
|
||||||
|
|
||||||
[Unreleased]: https://github.com/jomjol/AI-on-the-edge-device/compare/v14.0.0-RC8...HEAD
|
|
||||||
@@ -10,6 +10,11 @@
|
|||||||
|
|
||||||
|
|
||||||
____
|
____
|
||||||
|
#### #35 Use the same model, but provide the image from a Smartphone Camera
|
||||||
|
as reading the Electricity or Water meter every few minutues only delivers apparent accuracy (DE: "Scheingenauigkeit") you could just as well take a picture with your Smartphone evey so often (e.g. once a week when you are in the Basement anyway), then with some "semi clever" tricks pass this image to the model developed here, and the values then on to who ever needs them e.g. via MQTT.
|
||||||
|
IMO: It is not needed to have that many readings (datapoints) as our behaviour (Use of electricity or water) doesn't vary that much, say, over a weeks time. The interpolation between weekly readings will give sufficient information on the power and/or water usage.
|
||||||
|
|
||||||
|
|
||||||
#### #34 implement state and Roi for water leak detection
|
#### #34 implement state and Roi for water leak detection
|
||||||
for example see Roi on the next picture..
|
for example see Roi on the next picture..
|
||||||

|

|
||||||
|
|||||||
@@ -63,7 +63,6 @@ static camera_config_t camera_config = {
|
|||||||
.fb_count = 1, //if more than one, i2s runs in continuous mode. Use only with JPEG
|
.fb_count = 1, //if more than one, i2s runs in continuous mode. Use only with JPEG
|
||||||
.fb_location = CAMERA_FB_IN_PSRAM, /*!< The location where the frame buffer will be allocated */
|
.fb_location = CAMERA_FB_IN_PSRAM, /*!< The location where the frame buffer will be allocated */
|
||||||
.grab_mode = CAMERA_GRAB_LATEST, // only from new esp32cam version
|
.grab_mode = CAMERA_GRAB_LATEST, // only from new esp32cam version
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -126,63 +125,97 @@ void CCamera::ledc_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static size_t jpg_encode_stream(void * arg, size_t index, const void* data, size_t len){
|
static size_t jpg_encode_stream(void * arg, size_t index, const void* data, size_t len)
|
||||||
|
{
|
||||||
jpg_chunking_t *j = (jpg_chunking_t *)arg;
|
jpg_chunking_t *j = (jpg_chunking_t *)arg;
|
||||||
if(!index){
|
|
||||||
|
if(!index) {
|
||||||
j->len = 0;
|
j->len = 0;
|
||||||
}
|
}
|
||||||
if(httpd_resp_send_chunk(j->req, (const char *)data, len) != ESP_OK){
|
|
||||||
|
if(httpd_resp_send_chunk(j->req, (const char *)data, len) != ESP_OK) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
j->len += len;
|
j->len += len;
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CCamera::SetBrightnessContrastSaturation(int _brightness, int _contrast, int _saturation)
|
bool CCamera::SetBrightnessContrastSaturation(int _brightness, int _contrast, int _saturation)
|
||||||
{
|
{
|
||||||
bool result = false;
|
_brightness = min(2, max(-2, _brightness));
|
||||||
sensor_t * s = esp_camera_sensor_get();
|
_contrast = min(2, max(-2, _contrast));
|
||||||
if (_brightness > -100)
|
_saturation = min(2, max(-2, _saturation));
|
||||||
_brightness = min(2, max(-2, _brightness));
|
|
||||||
if (_contrast > -100)
|
|
||||||
_contrast = min(2, max(-2, _contrast));
|
|
||||||
if (_saturation > -100)
|
|
||||||
_saturation = min(2, max(-2, _saturation));
|
|
||||||
|
|
||||||
if (_saturation > -100)
|
sensor_t * s = esp_camera_sensor_get();
|
||||||
|
if (s) {
|
||||||
s->set_saturation(s, _saturation);
|
s->set_saturation(s, _saturation);
|
||||||
if (_contrast > -100)
|
|
||||||
s->set_contrast(s, _contrast);
|
s->set_contrast(s, _contrast);
|
||||||
if (_brightness > -100)
|
|
||||||
s->set_brightness(s, _brightness);
|
s->set_brightness(s, _brightness);
|
||||||
|
|
||||||
if ((_brightness != brightness) && (_brightness > -100))
|
/* Workaround - bug in cam library - enable bits are set without using bitwise OR logic -> only latest enable setting is used */
|
||||||
result = true;
|
/* Library version: https://github.com/espressif/esp32-camera/commit/5c8349f4cf169c8a61283e0da9b8cff10994d3f3 */
|
||||||
if ((_contrast != contrast) && (_contrast > -100))
|
/* Reference: https://esp32.com/viewtopic.php?f=19&t=14376#p93178 */
|
||||||
result = true;
|
/* The memory structure is as follows for
|
||||||
if ((_saturation != saturation) && (_saturation > -100))
|
byte_0 = enable_bits
|
||||||
result = true;
|
byte_0->bit0 = enable saturation and hue --> OK
|
||||||
|
byte_0->bit1 = enable saturation --> OK
|
||||||
|
byte_0->bit2 = enable brightness and contrast --> OK
|
||||||
|
byte_0->bit3 = enable green -> blue spitial effect (Antique and blunish and greenish and readdish and b&w) enable
|
||||||
|
byte_0->bit4 = anable gray -> read spitial effect (Antique and blunish and greenish and readdish and b&w) enable
|
||||||
|
byte_0->bit5 = remove (UV) in YUV color system
|
||||||
|
byte_0->bit6 = enable negative
|
||||||
|
byte_0->bit7 = remove (Y) in YUV color system
|
||||||
|
byte_1 = saturation1 0-255 --> ?
|
||||||
|
byte_2 = hue 0-255 --> OK
|
||||||
|
byte_3 = saturation2 0-255 --> OK
|
||||||
|
byte_4 = reenter saturation2 in documents --> ?
|
||||||
|
byte_5 = spital effect green -> blue 0-255 --> ?
|
||||||
|
byte_6 = spital effect gray -> read 0-255 --> ?
|
||||||
|
byte_7 = contrast lower byte 0-255 --> OK
|
||||||
|
byte_8 = contrast higher byte 0-255 --> OK
|
||||||
|
byte_9 = brightness 0-255 --> OK
|
||||||
|
byte_10= if byte_10==4 contrast effective --> ?
|
||||||
|
*/
|
||||||
|
|
||||||
if (_brightness > -100)
|
//s->set_reg(s, 0x7C, 0xFF, 2); // Optional feature - hue setting: Select byte 2 in register 0x7C to set hue value
|
||||||
brightness = _brightness;
|
//s->set_reg(s, 0x7D, 0xFF, 0); // Optional feature - hue setting: Hue value 0 - 255
|
||||||
if (_contrast > -100)
|
s->set_reg(s, 0xFF, 0x01, 0); // Select DSP bank
|
||||||
contrast = _contrast;
|
s->set_reg(s, 0x7C, 0xFF, 0); // Select byte 0 in register 0x7C
|
||||||
if (_saturation > -100)
|
s->set_reg(s, 0x7D, 7, 7); // Set bit 0, 1, 2 in register 0x7D to enable saturation, contrast, brightness and hue control
|
||||||
saturation = _saturation;
|
}
|
||||||
|
else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "SetBrightnessContrastSaturation: Failed to get control structure");
|
||||||
|
}
|
||||||
|
|
||||||
if (result && isFixedExposure)
|
if (((_brightness != brightness) || (_contrast != contrast) || (_saturation != saturation)) && isFixedExposure)
|
||||||
EnableAutoExposure(waitbeforepicture_org);
|
EnableAutoExposure(waitbeforepicture_org);
|
||||||
|
|
||||||
return result;
|
brightness = _brightness;
|
||||||
|
contrast = _contrast;
|
||||||
|
saturation = _saturation;
|
||||||
|
|
||||||
|
ESP_LOGD(TAG, "brightness %d, contrast: %d, saturation %d", brightness, contrast, saturation);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CCamera::SetQualitySize(int qual, framesize_t resol)
|
void CCamera::SetQualitySize(int qual, framesize_t resol)
|
||||||
{
|
{
|
||||||
|
qual = min(63, max(8, qual)); // Limit quality from 8..63 (values lower than 8 tent to be unstable)
|
||||||
|
|
||||||
sensor_t * s = esp_camera_sensor_get();
|
sensor_t * s = esp_camera_sensor_get();
|
||||||
s->set_quality(s, qual);
|
if (s) {
|
||||||
s->set_framesize(s, resol);
|
s->set_quality(s, qual);
|
||||||
|
s->set_framesize(s, resol);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "SetQualitySize: Failed to get control structure");
|
||||||
|
}
|
||||||
|
|
||||||
ActualResolution = resol;
|
ActualResolution = resol;
|
||||||
ActualQuality = qual;
|
ActualQuality = qual;
|
||||||
|
|
||||||
@@ -191,41 +224,45 @@ void CCamera::SetQualitySize(int qual, framesize_t resol)
|
|||||||
image_height = 240;
|
image_height = 240;
|
||||||
image_width = 320;
|
image_width = 320;
|
||||||
}
|
}
|
||||||
if (resol == FRAMESIZE_VGA)
|
else if (resol == FRAMESIZE_VGA)
|
||||||
{
|
{
|
||||||
image_height = 480;
|
image_height = 480;
|
||||||
image_width = 640;
|
image_width = 640;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CCamera::EnableAutoExposure(int flash_duration)
|
void CCamera::EnableAutoExposure(int flash_duration)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "EnableAutoExposure");
|
ESP_LOGD(TAG, "EnableAutoExposure");
|
||||||
|
|
||||||
LEDOnOff(true);
|
LEDOnOff(true);
|
||||||
if (flash_duration > 0)
|
if (flash_duration > 0) {
|
||||||
LightOnOff(true);
|
LightOnOff(true);
|
||||||
const TickType_t xDelay = flash_duration / portTICK_PERIOD_MS;
|
const TickType_t xDelay = flash_duration / portTICK_PERIOD_MS;
|
||||||
vTaskDelay( xDelay );
|
vTaskDelay( xDelay );
|
||||||
|
}
|
||||||
|
|
||||||
camera_fb_t * fb = esp_camera_fb_get();
|
camera_fb_t * fb = esp_camera_fb_get();
|
||||||
esp_camera_fb_return(fb);
|
esp_camera_fb_return(fb);
|
||||||
fb = esp_camera_fb_get();
|
fb = esp_camera_fb_get();
|
||||||
if (!fb) {
|
if (!fb) {
|
||||||
ESP_LOGE(TAG, "Camera Capture Failed");
|
|
||||||
LEDOnOff(false);
|
LEDOnOff(false);
|
||||||
LightOnOff(false);
|
LightOnOff(false);
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Capture Failed (Procedure 'EnableAutoExposure') --> Reboot! "
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "EnableAutoExposure: Capture Failed. "
|
||||||
"Check that your camera module is working and connected properly.");
|
"Check camera module and/or proper electrical connection");
|
||||||
//doReboot();
|
//doReboot();
|
||||||
}
|
}
|
||||||
esp_camera_fb_return(fb);
|
esp_camera_fb_return(fb);
|
||||||
|
|
||||||
sensor_t * s = esp_camera_sensor_get();
|
sensor_t * s = esp_camera_sensor_get();
|
||||||
s->set_gain_ctrl(s, 0);
|
if (s) {
|
||||||
s->set_exposure_ctrl(s, 0);
|
s->set_gain_ctrl(s, 0);
|
||||||
|
s->set_exposure_ctrl(s, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "EnableAutoExposure: Failed to get control structure to set gain+exposure");
|
||||||
|
}
|
||||||
|
|
||||||
LEDOnOff(false);
|
LEDOnOff(false);
|
||||||
LightOnOff(false);
|
LightOnOff(false);
|
||||||
@@ -237,22 +274,21 @@ void CCamera::EnableAutoExposure(int flash_duration)
|
|||||||
esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
|
esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - Start");
|
LogFile.WriteHeapInfo("CaptureToBasisImage - Start");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_Image->EmptyImage(); //Delete previous stored raw image -> black image
|
_Image->EmptyImage(); //Delete previous stored raw image -> black image
|
||||||
|
|
||||||
LEDOnOff(true);
|
LEDOnOff(true);
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0) {
|
||||||
{
|
|
||||||
LightOnOff(true);
|
LightOnOff(true);
|
||||||
const TickType_t xDelay = delay / portTICK_PERIOD_MS;
|
const TickType_t xDelay = delay / portTICK_PERIOD_MS;
|
||||||
vTaskDelay( xDelay );
|
vTaskDelay( xDelay );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After LightOn");
|
LogFile.WriteHeapInfo("CaptureToBasisImage - After LightOn");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
camera_fb_t * fb = esp_camera_fb_get();
|
camera_fb_t * fb = esp_camera_fb_get();
|
||||||
@@ -262,9 +298,8 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
|
|||||||
LEDOnOff(false);
|
LEDOnOff(false);
|
||||||
LightOnOff(false);
|
LightOnOff(false);
|
||||||
|
|
||||||
ESP_LOGE(TAG, "CaptureToBasisImage: Capture Failed");
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "is not working anymore (CaptureToBasisImage) - most probably caused "
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "is not working anymore (CCamera::CaptureToBasisImage) - most probably caused by a hardware problem (instablility, ...). "
|
"by a hardware problem (instablility, ...). System will reboot.");
|
||||||
"System will reboot.");
|
|
||||||
doReboot();
|
doReboot();
|
||||||
|
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
@@ -276,11 +311,16 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CImageBasis* _zwImage = new CImageBasis();
|
CImageBasis* _zwImage = new CImageBasis();
|
||||||
_zwImage->LoadFromMemory(fb->buf, fb->len);
|
if (_zwImage) {
|
||||||
|
_zwImage->LoadFromMemory(fb->buf, fb->len);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "CaptureToBasisImage: Can't allocate _zwImage");
|
||||||
|
}
|
||||||
esp_camera_fb_return(fb);
|
esp_camera_fb_return(fb);
|
||||||
|
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After fb_get");
|
LogFile.WriteHeapInfo("CaptureToBasisImage - After fb_get");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LEDOnOff(false);
|
LEDOnOff(false);
|
||||||
@@ -292,7 +332,7 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
|
|||||||
// vTaskDelay( xDelay ); // wait for power to recover
|
// vTaskDelay( xDelay ); // wait for power to recover
|
||||||
|
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - After LoadFromMemory");
|
LogFile.WriteHeapInfo("CaptureToBasisImage - After LoadFromMemory");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
stbi_uc* p_target;
|
stbi_uc* p_target;
|
||||||
@@ -320,7 +360,7 @@ esp_err_t CCamera::CaptureToBasisImage(CImageBasis *_Image, int delay)
|
|||||||
delete _zwImage;
|
delete _zwImage;
|
||||||
|
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("CCamera::CaptureToBasisImage - Done");
|
LogFile.WriteHeapInfo("CaptureToBasisImage - Done");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
@@ -333,8 +373,7 @@ esp_err_t CCamera::CaptureToFile(std::string nm, int delay)
|
|||||||
|
|
||||||
LEDOnOff(true); // Switched off to save power !
|
LEDOnOff(true); // Switched off to save power !
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0) {
|
||||||
{
|
|
||||||
LightOnOff(true);
|
LightOnOff(true);
|
||||||
const TickType_t xDelay = delay / portTICK_PERIOD_MS;
|
const TickType_t xDelay = delay / portTICK_PERIOD_MS;
|
||||||
vTaskDelay( xDelay );
|
vTaskDelay( xDelay );
|
||||||
@@ -344,11 +383,10 @@ esp_err_t CCamera::CaptureToFile(std::string nm, int delay)
|
|||||||
esp_camera_fb_return(fb);
|
esp_camera_fb_return(fb);
|
||||||
fb = esp_camera_fb_get();
|
fb = esp_camera_fb_get();
|
||||||
if (!fb) {
|
if (!fb) {
|
||||||
ESP_LOGE(TAG, "CaptureToFile: Camera Capture Failed");
|
|
||||||
LEDOnOff(false);
|
LEDOnOff(false);
|
||||||
LightOnOff(false);
|
LightOnOff(false);
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Capture Failed (CCamera::CaptureToFile) --> Reboot! "
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "CaptureToFile: Capture Failed. "
|
||||||
"Check that your camera module is working and connected properly.");
|
"Check camera module and/or proper electrical connection");
|
||||||
//doReboot();
|
//doReboot();
|
||||||
|
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
@@ -395,24 +433,21 @@ esp_err_t CCamera::CaptureToFile(std::string nm, int delay)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FILE * fp = fopen(nm.c_str(), "wb");
|
FILE * fp = fopen(nm.c_str(), "wb");
|
||||||
if (fp == NULL) /* If an error occurs during the file creation */
|
if (fp == NULL) { // If an error occurs during the file creation
|
||||||
{
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "CaptureToFile: Failed to open file " + nm);
|
||||||
fprintf(stderr, "fopen() failed for '%s'\n", nm.c_str());
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
fwrite(buf, sizeof(uint8_t), buf_len, fp);
|
fwrite(buf, sizeof(uint8_t), buf_len, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (converted)
|
if (converted)
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
esp_camera_fb_return(fb);
|
esp_camera_fb_return(fb);
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0)
|
||||||
{
|
|
||||||
LightOnOff(false);
|
LightOnOff(false);
|
||||||
}
|
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
@@ -420,29 +455,26 @@ esp_err_t CCamera::CaptureToFile(std::string nm, int delay)
|
|||||||
|
|
||||||
esp_err_t CCamera::CaptureToHTTP(httpd_req_t *req, int delay)
|
esp_err_t CCamera::CaptureToHTTP(httpd_req_t *req, int delay)
|
||||||
{
|
{
|
||||||
camera_fb_t * fb = NULL;
|
|
||||||
esp_err_t res = ESP_OK;
|
esp_err_t res = ESP_OK;
|
||||||
size_t fb_len = 0;
|
size_t fb_len = 0;
|
||||||
int64_t fr_start = esp_timer_get_time();
|
int64_t fr_start = esp_timer_get_time();
|
||||||
|
|
||||||
|
|
||||||
LEDOnOff(true);
|
LEDOnOff(true);
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0) {
|
||||||
{
|
|
||||||
LightOnOff(true);
|
LightOnOff(true);
|
||||||
const TickType_t xDelay = delay / portTICK_PERIOD_MS;
|
const TickType_t xDelay = delay / portTICK_PERIOD_MS;
|
||||||
vTaskDelay( xDelay );
|
vTaskDelay( xDelay );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
camera_fb_t *fb = esp_camera_fb_get();
|
||||||
fb = esp_camera_fb_get();
|
|
||||||
esp_camera_fb_return(fb);
|
esp_camera_fb_return(fb);
|
||||||
fb = esp_camera_fb_get();
|
fb = esp_camera_fb_get();
|
||||||
if (!fb) {
|
if (!fb) {
|
||||||
ESP_LOGE(TAG, "Camera capture failed");
|
|
||||||
LEDOnOff(false);
|
LEDOnOff(false);
|
||||||
LightOnOff(false);
|
LightOnOff(false);
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "CaptureToFile: Capture Failed. "
|
||||||
|
"Check camera module and/or proper electrical connection");
|
||||||
httpd_resp_send_500(req);
|
httpd_resp_send_500(req);
|
||||||
// doReboot();
|
// doReboot();
|
||||||
|
|
||||||
@@ -482,9 +514,7 @@ esp_err_t CCamera::CaptureToHTTP(httpd_req_t *req, int delay)
|
|||||||
ESP_LOGI(TAG, "JPG: %uKB %ums", (uint32_t)(fb_len/1024), (uint32_t)((fr_end - fr_start)/1000));
|
ESP_LOGI(TAG, "JPG: %uKB %ums", (uint32_t)(fb_len/1024), (uint32_t)((fr_end - fr_start)/1000));
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0)
|
||||||
{
|
|
||||||
LightOnOff(false);
|
LightOnOff(false);
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -494,19 +524,18 @@ void CCamera::LightOnOff(bool status)
|
|||||||
{
|
{
|
||||||
GpioHandler* gpioHandler = gpio_handler_get();
|
GpioHandler* gpioHandler = gpio_handler_get();
|
||||||
if ((gpioHandler != NULL) && (gpioHandler->isEnabled())) {
|
if ((gpioHandler != NULL) && (gpioHandler->isEnabled())) {
|
||||||
ESP_LOGD(TAG, "Use gpioHandler flashLigh");
|
ESP_LOGD(TAG, "Use gpioHandler to trigger flashlight");
|
||||||
gpioHandler->flashLightEnable(status);
|
gpioHandler->flashLightEnable(status);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
#ifdef USE_PWM_LEDFLASH
|
#ifdef USE_PWM_LEDFLASH
|
||||||
if (status)
|
if (status) {
|
||||||
{
|
|
||||||
ESP_LOGD(TAG, "Internal Flash-LED turn on with PWM %d", led_intensity);
|
ESP_LOGD(TAG, "Internal Flash-LED turn on with PWM %d", led_intensity);
|
||||||
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, led_intensity));
|
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, led_intensity));
|
||||||
// Update duty to apply the new value
|
// Update duty to apply the new value
|
||||||
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
|
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
ESP_LOGD(TAG, "Internal Flash-LED turn off PWM");
|
ESP_LOGD(TAG, "Internal Flash-LED turn off PWM");
|
||||||
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, 0));
|
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, 0));
|
||||||
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
|
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
|
||||||
@@ -555,33 +584,33 @@ void CCamera::GetCameraParameter(httpd_req_t *req, int &qual, framesize_t &resol
|
|||||||
ESP_LOGD(TAG, "Query: %s", _query);
|
ESP_LOGD(TAG, "Query: %s", _query);
|
||||||
if (httpd_query_key_value(_query, "size", _size, 10) == ESP_OK)
|
if (httpd_query_key_value(_query, "size", _size, 10) == ESP_OK)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
ESP_LOGD(TAG, "Size: %s", _size);
|
ESP_LOGD(TAG, "Size: %s", _size);
|
||||||
#endif
|
#endif
|
||||||
if (strcmp(_size, "QVGA") == 0)
|
if (strcmp(_size, "QVGA") == 0)
|
||||||
resol = FRAMESIZE_QVGA; // 320x240
|
resol = FRAMESIZE_QVGA; // 320x240
|
||||||
if (strcmp(_size, "VGA") == 0)
|
else if (strcmp(_size, "VGA") == 0)
|
||||||
resol = FRAMESIZE_VGA; // 640x480
|
resol = FRAMESIZE_VGA; // 640x480
|
||||||
if (strcmp(_size, "SVGA") == 0)
|
else if (strcmp(_size, "SVGA") == 0)
|
||||||
resol = FRAMESIZE_SVGA; // 800x600
|
resol = FRAMESIZE_SVGA; // 800x600
|
||||||
if (strcmp(_size, "XGA") == 0)
|
else if (strcmp(_size, "XGA") == 0)
|
||||||
resol = FRAMESIZE_XGA; // 1024x768
|
resol = FRAMESIZE_XGA; // 1024x768
|
||||||
if (strcmp(_size, "SXGA") == 0)
|
else if (strcmp(_size, "SXGA") == 0)
|
||||||
resol = FRAMESIZE_SXGA; // 1280x1024
|
resol = FRAMESIZE_SXGA; // 1280x1024
|
||||||
if (strcmp(_size, "UXGA") == 0)
|
else if (strcmp(_size, "UXGA") == 0)
|
||||||
resol = FRAMESIZE_UXGA; // 1600x1200
|
resol = FRAMESIZE_UXGA; // 1600x1200
|
||||||
}
|
}
|
||||||
if (httpd_query_key_value(_query, "quality", _qual, 10) == ESP_OK)
|
if (httpd_query_key_value(_query, "quality", _qual, 10) == ESP_OK)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
ESP_LOGD(TAG, "Quality: %s", _qual);
|
ESP_LOGD(TAG, "Quality: %s", _qual);
|
||||||
#endif
|
#endif
|
||||||
qual = atoi(_qual);
|
qual = atoi(_qual);
|
||||||
|
|
||||||
if (qual > 63)
|
if (qual > 63) // Limit to max. 63
|
||||||
qual = 63;
|
qual = 63;
|
||||||
if (qual < 0)
|
else if (qual < 8) // Limit to min. 8
|
||||||
qual = 0;
|
qual = 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -591,28 +620,29 @@ framesize_t CCamera::TextToFramesize(const char * _size)
|
|||||||
{
|
{
|
||||||
if (strcmp(_size, "QVGA") == 0)
|
if (strcmp(_size, "QVGA") == 0)
|
||||||
return FRAMESIZE_QVGA; // 320x240
|
return FRAMESIZE_QVGA; // 320x240
|
||||||
if (strcmp(_size, "VGA") == 0)
|
else if (strcmp(_size, "VGA") == 0)
|
||||||
return FRAMESIZE_VGA; // 640x480
|
return FRAMESIZE_VGA; // 640x480
|
||||||
if (strcmp(_size, "SVGA") == 0)
|
else if (strcmp(_size, "SVGA") == 0)
|
||||||
return FRAMESIZE_SVGA; // 800x600
|
return FRAMESIZE_SVGA; // 800x600
|
||||||
if (strcmp(_size, "XGA") == 0)
|
else if (strcmp(_size, "XGA") == 0)
|
||||||
return FRAMESIZE_XGA; // 1024x768
|
return FRAMESIZE_XGA; // 1024x768
|
||||||
if (strcmp(_size, "SXGA") == 0)
|
else if (strcmp(_size, "SXGA") == 0)
|
||||||
return FRAMESIZE_SXGA; // 1280x1024
|
return FRAMESIZE_SXGA; // 1280x1024
|
||||||
if (strcmp(_size, "UXGA") == 0)
|
else if (strcmp(_size, "UXGA") == 0)
|
||||||
return FRAMESIZE_UXGA; // 1600x1200
|
return FRAMESIZE_UXGA; // 1600x1200
|
||||||
|
|
||||||
return ActualResolution;
|
return ActualResolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CCamera::CCamera()
|
CCamera::CCamera()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
ESP_LOGD(TAG, "CreateClassCamera");
|
ESP_LOGD(TAG, "CreateClassCamera");
|
||||||
#endif
|
#endif
|
||||||
brightness = -5;
|
brightness = 0;
|
||||||
contrast = -5;
|
contrast = 0;
|
||||||
saturation = -5;
|
saturation = 0;
|
||||||
isFixedExposure = false;
|
isFixedExposure = false;
|
||||||
|
|
||||||
ledc_init();
|
ledc_init();
|
||||||
|
|||||||
@@ -996,8 +996,12 @@ std::string unzip_new(std::string _in_zip_file, std::string _target_zip, std::st
|
|||||||
|
|
||||||
ESP_LOGI(TAG, "Filename to extract: %s, Zwischenfilename: %s", zw.c_str(), filename_zw.c_str());
|
ESP_LOGI(TAG, "Filename to extract: %s, Zwischenfilename: %s", zw.c_str(), filename_zw.c_str());
|
||||||
|
|
||||||
|
std::string folder = filename_zw.substr(0, filename_zw.find_last_of('/'));
|
||||||
|
MakeDir(folder);
|
||||||
|
|
||||||
// extrahieren in zwischendatei
|
// extrahieren in zwischendatei
|
||||||
DeleteFile(filename_zw);
|
DeleteFile(filename_zw);
|
||||||
|
|
||||||
FILE* fpTargetFile = fopen(filename_zw.c_str(), "wb");
|
FILE* fpTargetFile = fopen(filename_zw.c_str(), "wb");
|
||||||
uint writtenbytes = fwrite(p, 1, (uint)uncomp_size, fpTargetFile);
|
uint writtenbytes = fwrite(p, 1, (uint)uncomp_size, fpTargetFile);
|
||||||
fclose(fpTargetFile);
|
fclose(fpTargetFile);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "ClassFlowAlignment.h"
|
#include "ClassFlowAlignment.h"
|
||||||
#include "ClassFlowMakeImage.h"
|
#include "ClassFlowTakeImage.h"
|
||||||
#include "ClassFlow.h"
|
#include "ClassFlow.h"
|
||||||
#include "server_tflite.h"
|
#include "server_tflite.h"
|
||||||
|
|
||||||
@@ -46,9 +46,9 @@ ClassFlowAlignment::ClassFlowAlignment(std::vector<ClassFlow*>* lfc)
|
|||||||
|
|
||||||
for (int i = 0; i < ListFlowControll->size(); ++i)
|
for (int i = 0; i < ListFlowControll->size(); ++i)
|
||||||
{
|
{
|
||||||
if (((*ListFlowControll)[i])->name().compare("ClassFlowMakeImage") == 0)
|
if (((*ListFlowControll)[i])->name().compare("ClassFlowTakeImage") == 0)
|
||||||
{
|
{
|
||||||
ImageBasis = ((ClassFlowMakeImage*) (*ListFlowControll)[i])->rawImage;
|
ImageBasis = ((ClassFlowTakeImage*) (*ListFlowControll)[i])->rawImage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
std::vector<string> splitted;
|
std::vector<string> splitted;
|
||||||
int suchex = 40;
|
int suchex = 40;
|
||||||
int suchey = 40;
|
int suchey = 40;
|
||||||
int alg_algo = 0;
|
int alg_algo = 0; //default=0; 1 =HIGHACCURACY; 2= FAST; 3= OFF //add disable aligment algo |01.2023
|
||||||
|
|
||||||
|
|
||||||
aktparamgraph = trim(aktparamgraph);
|
aktparamgraph = trim(aktparamgraph);
|
||||||
@@ -74,7 +74,7 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
if (!this->GetNextParagraph(pfile, aktparamgraph))
|
if (!this->GetNextParagraph(pfile, aktparamgraph))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (aktparamgraph.compare("[Alignment]") != 0) //Paragraph does not fit MakeImage
|
if (aktparamgraph.compare("[Alignment]") != 0) //Paragraph does not fit Alignment
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
||||||
@@ -130,6 +130,8 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
alg_algo = 1;
|
alg_algo = 1;
|
||||||
if (toUpper(splitted[1]) == "FAST")
|
if (toUpper(splitted[1]) == "FAST")
|
||||||
alg_algo = 2;
|
alg_algo = 2;
|
||||||
|
if (toUpper(splitted[1]) == "OFF") //no align algo if set to 3 = off => no draw ref //add disable aligment algo |01.2023
|
||||||
|
alg_algo = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +147,10 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadReferenceAlignmentValues();
|
//no align algo if set to 3 = off => no draw ref //add disable aligment algo |01.2023
|
||||||
|
if(References[0].alignment_algo != 3){
|
||||||
|
LoadReferenceAlignmentValues();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -234,14 +239,22 @@ bool ClassFlowAlignment::doFlow(string time)
|
|||||||
AlignAndCutImage->SaveToFile(FormatFileName("/sdcard/img_tmp/rot.jpg"));
|
AlignAndCutImage->SaveToFile(FormatFileName("/sdcard/img_tmp/rot.jpg"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!AlignAndCutImage->Align(&References[0], &References[1]))
|
|
||||||
{
|
//no align algo if set to 3 = off //add disable aligment algo |01.2023
|
||||||
SaveReferenceAlignmentValues();
|
if(References[0].alignment_algo != 3){
|
||||||
}
|
if (!AlignAndCutImage->Align(&References[0], &References[1]))
|
||||||
|
{
|
||||||
|
SaveReferenceAlignmentValues();
|
||||||
|
}
|
||||||
|
}// no align
|
||||||
|
|
||||||
|
|
||||||
#ifdef ALGROI_LOAD_FROM_MEM_AS_JPG
|
#ifdef ALGROI_LOAD_FROM_MEM_AS_JPG
|
||||||
if (AlgROI) {
|
if (AlgROI) {
|
||||||
DrawRef(ImageTMP);
|
//no align algo if set to 3 = off => no draw ref //add disable aligment algo |01.2023
|
||||||
|
if(References[0].alignment_algo != 3){
|
||||||
|
DrawRef(ImageTMP);
|
||||||
|
}
|
||||||
tfliteflow.DigitalDrawROI(ImageTMP);
|
tfliteflow.DigitalDrawROI(ImageTMP);
|
||||||
tfliteflow.AnalogDrawROI(ImageTMP);
|
tfliteflow.AnalogDrawROI(ImageTMP);
|
||||||
ImageTMP->writeToMemoryAsJPG((ImageData*)AlgROI, 90);
|
ImageTMP->writeToMemoryAsJPG((ImageData*)AlgROI, 90);
|
||||||
@@ -258,7 +271,10 @@ bool ClassFlowAlignment::doFlow(string time)
|
|||||||
delete ImageTMP;
|
delete ImageTMP;
|
||||||
ImageTMP = NULL;
|
ImageTMP = NULL;
|
||||||
|
|
||||||
LoadReferenceAlignmentValues();
|
//no align algo if set to 3 = off => no draw ref //add disable aligment algo |01.2023
|
||||||
|
if(References[0].alignment_algo != 3){
|
||||||
|
LoadReferenceAlignmentValues();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ ClassFlowCNNGeneral::ClassFlowCNNGeneral(ClassFlowAlignment *_flowalign, t_CNNTy
|
|||||||
CNNType = AutoDetect;
|
CNNType = AutoDetect;
|
||||||
CNNType = _cnntype;
|
CNNType = _cnntype;
|
||||||
flowpostalignment = _flowalign;
|
flowpostalignment = _flowalign;
|
||||||
logfileRetentionInDays = 5;
|
imagesRetention = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -324,9 +324,9 @@ bool ClassFlowCNNGeneral::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
||||||
{
|
{
|
||||||
splitted = ZerlegeZeile(aktparamgraph);
|
splitted = ZerlegeZeile(aktparamgraph);
|
||||||
if ((toUpper(splitted[0]) == "LOGIMAGELOCATION") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "ROIIMAGESLOCATION") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
this->LogImageLocation = "/sdcard" + splitted[1];
|
this->imagesLocation = "/sdcard" + splitted[1];
|
||||||
this->isLogImage = true;
|
this->isLogImage = true;
|
||||||
}
|
}
|
||||||
if ((toUpper(splitted[0]) == "LOGIMAGESELECT") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "LOGIMAGESELECT") && (splitted.size() > 1))
|
||||||
@@ -335,9 +335,9 @@ bool ClassFlowCNNGeneral::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
isLogImageSelect = true;
|
isLogImageSelect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "LOGFILERETENTIONINDAYS") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "ROIIMAGESRETENTION") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
this->logfileRetentionInDays = std::stoi(splitted[1]);
|
this->imagesRetention = std::stoi(splitted[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "MODEL") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "MODEL") && (splitted.size() > 1))
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _
|
|||||||
|
|
||||||
ESP_LOGD(TAG, "Step %s start", _stepname.c_str());
|
ESP_LOGD(TAG, "Step %s start", _stepname.c_str());
|
||||||
|
|
||||||
if ((_stepname.compare("[MakeImage]") == 0) || (_stepname.compare(";[MakeImage]") == 0)){
|
if ((_stepname.compare("[TakeImage]") == 0) || (_stepname.compare(";[TakeImage]") == 0)){
|
||||||
_classname = "ClassFlowMakeImage";
|
_classname = "ClassFlowTakeImage";
|
||||||
}
|
}
|
||||||
if ((_stepname.compare("[Alignment]") == 0) || (_stepname.compare(";[Alignment]") == 0)){
|
if ((_stepname.compare("[Alignment]") == 0) || (_stepname.compare(";[Alignment]") == 0)){
|
||||||
_classname = "ClassFlowAlignment";
|
_classname = "ClassFlowAlignment";
|
||||||
@@ -60,11 +60,14 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _
|
|||||||
if ((_stepname.compare("[InfluxDB]") == 0) || (_stepname.compare(";[InfluxDB]") == 0)){
|
if ((_stepname.compare("[InfluxDB]") == 0) || (_stepname.compare(";[InfluxDB]") == 0)){
|
||||||
_classname = "ClassFlowInfluxDB";
|
_classname = "ClassFlowInfluxDB";
|
||||||
}
|
}
|
||||||
|
if ((_stepname.compare("[InfluxDBv2]") == 0) || (_stepname.compare(";[InfluxDBv2]") == 0)){
|
||||||
|
_classname = "ClassFlowInfluxDBv2";
|
||||||
|
}
|
||||||
#endif //ENABLE_INFLUXDB
|
#endif //ENABLE_INFLUXDB
|
||||||
|
|
||||||
for (int i = 0; i < FlowControll.size(); ++i)
|
for (int i = 0; i < FlowControll.size(); ++i)
|
||||||
if (FlowControll[i]->name().compare(_classname) == 0){
|
if (FlowControll[i]->name().compare(_classname) == 0){
|
||||||
if (!(FlowControll[i]->name().compare("ClassFlowMakeImage") == 0)) // if it is a MakeImage, the image does not need to be included, this happens automatically with the html query.
|
if (!(FlowControll[i]->name().compare("ClassFlowTakeImage") == 0)) // if it is a TakeImage, the image does not need to be included, this happens automatically with the html query.
|
||||||
FlowControll[i]->doFlow("");
|
FlowControll[i]->doFlow("");
|
||||||
result = FlowControll[i]->getHTMLSingleStep(_host);
|
result = FlowControll[i]->getHTMLSingleStep(_host);
|
||||||
}
|
}
|
||||||
@@ -77,7 +80,7 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _
|
|||||||
|
|
||||||
std::string ClassFlowControll::TranslateAktstatus(std::string _input)
|
std::string ClassFlowControll::TranslateAktstatus(std::string _input)
|
||||||
{
|
{
|
||||||
if (_input.compare("ClassFlowMakeImage") == 0)
|
if (_input.compare("ClassFlowTakeImage") == 0)
|
||||||
return ("Take Image");
|
return ("Take Image");
|
||||||
if (_input.compare("ClassFlowAlignment") == 0)
|
if (_input.compare("ClassFlowAlignment") == 0)
|
||||||
return ("Aligning");
|
return ("Aligning");
|
||||||
@@ -90,6 +93,8 @@ std::string ClassFlowControll::TranslateAktstatus(std::string _input)
|
|||||||
#ifdef ENABLE_INFLUXDB
|
#ifdef ENABLE_INFLUXDB
|
||||||
if (_input.compare("ClassFlowInfluxDB") == 0)
|
if (_input.compare("ClassFlowInfluxDB") == 0)
|
||||||
return ("Sending InfluxDB");
|
return ("Sending InfluxDB");
|
||||||
|
if (_input.compare("ClassFlowInfluxDBv2") == 0)
|
||||||
|
return ("Sending InfluxDBv2");
|
||||||
#endif //ENABLE_INFLUXDB
|
#endif //ENABLE_INFLUXDB
|
||||||
if (_input.compare("ClassFlowPostProcessing") == 0)
|
if (_input.compare("ClassFlowPostProcessing") == 0)
|
||||||
return ("Post-Processing");
|
return ("Post-Processing");
|
||||||
@@ -171,7 +176,7 @@ bool ClassFlowControll::StartMQTTService() {
|
|||||||
/* Start the MQTT service */
|
/* Start the MQTT service */
|
||||||
for (int i = 0; i < FlowControll.size(); ++i) {
|
for (int i = 0; i < FlowControll.size(); ++i) {
|
||||||
if (FlowControll[i]->name().compare("ClassFlowMQTT") == 0) {
|
if (FlowControll[i]->name().compare("ClassFlowMQTT") == 0) {
|
||||||
return ((ClassFlowMQTT*) (FlowControll[i]))->Start(AutoIntervall);
|
return ((ClassFlowMQTT*) (FlowControll[i]))->Start(AutoInterval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -183,7 +188,7 @@ void ClassFlowControll::SetInitialParameter(void)
|
|||||||
{
|
{
|
||||||
AutoStart = false;
|
AutoStart = false;
|
||||||
SetupModeActive = false;
|
SetupModeActive = false;
|
||||||
AutoIntervall = 10; // Minutes
|
AutoInterval = 10; // Minutes
|
||||||
flowdigit = NULL;
|
flowdigit = NULL;
|
||||||
flowanalog = NULL;
|
flowanalog = NULL;
|
||||||
flowpostprocessing = NULL;
|
flowpostprocessing = NULL;
|
||||||
@@ -193,9 +198,9 @@ void ClassFlowControll::SetInitialParameter(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ClassFlowControll::isAutoStart(long &_intervall)
|
bool ClassFlowControll::isAutoStart(long &_interval)
|
||||||
{
|
{
|
||||||
_intervall = AutoIntervall * 60 * 1000; // AutoInterval: minutes -> ms
|
_interval = AutoInterval * 60 * 1000; // AutoInterval: minutes -> ms
|
||||||
return AutoStart;
|
return AutoStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,10 +211,10 @@ ClassFlow* ClassFlowControll::CreateClassFlow(std::string _type)
|
|||||||
|
|
||||||
_type = trim(_type);
|
_type = trim(_type);
|
||||||
|
|
||||||
if (toUpper(_type).compare("[MAKEIMAGE]") == 0)
|
if (toUpper(_type).compare("[TAKEIMAGE]") == 0)
|
||||||
{
|
{
|
||||||
cfc = new ClassFlowMakeImage(&FlowControll);
|
cfc = new ClassFlowTakeImage(&FlowControll);
|
||||||
flowmakeimage = (ClassFlowMakeImage*) cfc;
|
flowtakeimage = (ClassFlowTakeImage*) cfc;
|
||||||
}
|
}
|
||||||
if (toUpper(_type).compare("[ALIGNMENT]") == 0)
|
if (toUpper(_type).compare("[ALIGNMENT]") == 0)
|
||||||
{
|
{
|
||||||
@@ -233,6 +238,8 @@ ClassFlow* ClassFlowControll::CreateClassFlow(std::string _type)
|
|||||||
#ifdef ENABLE_INFLUXDB
|
#ifdef ENABLE_INFLUXDB
|
||||||
if (toUpper(_type).compare("[INFLUXDB]") == 0)
|
if (toUpper(_type).compare("[INFLUXDB]") == 0)
|
||||||
cfc = new ClassFlowInfluxDB(&FlowControll);
|
cfc = new ClassFlowInfluxDB(&FlowControll);
|
||||||
|
if (toUpper(_type).compare("[INFLUXDBV2]") == 0)
|
||||||
|
cfc = new ClassFlowInfluxDBv2(&FlowControll);
|
||||||
#endif //ENABLE_INFLUXDB
|
#endif //ENABLE_INFLUXDB
|
||||||
if (toUpper(_type).compare("[WRITELIST]") == 0)
|
if (toUpper(_type).compare("[WRITELIST]") == 0)
|
||||||
cfc = new ClassFlowWriteList(&FlowControll);
|
cfc = new ClassFlowWriteList(&FlowControll);
|
||||||
@@ -290,6 +297,7 @@ void ClassFlowControll::InitFlow(std::string config)
|
|||||||
while ((line.size() > 0) && !(feof(pFile)))
|
while ((line.size() > 0) && !(feof(pFile)))
|
||||||
{
|
{
|
||||||
cfc = CreateClassFlow(line);
|
cfc = CreateClassFlow(line);
|
||||||
|
// printf("Name: %s\n", cfc->name().c_str());
|
||||||
if (cfc)
|
if (cfc)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "Start ReadParameter (%s)", line.c_str());
|
ESP_LOGD(TAG, "Start ReadParameter (%s)", line.c_str());
|
||||||
@@ -322,13 +330,13 @@ void ClassFlowControll::setActStatus(std::string _aktstatus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ClassFlowControll::doFlowMakeImageOnly(string time)
|
void ClassFlowControll::doFlowTakeImageOnly(string time)
|
||||||
{
|
{
|
||||||
std::string zw_time;
|
std::string zw_time;
|
||||||
|
|
||||||
for (int i = 0; i < FlowControll.size(); ++i)
|
for (int i = 0; i < FlowControll.size(); ++i)
|
||||||
{
|
{
|
||||||
if (FlowControll[i]->name() == "ClassFlowMakeImage") {
|
if (FlowControll[i]->name() == "ClassFlowTakeImage") {
|
||||||
zw_time = getCurrentTimeString("%H:%M:%S");
|
zw_time = getCurrentTimeString("%H:%M:%S");
|
||||||
std::string flowStatus = TranslateAktstatus(FlowControll[i]->name());
|
std::string flowStatus = TranslateAktstatus(FlowControll[i]->name());
|
||||||
aktstatus = flowStatus + " (" + zw_time + ")";
|
aktstatus = flowStatus + " (" + zw_time + ")";
|
||||||
@@ -527,7 +535,7 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
|
|
||||||
|
|
||||||
if ((toUpper(aktparamgraph).compare("[AUTOTIMER]") != 0) && (toUpper(aktparamgraph).compare("[DEBUG]") != 0) &&
|
if ((toUpper(aktparamgraph).compare("[AUTOTIMER]") != 0) && (toUpper(aktparamgraph).compare("[DEBUG]") != 0) &&
|
||||||
(toUpper(aktparamgraph).compare("[SYSTEM]") != 0 && (toUpper(aktparamgraph).compare("[DATALOGGING]") != 0))) // Paragraph passt nicht zu MakeImage
|
(toUpper(aktparamgraph).compare("[SYSTEM]") != 0 && (toUpper(aktparamgraph).compare("[DATALOGGING]") != 0))) // Paragraph passt nicht zu Debug oder DataLogging
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
||||||
@@ -541,9 +549,9 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "INTERVALL") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "INTERVAL") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
AutoIntervall = std::stof(splitted[1]);
|
AutoInterval = std::stof(splitted[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "DATALOGACTIVE") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "DATALOGACTIVE") && (splitted.size() > 1))
|
||||||
@@ -557,12 +565,12 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "DATALOGRETENTIONINDAYS") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "DATAFILESRETENTION") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
LogFile.SetDataLogRetention(std::stoi(splitted[1]));
|
LogFile.SetDataLogRetention(std::stoi(splitted[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "LOGFILE") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "LOGLEVEL") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
/* matches esp_log_level_t */
|
/* matches esp_log_level_t */
|
||||||
if ((toUpper(splitted[1]) == "TRUE") || (toUpper(splitted[1]) == "2"))
|
if ((toUpper(splitted[1]) == "TRUE") || (toUpper(splitted[1]) == "2"))
|
||||||
@@ -582,20 +590,20 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
LogFile.setLogLevel(ESP_LOG_DEBUG);
|
LogFile.setLogLevel(ESP_LOG_DEBUG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((toUpper(splitted[0]) == "LOGFILERETENTIONINDAYS") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "LOGFILESRETENTION") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
LogFile.SetLogFileRetention(std::stoi(splitted[1]));
|
LogFile.SetLogFileRetention(std::stoi(splitted[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TimeServer and TimeZone got already read from the config, see setupTime () */
|
/* TimeServer and TimeZone got already read from the config, see setupTime () */
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "RSSITHREASHOLD") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "RSSITHRESHOLD") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
if (ChangeRSSIThreashold(WLAN_CONFIG_FILE, atoi(splitted[1].c_str())))
|
if (ChangeRSSIThreshold(WLAN_CONFIG_FILE, atoi(splitted[1].c_str())))
|
||||||
{
|
{
|
||||||
// reboot necessary so that the new wlan.ini is also used !!!
|
// reboot necessary so that the new wlan.ini is also used !!!
|
||||||
fclose(pfile);
|
fclose(pfile);
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Rebooting to activate new RSSITHREASHOLD ...");
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Rebooting to activate new RSSITHRESHOLD ...");
|
||||||
esp_restart();
|
esp_restart();
|
||||||
hard_restart();
|
hard_restart();
|
||||||
doReboot();
|
doReboot();
|
||||||
@@ -660,7 +668,7 @@ int ClassFlowControll::CleanTempFolder() {
|
|||||||
|
|
||||||
esp_err_t ClassFlowControll::SendRawJPG(httpd_req_t *req)
|
esp_err_t ClassFlowControll::SendRawJPG(httpd_req_t *req)
|
||||||
{
|
{
|
||||||
return flowmakeimage != NULL ? flowmakeimage->SendRawJPG(req) : ESP_FAIL;
|
return flowtakeimage != NULL ? flowtakeimage->SendRawJPG(req) : ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "ClassFlow.h"
|
#include "ClassFlow.h"
|
||||||
#include "ClassFlowMakeImage.h"
|
#include "ClassFlowTakeImage.h"
|
||||||
#include "ClassFlowAlignment.h"
|
#include "ClassFlowAlignment.h"
|
||||||
#include "ClassFlowCNNGeneral.h"
|
#include "ClassFlowCNNGeneral.h"
|
||||||
#include "ClassFlowPostProcessing.h"
|
#include "ClassFlowPostProcessing.h"
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
#endif //ENABLE_MQTT
|
#endif //ENABLE_MQTT
|
||||||
#ifdef ENABLE_INFLUXDB
|
#ifdef ENABLE_INFLUXDB
|
||||||
#include "ClassFlowInfluxDB.h"
|
#include "ClassFlowInfluxDB.h"
|
||||||
|
#include "ClassFlowInfluxDBv2.h"
|
||||||
#endif //ENABLE_INFLUXDB
|
#endif //ENABLE_INFLUXDB
|
||||||
#include "ClassFlowCNNGeneral.h"
|
#include "ClassFlowCNNGeneral.h"
|
||||||
#include "ClassFlowWriteList.h"
|
#include "ClassFlowWriteList.h"
|
||||||
@@ -29,11 +30,11 @@ protected:
|
|||||||
ClassFlowCNNGeneral* flowanalog;
|
ClassFlowCNNGeneral* flowanalog;
|
||||||
ClassFlowCNNGeneral* flowdigit;
|
ClassFlowCNNGeneral* flowdigit;
|
||||||
// ClassFlowDigit* flowdigit;
|
// ClassFlowDigit* flowdigit;
|
||||||
ClassFlowMakeImage* flowmakeimage;
|
ClassFlowTakeImage* flowtakeimage;
|
||||||
ClassFlow* CreateClassFlow(std::string _type);
|
ClassFlow* CreateClassFlow(std::string _type);
|
||||||
|
|
||||||
bool AutoStart;
|
bool AutoStart;
|
||||||
float AutoIntervall;
|
float AutoInterval;
|
||||||
bool SetupModeActive;
|
bool SetupModeActive;
|
||||||
void SetInitialParameter(void);
|
void SetInitialParameter(void);
|
||||||
std::string aktstatus;
|
std::string aktstatus;
|
||||||
@@ -42,7 +43,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
void InitFlow(std::string config);
|
void InitFlow(std::string config);
|
||||||
bool doFlow(string time);
|
bool doFlow(string time);
|
||||||
void doFlowMakeImageOnly(string time);
|
void doFlowTakeImageOnly(string time);
|
||||||
bool getStatusSetupModus(){return SetupModeActive;};
|
bool getStatusSetupModus(){return SetupModeActive;};
|
||||||
string getReadout(bool _rawvalue, bool _noerror);
|
string getReadout(bool _rawvalue, bool _noerror);
|
||||||
string getReadoutAll(int _type);
|
string getReadoutAll(int _type);
|
||||||
@@ -68,7 +69,7 @@ public:
|
|||||||
|
|
||||||
std::string doSingleStep(std::string _stepname, std::string _host);
|
std::string doSingleStep(std::string _stepname, std::string _host);
|
||||||
|
|
||||||
bool isAutoStart(long &_intervall);
|
bool isAutoStart(long &_interval);
|
||||||
|
|
||||||
std::string* getActStatus();
|
std::string* getActStatus();
|
||||||
void setActStatus(std::string _aktstatus);
|
void setActStatus(std::string _aktstatus);
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ struct NumberPost {
|
|||||||
int DecimalShiftInitial;
|
int DecimalShiftInitial;
|
||||||
float AnalogDigitalTransitionStart; // When is the digit > x.1, i.e. when does it start to tilt?
|
float AnalogDigitalTransitionStart; // When is the digit > x.1, i.e. when does it start to tilt?
|
||||||
int Nachkomma;
|
int Nachkomma;
|
||||||
|
string Fieldname; // Fieldname in InfluxDB2
|
||||||
|
|
||||||
bool isExtendedResolution;
|
bool isExtendedResolution;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ ClassFlowImage::ClassFlowImage(const char* logTag)
|
|||||||
this->logTag = logTag;
|
this->logTag = logTag;
|
||||||
isLogImage = false;
|
isLogImage = false;
|
||||||
disabled = false;
|
disabled = false;
|
||||||
this->logfileRetentionInDays = 5;
|
this->imagesRetention = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassFlowImage::ClassFlowImage(std::vector<ClassFlow*> * lfc, const char* logTag) : ClassFlow(lfc)
|
ClassFlowImage::ClassFlowImage(std::vector<ClassFlow*> * lfc, const char* logTag) : ClassFlow(lfc)
|
||||||
@@ -32,7 +32,7 @@ ClassFlowImage::ClassFlowImage(std::vector<ClassFlow*> * lfc, const char* logTag
|
|||||||
this->logTag = logTag;
|
this->logTag = logTag;
|
||||||
isLogImage = false;
|
isLogImage = false;
|
||||||
disabled = false;
|
disabled = false;
|
||||||
this->logfileRetentionInDays = 5;
|
this->imagesRetention = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassFlowImage::ClassFlowImage(std::vector<ClassFlow*> * lfc, ClassFlow *_prev, const char* logTag) : ClassFlow(lfc, _prev)
|
ClassFlowImage::ClassFlowImage(std::vector<ClassFlow*> * lfc, ClassFlow *_prev, const char* logTag) : ClassFlow(lfc, _prev)
|
||||||
@@ -40,7 +40,7 @@ ClassFlowImage::ClassFlowImage(std::vector<ClassFlow*> * lfc, ClassFlow *_prev,
|
|||||||
this->logTag = logTag;
|
this->logTag = logTag;
|
||||||
isLogImage = false;
|
isLogImage = false;
|
||||||
disabled = false;
|
disabled = false;
|
||||||
this->logfileRetentionInDays = 5;
|
this->imagesRetention = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ string ClassFlowImage::CreateLogFolder(string time) {
|
|||||||
if (!isLogImage)
|
if (!isLogImage)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
string logPath = LogImageLocation + "/" + time.LOGFILE_TIME_FORMAT_DATE_EXTR + "/" + time.LOGFILE_TIME_FORMAT_HOUR_EXTR;
|
string logPath = imagesLocation + "/" + time.LOGFILE_TIME_FORMAT_DATE_EXTR + "/" + time.LOGFILE_TIME_FORMAT_HOUR_EXTR;
|
||||||
isLogImage = mkdir_r(logPath.c_str(), S_IRWXU) == 0;
|
isLogImage = mkdir_r(logPath.c_str(), S_IRWXU) == 0;
|
||||||
if (!isLogImage) {
|
if (!isLogImage) {
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Can't create log folder for analog images. Path " + logPath);
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Can't create log folder for analog images. Path " + logPath);
|
||||||
@@ -95,7 +95,7 @@ void ClassFlowImage::RemoveOldLogs()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ESP_LOGD(TAG, "remove old images");
|
ESP_LOGD(TAG, "remove old images");
|
||||||
if (logfileRetentionInDays == 0) {
|
if (imagesRetention == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,17 +104,17 @@ void ClassFlowImage::RemoveOldLogs()
|
|||||||
char cmpfilename[30];
|
char cmpfilename[30];
|
||||||
|
|
||||||
time(&rawtime);
|
time(&rawtime);
|
||||||
rawtime = addDays(rawtime, -logfileRetentionInDays + 1);
|
rawtime = addDays(rawtime, -1 * imagesRetention + 1);
|
||||||
timeinfo = localtime(&rawtime);
|
timeinfo = localtime(&rawtime);
|
||||||
//ESP_LOGD(TAG, "ImagefileRetentionInDays: %d", logfileRetentionInDays);
|
//ESP_LOGD(TAG, "ImagefileRetentionInDays: %d", imagesRetention);
|
||||||
|
|
||||||
strftime(cmpfilename, 30, LOGFILE_TIME_FORMAT, timeinfo);
|
strftime(cmpfilename, 30, LOGFILE_TIME_FORMAT, timeinfo);
|
||||||
//ESP_LOGD(TAG, "file name to compare: %s", cmpfilename);
|
//ESP_LOGD(TAG, "file name to compare: %s", cmpfilename);
|
||||||
string folderName = string(cmpfilename).LOGFILE_TIME_FORMAT_DATE_EXTR;
|
string folderName = string(cmpfilename).LOGFILE_TIME_FORMAT_DATE_EXTR;
|
||||||
|
|
||||||
DIR *dir = opendir(LogImageLocation.c_str());
|
DIR *dir = opendir(imagesLocation.c_str());
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
ESP_LOGE(TAG, "Failed to stat dir: %s", LogImageLocation.c_str());
|
ESP_LOGE(TAG, "Failed to stat dir: %s", imagesLocation.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ void ClassFlowImage::RemoveOldLogs()
|
|||||||
int deleted = 0;
|
int deleted = 0;
|
||||||
int notDeleted = 0;
|
int notDeleted = 0;
|
||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
string folderPath = LogImageLocation + "/" + entry->d_name;
|
string folderPath = imagesLocation + "/" + entry->d_name;
|
||||||
if (entry->d_type == DT_DIR) {
|
if (entry->d_type == DT_DIR) {
|
||||||
//ESP_LOGD(TAG, "Compare %s to %s", entry->d_name, folderName.c_str());
|
//ESP_LOGD(TAG, "Compare %s to %s", entry->d_name, folderName.c_str());
|
||||||
if ((strlen(entry->d_name) == folderName.length()) && (strcmp(entry->d_name, folderName.c_str()) < 0)) {
|
if ((strlen(entry->d_name) == folderName.length()) && (strcmp(entry->d_name, folderName.c_str()) < 0)) {
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ using namespace std;
|
|||||||
class ClassFlowImage : public ClassFlow
|
class ClassFlowImage : public ClassFlow
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
string LogImageLocation;
|
string imagesLocation;
|
||||||
bool isLogImage;
|
bool isLogImage;
|
||||||
unsigned short logfileRetentionInDays;
|
unsigned short imagesRetention;
|
||||||
const char* logTag;
|
const char* logTag;
|
||||||
|
|
||||||
string CreateLogFolder(string time);
|
string CreateLogFolder(string time);
|
||||||
|
|||||||
219
code/components/jomjol_flowcontroll/ClassFlowInfluxDBv2.cpp
Normal file
219
code/components/jomjol_flowcontroll/ClassFlowInfluxDBv2.cpp
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
#ifdef ENABLE_INFLUXDB
|
||||||
|
#include <sstream>
|
||||||
|
#include "ClassFlowInfluxDBv2.h"
|
||||||
|
#include "Helper.h"
|
||||||
|
#include "connect_wlan.h"
|
||||||
|
|
||||||
|
#include "time_sntp.h"
|
||||||
|
#include "interface_influxdb.h"
|
||||||
|
|
||||||
|
#include "ClassFlowPostProcessing.h"
|
||||||
|
#include "esp_log.h"
|
||||||
|
#include "../../include/defines.h"
|
||||||
|
|
||||||
|
#include "ClassLogFile.h"
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
static const char* TAG = "class_flow_influxDbv2";
|
||||||
|
|
||||||
|
void ClassFlowInfluxDBv2::SetInitialParameter(void)
|
||||||
|
{
|
||||||
|
uri = "";
|
||||||
|
database = "";
|
||||||
|
measurement = "";
|
||||||
|
dborg = "";
|
||||||
|
dbtoken = "";
|
||||||
|
// dbfield = "";
|
||||||
|
|
||||||
|
OldValue = "";
|
||||||
|
flowpostprocessing = NULL;
|
||||||
|
previousElement = NULL;
|
||||||
|
ListFlowControll = NULL;
|
||||||
|
disabled = false;
|
||||||
|
InfluxDBenable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClassFlowInfluxDBv2::ClassFlowInfluxDBv2()
|
||||||
|
{
|
||||||
|
SetInitialParameter();
|
||||||
|
}
|
||||||
|
|
||||||
|
ClassFlowInfluxDBv2::ClassFlowInfluxDBv2(std::vector<ClassFlow*>* lfc)
|
||||||
|
{
|
||||||
|
SetInitialParameter();
|
||||||
|
|
||||||
|
ListFlowControll = lfc;
|
||||||
|
for (int i = 0; i < ListFlowControll->size(); ++i)
|
||||||
|
{
|
||||||
|
if (((*ListFlowControll)[i])->name().compare("ClassFlowPostProcessing") == 0)
|
||||||
|
{
|
||||||
|
flowpostprocessing = (ClassFlowPostProcessing*) (*ListFlowControll)[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ClassFlowInfluxDBv2::ClassFlowInfluxDBv2(std::vector<ClassFlow*>* lfc, ClassFlow *_prev)
|
||||||
|
{
|
||||||
|
SetInitialParameter();
|
||||||
|
|
||||||
|
previousElement = _prev;
|
||||||
|
ListFlowControll = lfc;
|
||||||
|
|
||||||
|
for (int i = 0; i < ListFlowControll->size(); ++i)
|
||||||
|
{
|
||||||
|
if (((*ListFlowControll)[i])->name().compare("ClassFlowPostProcessing") == 0)
|
||||||
|
{
|
||||||
|
flowpostprocessing = (ClassFlowPostProcessing*) (*ListFlowControll)[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool ClassFlowInfluxDBv2::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||||
|
{
|
||||||
|
std::vector<string> splitted;
|
||||||
|
|
||||||
|
aktparamgraph = trim(aktparamgraph);
|
||||||
|
printf("akt param: %s\n", aktparamgraph.c_str());
|
||||||
|
|
||||||
|
if (aktparamgraph.size() == 0)
|
||||||
|
if (!this->GetNextParagraph(pfile, aktparamgraph))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (toUpper(aktparamgraph).compare("[INFLUXDBV2]") != 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
||||||
|
{
|
||||||
|
// ESP_LOGD(TAG, "while loop reading line: %s", aktparamgraph.c_str());
|
||||||
|
splitted = ZerlegeZeile(aktparamgraph);
|
||||||
|
std::string _param = GetParameterName(splitted[0]);
|
||||||
|
|
||||||
|
if ((toUpper(_param) == "ORG") && (splitted.size() > 1))
|
||||||
|
{
|
||||||
|
this->dborg = splitted[1];
|
||||||
|
}
|
||||||
|
if ((toUpper(_param) == "TOKEN") && (splitted.size() > 1))
|
||||||
|
{
|
||||||
|
this->dbtoken = splitted[1];
|
||||||
|
}
|
||||||
|
if ((toUpper(_param) == "URI") && (splitted.size() > 1))
|
||||||
|
{
|
||||||
|
this->uri = splitted[1];
|
||||||
|
}
|
||||||
|
if (((toUpper(_param) == "MEASUREMENT")) && (splitted.size() > 1))
|
||||||
|
{
|
||||||
|
this->measurement = splitted[1];
|
||||||
|
}
|
||||||
|
if (((toUpper(_param) == "FIELDNAME")) && (splitted.size() > 1))
|
||||||
|
{
|
||||||
|
handleFieldname(splitted[0], splitted[1]);
|
||||||
|
}
|
||||||
|
if (((toUpper(splitted[0]) == "DATABASE")) && (splitted.size() > 1))
|
||||||
|
{
|
||||||
|
this->database = splitted[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("uri: %s\n", uri.c_str());
|
||||||
|
printf("measurement: %s\n", measurement.c_str());
|
||||||
|
printf("org: %s\n", dborg.c_str());
|
||||||
|
printf("token: %s\n", dbtoken.c_str());
|
||||||
|
|
||||||
|
if ((uri.length() > 0) && (database.length() > 0) && (measurement.length() > 0) && (dbtoken.length() > 0) && (dborg.length() > 0))
|
||||||
|
{
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Init InfluxDB with uri: " + uri + ", measurement: " + measurement + ", org: " + dborg + ", token: *****");
|
||||||
|
// printf("vor V2 Init\n");
|
||||||
|
InfluxDB_V2_Init(uri, database, measurement, dborg, dbtoken);
|
||||||
|
// printf("nach V2 Init\n");
|
||||||
|
InfluxDBenable = true;
|
||||||
|
} else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "InfluxDBv2 (Verion2 !!!) init skipped as we are missing some parameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string ClassFlowInfluxDBv2::GetInfluxDBMeasurement()
|
||||||
|
{
|
||||||
|
return measurement;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClassFlowInfluxDBv2::handleFieldname(string _decsep, string _value)
|
||||||
|
{
|
||||||
|
string _digit, _decpos;
|
||||||
|
int _pospunkt = _decsep.find_first_of(".");
|
||||||
|
// ESP_LOGD(TAG, "Name: %s, Pospunkt: %d", _decsep.c_str(), _pospunkt);
|
||||||
|
if (_pospunkt > -1)
|
||||||
|
_digit = _decsep.substr(0, _pospunkt);
|
||||||
|
else
|
||||||
|
_digit = "default";
|
||||||
|
for (int j = 0; j < flowpostprocessing->NUMBERS.size(); ++j)
|
||||||
|
{
|
||||||
|
if (_digit == "default") // Set to default first (if nothing else is set)
|
||||||
|
{
|
||||||
|
flowpostprocessing->NUMBERS[j]->Fieldname = _value;
|
||||||
|
}
|
||||||
|
if (flowpostprocessing->NUMBERS[j]->name == _digit)
|
||||||
|
{
|
||||||
|
flowpostprocessing->NUMBERS[j]->Fieldname = _value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool ClassFlowInfluxDBv2::doFlow(string zwtime)
|
||||||
|
{
|
||||||
|
if (!InfluxDBenable)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
std::string result;
|
||||||
|
std::string resulterror = "";
|
||||||
|
std::string resultraw = "";
|
||||||
|
std::string resultrate = "";
|
||||||
|
std::string resulttimestamp = "";
|
||||||
|
string zw = "";
|
||||||
|
string namenumber = "";
|
||||||
|
|
||||||
|
if (flowpostprocessing)
|
||||||
|
{
|
||||||
|
std::vector<NumberPost*>* NUMBERS = flowpostprocessing->GetNumbers();
|
||||||
|
|
||||||
|
for (int i = 0; i < (*NUMBERS).size(); ++i)
|
||||||
|
{
|
||||||
|
result = (*NUMBERS)[i]->ReturnValue;
|
||||||
|
resultraw = (*NUMBERS)[i]->ReturnRawValue;
|
||||||
|
resulterror = (*NUMBERS)[i]->ErrorMessageText;
|
||||||
|
resultrate = (*NUMBERS)[i]->ReturnRateValue;
|
||||||
|
resulttimestamp = (*NUMBERS)[i]->timeStamp;
|
||||||
|
|
||||||
|
if ((*NUMBERS)[i]->Fieldname.length() > 0)
|
||||||
|
{
|
||||||
|
namenumber = (*NUMBERS)[i]->Fieldname;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
namenumber = (*NUMBERS)[i]->name;
|
||||||
|
if (namenumber == "default")
|
||||||
|
namenumber = "value";
|
||||||
|
else
|
||||||
|
namenumber = namenumber + "/value";
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("vor sende Influx_DB_V2 - namenumber. %s, result: %s, timestampt: %s", namenumber.c_str(), result.c_str(), resulttimestamp.c_str());
|
||||||
|
|
||||||
|
if (result.length() > 0)
|
||||||
|
InfluxDB_V2_Publish(namenumber, result, resulttimestamp);
|
||||||
|
// InfluxDB_V2_Publish(namenumber, result, resulttimestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OldValue = result;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //ENABLE_INFLUXDB
|
||||||
41
code/components/jomjol_flowcontroll/ClassFlowInfluxDBv2.h
Normal file
41
code/components/jomjol_flowcontroll/ClassFlowInfluxDBv2.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#ifdef ENABLE_INFLUXDB
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef CLASSFINFLUXDBv2_H
|
||||||
|
#define CLASSFINFLUXDBv2_H
|
||||||
|
|
||||||
|
#include "ClassFlow.h"
|
||||||
|
|
||||||
|
#include "ClassFlowPostProcessing.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class ClassFlowInfluxDBv2 :
|
||||||
|
public ClassFlow
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
std::string uri, database, measurement;
|
||||||
|
std::string dborg, dbtoken, dbfield;
|
||||||
|
std::string OldValue;
|
||||||
|
ClassFlowPostProcessing* flowpostprocessing;
|
||||||
|
bool InfluxDBenable;
|
||||||
|
|
||||||
|
void SetInitialParameter(void);
|
||||||
|
|
||||||
|
void handleFieldname(string _decsep, string _value);
|
||||||
|
|
||||||
|
public:
|
||||||
|
ClassFlowInfluxDBv2();
|
||||||
|
ClassFlowInfluxDBv2(std::vector<ClassFlow*>* lfc);
|
||||||
|
ClassFlowInfluxDBv2(std::vector<ClassFlow*>* lfc, ClassFlow *_prev);
|
||||||
|
|
||||||
|
string GetInfluxDBMeasurement();
|
||||||
|
|
||||||
|
bool ReadParameter(FILE* pfile, string& aktparamgraph);
|
||||||
|
bool doFlow(string time);
|
||||||
|
string name(){return "ClassFlowInfluxDBv2";};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //CLASSFINFLUXDBv2_H
|
||||||
|
#endif //ENABLE_INFLUXDB
|
||||||
@@ -42,7 +42,7 @@ void ClassFlowMQTT::SetInitialParameter(void)
|
|||||||
flowpostprocessing = NULL;
|
flowpostprocessing = NULL;
|
||||||
user = "";
|
user = "";
|
||||||
password = "";
|
password = "";
|
||||||
SetRetainFlag = 0;
|
SetRetainFlag = false;
|
||||||
previousElement = NULL;
|
previousElement = NULL;
|
||||||
ListFlowControll = NULL;
|
ListFlowControll = NULL;
|
||||||
disabled = false;
|
disabled = false;
|
||||||
@@ -95,7 +95,7 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
if (!this->GetNextParagraph(pfile, aktparamgraph))
|
if (!this->GetNextParagraph(pfile, aktparamgraph))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (toUpper(aktparamgraph).compare("[MQTT]") != 0) // Paragraph does not fit MakeImage
|
if (toUpper(aktparamgraph).compare("[MQTT]") != 0) // Paragraph does not fit MQTT
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
||||||
@@ -113,10 +113,10 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
{
|
{
|
||||||
this->uri = splitted[1];
|
this->uri = splitted[1];
|
||||||
}
|
}
|
||||||
if ((toUpper(splitted[0]) == "SETRETAINFLAG") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "RETAINMESSAGES") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
if (toUpper(splitted[1]) == "TRUE") {
|
if (toUpper(splitted[1]) == "TRUE") {
|
||||||
SetRetainFlag = 1;
|
SetRetainFlag = true;
|
||||||
setMqtt_Server_Retain(SetRetainFlag);
|
setMqtt_Server_Retain(SetRetainFlag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,9 +184,9 @@ string ClassFlowMQTT::GetMQTTMainTopic()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ClassFlowMQTT::Start(float AutoIntervall)
|
bool ClassFlowMQTT::Start(float AutoInterval)
|
||||||
{
|
{
|
||||||
roundInterval = AutoIntervall; // Minutes
|
roundInterval = AutoInterval; // Minutes
|
||||||
keepAlive = roundInterval * 60 * 2.5; // Seconds, make sure it is greater thatn 2 rounds!
|
keepAlive = roundInterval * 60 * 2.5; // Seconds, make sure it is greater thatn 2 rounds!
|
||||||
|
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ protected:
|
|||||||
std::string OldValue;
|
std::string OldValue;
|
||||||
ClassFlowPostProcessing* flowpostprocessing;
|
ClassFlowPostProcessing* flowpostprocessing;
|
||||||
std::string user, password;
|
std::string user, password;
|
||||||
int SetRetainFlag;
|
bool SetRetainFlag;
|
||||||
int keepAlive; // Seconds
|
int keepAlive; // Seconds
|
||||||
float roundInterval; // Minutes
|
float roundInterval; // Minutes
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ public:
|
|||||||
ClassFlowMQTT(std::vector<ClassFlow*>* lfc, ClassFlow *_prev);
|
ClassFlowMQTT(std::vector<ClassFlow*>* lfc, ClassFlow *_prev);
|
||||||
|
|
||||||
string GetMQTTMainTopic();
|
string GetMQTTMainTopic();
|
||||||
bool Start(float AutoIntervall);
|
bool Start(float AutoInterval);
|
||||||
|
|
||||||
bool ReadParameter(FILE* pfile, string& aktparamgraph);
|
bool ReadParameter(FILE* pfile, string& aktparamgraph);
|
||||||
bool doFlow(string time);
|
bool doFlow(string time);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "ClassFlowPostProcessing.h"
|
#include "ClassFlowPostProcessing.h"
|
||||||
#include "Helper.h"
|
#include "Helper.h"
|
||||||
#include "ClassFlowMakeImage.h"
|
#include "ClassFlowTakeImage.h"
|
||||||
#include "ClassLogFile.h"
|
#include "ClassLogFile.h"
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@@ -285,7 +285,7 @@ ClassFlowPostProcessing::ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc, C
|
|||||||
ListFlowControll = NULL;
|
ListFlowControll = NULL;
|
||||||
FilePreValue = FormatFileName("/sdcard/config/prevalue.ini");
|
FilePreValue = FormatFileName("/sdcard/config/prevalue.ini");
|
||||||
ListFlowControll = lfc;
|
ListFlowControll = lfc;
|
||||||
flowMakeImage = NULL;
|
flowTakeImage = NULL;
|
||||||
UpdatePreValueINI = false;
|
UpdatePreValueINI = false;
|
||||||
IgnoreLeadingNaN = false;
|
IgnoreLeadingNaN = false;
|
||||||
flowAnalog = _analog;
|
flowAnalog = _analog;
|
||||||
@@ -293,9 +293,9 @@ ClassFlowPostProcessing::ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc, C
|
|||||||
|
|
||||||
for (int i = 0; i < ListFlowControll->size(); ++i)
|
for (int i = 0; i < ListFlowControll->size(); ++i)
|
||||||
{
|
{
|
||||||
if (((*ListFlowControll)[i])->name().compare("ClassFlowMakeImage") == 0)
|
if (((*ListFlowControll)[i])->name().compare("ClassFlowTakeImage") == 0)
|
||||||
{
|
{
|
||||||
flowMakeImage = (ClassFlowMakeImage*) (*ListFlowControll)[i];
|
flowTakeImage = (ClassFlowTakeImage*) (*ListFlowControll)[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -503,7 +503,7 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
if (aktparamgraph.compare("[PostProcessing]") != 0) // Paragraph does not fit MakeImage
|
if (aktparamgraph.compare("[PostProcessing]") != 0) // Paragraph does not fit PostProcessing
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
InitNUMBERS();
|
InitNUMBERS();
|
||||||
@@ -715,7 +715,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
|||||||
|
|
||||||
// Update decimal point, as the decimal places can also change when changing from CNNType Auto --> xyz:
|
// Update decimal point, as the decimal places can also change when changing from CNNType Auto --> xyz:
|
||||||
|
|
||||||
imagetime = flowMakeImage->getTimeImageTaken();
|
imagetime = flowTakeImage->getTimeImageTaken();
|
||||||
if (imagetime == 0)
|
if (imagetime == 0)
|
||||||
time(&imagetime);
|
time(&imagetime);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#define CLASSFFLOWPOSTPROCESSING_H
|
#define CLASSFFLOWPOSTPROCESSING_H
|
||||||
|
|
||||||
#include "ClassFlow.h"
|
#include "ClassFlow.h"
|
||||||
#include "ClassFlowMakeImage.h"
|
#include "ClassFlowTakeImage.h"
|
||||||
#include "ClassFlowCNNGeneral.h"
|
#include "ClassFlowCNNGeneral.h"
|
||||||
#include "ClassFlowDefineTypes.h"
|
#include "ClassFlowDefineTypes.h"
|
||||||
|
|
||||||
@@ -15,7 +15,6 @@ class ClassFlowPostProcessing :
|
|||||||
public ClassFlow
|
public ClassFlow
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::vector<NumberPost*> NUMBERS;
|
|
||||||
bool UpdatePreValueINI;
|
bool UpdatePreValueINI;
|
||||||
|
|
||||||
int PreValueAgeStartup;
|
int PreValueAgeStartup;
|
||||||
@@ -29,7 +28,7 @@ protected:
|
|||||||
|
|
||||||
string FilePreValue;
|
string FilePreValue;
|
||||||
|
|
||||||
ClassFlowMakeImage *flowMakeImage;
|
ClassFlowTakeImage *flowTakeImage;
|
||||||
|
|
||||||
bool LoadPreValue(void);
|
bool LoadPreValue(void);
|
||||||
string ShiftDecimal(string in, int _decShift);
|
string ShiftDecimal(string in, int _decShift);
|
||||||
@@ -54,6 +53,8 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
bool PreValueUse;
|
bool PreValueUse;
|
||||||
|
std::vector<NumberPost*> NUMBERS;
|
||||||
|
|
||||||
|
|
||||||
ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc, ClassFlowCNNGeneral *_analog, ClassFlowCNNGeneral *_digit);
|
ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc, ClassFlowCNNGeneral *_analog, ClassFlowCNNGeneral *_digit);
|
||||||
virtual ~ClassFlowPostProcessing(){};
|
virtual ~ClassFlowPostProcessing(){};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "ClassFlowMakeImage.h"
|
#include "ClassFlowTakeImage.h"
|
||||||
#include "Helper.h"
|
#include "Helper.h"
|
||||||
#include "ClassLogFile.h"
|
#include "ClassLogFile.h"
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
static const char* TAG = "flow_make_image";
|
static const char* TAG = "flow_make_image";
|
||||||
|
|
||||||
esp_err_t ClassFlowMakeImage::camera_capture(){
|
esp_err_t ClassFlowTakeImage::camera_capture(){
|
||||||
string nm = namerawimage;
|
string nm = namerawimage;
|
||||||
Camera.CaptureToFile(nm);
|
Camera.CaptureToFile(nm);
|
||||||
time(&TimeImageTaken);
|
time(&TimeImageTaken);
|
||||||
@@ -26,7 +26,7 @@ esp_err_t ClassFlowMakeImage::camera_capture(){
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassFlowMakeImage::takePictureWithFlash(int flash_duration)
|
void ClassFlowTakeImage::takePictureWithFlash(int flash_duration)
|
||||||
{
|
{
|
||||||
// in case the image is flipped, it must be reset here //
|
// in case the image is flipped, it must be reset here //
|
||||||
rawImage->width = image_width;
|
rawImage->width = image_width;
|
||||||
@@ -40,7 +40,7 @@ void ClassFlowMakeImage::takePictureWithFlash(int flash_duration)
|
|||||||
if (SaveAllFiles) rawImage->SaveToFile(namerawimage);
|
if (SaveAllFiles) rawImage->SaveToFile(namerawimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassFlowMakeImage::SetInitialParameter(void)
|
void ClassFlowTakeImage::SetInitialParameter(void)
|
||||||
{
|
{
|
||||||
waitbeforepicture = 5;
|
waitbeforepicture = 5;
|
||||||
isImageSize = false;
|
isImageSize = false;
|
||||||
@@ -56,15 +56,15 @@ void ClassFlowMakeImage::SetInitialParameter(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ClassFlowMakeImage::ClassFlowMakeImage(std::vector<ClassFlow*>* lfc) : ClassFlowImage(lfc, TAG)
|
ClassFlowTakeImage::ClassFlowTakeImage(std::vector<ClassFlow*>* lfc) : ClassFlowImage(lfc, TAG)
|
||||||
{
|
{
|
||||||
LogImageLocation = "/log/source";
|
imagesLocation = "/log/source";
|
||||||
logfileRetentionInDays = 5;
|
imagesRetention = 5;
|
||||||
SetInitialParameter();
|
SetInitialParameter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
bool ClassFlowTakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
||||||
{
|
{
|
||||||
std::vector<string> splitted;
|
std::vector<string> splitted;
|
||||||
|
|
||||||
@@ -77,21 +77,21 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
if (!this->GetNextParagraph(pfile, aktparamgraph))
|
if (!this->GetNextParagraph(pfile, aktparamgraph))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (aktparamgraph.compare("[MakeImage]") != 0) // Paragraph does not fit MakeImage
|
if (aktparamgraph.compare("[TakeImage]") != 0) // Paragraph does not fit TakeImage
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
|
||||||
{
|
{
|
||||||
splitted = ZerlegeZeile(aktparamgraph);
|
splitted = ZerlegeZeile(aktparamgraph);
|
||||||
if ((splitted[0] == "LogImageLocation") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "RAWIMAGESLOCATION") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
LogImageLocation = "/sdcard" + splitted[1];
|
imagesLocation = "/sdcard" + splitted[1];
|
||||||
isLogImage = true;
|
isLogImage = true;
|
||||||
}
|
}
|
||||||
if ((splitted[0] == "ImageQuality") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "IMAGEQUALITY") && (splitted.size() > 1))
|
||||||
ImageQuality = std::stod(splitted[1]);
|
ImageQuality = std::stod(splitted[1]);
|
||||||
|
|
||||||
if ((splitted[0] == "ImageSize") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "IMAGESIZE") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
ImageSize = Camera.TextToFramesize(splitted[1].c_str());
|
ImageSize = Camera.TextToFramesize(splitted[1].c_str());
|
||||||
isImageSize = true;
|
isImageSize = true;
|
||||||
@@ -108,9 +108,9 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
waitbeforepicture = stoi(splitted[1]);
|
waitbeforepicture = stoi(splitted[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "LOGFILERETENTIONINDAYS") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "RAWIMAGESRETENTION") && (splitted.size() > 1))
|
||||||
{
|
{
|
||||||
this->logfileRetentionInDays = std::stoi(splitted[1]);
|
this->imagesRetention = std::stoi(splitted[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((toUpper(splitted[0]) == "BRIGHTNESS") && (splitted.size() > 1))
|
if ((toUpper(splitted[0]) == "BRIGHTNESS") && (splitted.size() > 1))
|
||||||
@@ -173,7 +173,7 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string ClassFlowMakeImage::getHTMLSingleStep(string host)
|
string ClassFlowTakeImage::getHTMLSingleStep(string host)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
result = "Raw Image: <br>\n<img src=\"" + host + "/img_tmp/raw.jpg\">\n";
|
result = "Raw Image: <br>\n<img src=\"" + host + "/img_tmp/raw.jpg\">\n";
|
||||||
@@ -181,14 +181,14 @@ string ClassFlowMakeImage::getHTMLSingleStep(string host)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ClassFlowMakeImage::doFlow(string zwtime)
|
bool ClassFlowTakeImage::doFlow(string zwtime)
|
||||||
{
|
{
|
||||||
string logPath = CreateLogFolder(zwtime);
|
string logPath = CreateLogFolder(zwtime);
|
||||||
|
|
||||||
int flash_duration = (int) (waitbeforepicture * 1000);
|
int flash_duration = (int) (waitbeforepicture * 1000);
|
||||||
|
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - Before takePictureWithFlash");
|
LogFile.WriteHeapInfo("ClassFlowTakeImage::doFlow - Before takePictureWithFlash");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - After takePictureWithFlash");
|
LogFile.WriteHeapInfo("ClassFlowTakeImage::doFlow - After takePictureWithFlash");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LogImage(logPath, "raw", NULL, NULL, zwtime, rawImage);
|
LogImage(logPath, "raw", NULL, NULL, zwtime, rawImage);
|
||||||
@@ -212,14 +212,14 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
|
|||||||
RemoveOldLogs();
|
RemoveOldLogs();
|
||||||
|
|
||||||
#ifdef DEBUG_DETAIL_ON
|
#ifdef DEBUG_DETAIL_ON
|
||||||
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - After RemoveOldLogs");
|
LogFile.WriteHeapInfo("ClassFlowTakeImage::doFlow - After RemoveOldLogs");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
esp_err_t ClassFlowMakeImage::SendRawJPG(httpd_req_t *req)
|
esp_err_t ClassFlowTakeImage::SendRawJPG(httpd_req_t *req)
|
||||||
{
|
{
|
||||||
int flash_duration = (int) (waitbeforepicture * 1000);
|
int flash_duration = (int) (waitbeforepicture * 1000);
|
||||||
time(&TimeImageTaken);
|
time(&TimeImageTaken);
|
||||||
@@ -229,7 +229,7 @@ esp_err_t ClassFlowMakeImage::SendRawJPG(httpd_req_t *req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ImageData* ClassFlowMakeImage::SendRawImage()
|
ImageData* ClassFlowTakeImage::SendRawImage()
|
||||||
{
|
{
|
||||||
CImageBasis *zw = new CImageBasis(rawImage);
|
CImageBasis *zw = new CImageBasis(rawImage);
|
||||||
ImageData *id;
|
ImageData *id;
|
||||||
@@ -243,12 +243,12 @@ ImageData* ClassFlowMakeImage::SendRawImage()
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t ClassFlowMakeImage::getTimeImageTaken()
|
time_t ClassFlowTakeImage::getTimeImageTaken()
|
||||||
{
|
{
|
||||||
return TimeImageTaken;
|
return TimeImageTaken;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassFlowMakeImage::~ClassFlowMakeImage(void)
|
ClassFlowTakeImage::~ClassFlowTakeImage(void)
|
||||||
{
|
{
|
||||||
delete rawImage;
|
delete rawImage;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef CLASSFFLOWMAKEIMAGE_H
|
#ifndef CLASSFFLOWTAKEIMAGE_H
|
||||||
#define CLASSFFLOWMAKEIMAGE_H
|
#define CLASSFFLOWTAKEIMAGE_H
|
||||||
|
|
||||||
#include "ClassFlowImage.h"
|
#include "ClassFlowImage.h"
|
||||||
#include "ClassControllCamera.h"
|
#include "ClassControllCamera.h"
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class ClassFlowMakeImage :
|
class ClassFlowTakeImage :
|
||||||
public ClassFlowImage
|
public ClassFlowImage
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@@ -37,19 +37,19 @@ protected:
|
|||||||
public:
|
public:
|
||||||
CImageBasis *rawImage;
|
CImageBasis *rawImage;
|
||||||
|
|
||||||
ClassFlowMakeImage(std::vector<ClassFlow*>* lfc);
|
ClassFlowTakeImage(std::vector<ClassFlow*>* lfc);
|
||||||
|
|
||||||
bool ReadParameter(FILE* pfile, string& aktparamgraph);
|
bool ReadParameter(FILE* pfile, string& aktparamgraph);
|
||||||
bool doFlow(string time);
|
bool doFlow(string time);
|
||||||
string getHTMLSingleStep(string host);
|
string getHTMLSingleStep(string host);
|
||||||
time_t getTimeImageTaken();
|
time_t getTimeImageTaken();
|
||||||
string name(){return "ClassFlowMakeImage";};
|
string name(){return "ClassFlowTakeImage";};
|
||||||
|
|
||||||
ImageData* SendRawImage();
|
ImageData* SendRawImage();
|
||||||
esp_err_t SendRawJPG(httpd_req_t *req);
|
esp_err_t SendRawJPG(httpd_req_t *req);
|
||||||
|
|
||||||
~ClassFlowMakeImage(void);
|
~ClassFlowTakeImage(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif //CLASSFFLOWMAKEIMAGE_H
|
#endif //CLASSFFLOWTAKEIMAGE_H
|
||||||
@@ -224,15 +224,50 @@ void FindReplace(std::string& line, std::string& oldString, std::string& newStri
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MakeDir(std::string _what)
|
/**
|
||||||
|
* Create a folder and its parent folders as needed
|
||||||
|
*/
|
||||||
|
bool MakeDir(std::string path)
|
||||||
{
|
{
|
||||||
int mk_ret = mkdir(_what.c_str(), 0775);
|
std::string parent;
|
||||||
if (mk_ret)
|
|
||||||
{
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Creating folder " + path + "...");
|
||||||
ESP_LOGD(TAG, "error with mkdir %s ret %d", _what.c_str(), mk_ret);
|
|
||||||
return false;
|
bool bSuccess = false;
|
||||||
|
int nRC = ::mkdir( path.c_str(), 0775 );
|
||||||
|
if( nRC == -1 )
|
||||||
|
{
|
||||||
|
switch( errno ) {
|
||||||
|
case ENOENT:
|
||||||
|
//parent didn't exist, try to create it
|
||||||
|
parent = path.substr(0, path.find_last_of('/'));
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Need to create parent folder first: " + parent);
|
||||||
|
if(MakeDir(parent)) {
|
||||||
|
//Now, try to create again.
|
||||||
|
bSuccess = 0 == ::mkdir( path.c_str(), 0775 );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to create parent folder: " + parent);
|
||||||
|
bSuccess = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EEXIST:
|
||||||
|
//Done!
|
||||||
|
bSuccess = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to create folder: " + path);
|
||||||
|
bSuccess = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bSuccess = true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
return bSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -576,9 +611,6 @@ std::vector<string> HelperZerlegeZeile(std::string input, std::string _delimiter
|
|||||||
std::vector<string> ZerlegeZeile(std::string input, std::string delimiter)
|
std::vector<string> ZerlegeZeile(std::string input, std::string delimiter)
|
||||||
{
|
{
|
||||||
std::vector<string> Output;
|
std::vector<string> Output;
|
||||||
|
|
||||||
input = trim(input, delimiter);
|
|
||||||
|
|
||||||
/* The input can have multiple formats:
|
/* The input can have multiple formats:
|
||||||
* - key = value
|
* - key = value
|
||||||
* - key = value1 value2 value3 ...
|
* - key = value1 value2 value3 ...
|
||||||
@@ -593,12 +625,13 @@ std::vector<string> ZerlegeZeile(std::string input, std::string delimiter)
|
|||||||
* As a workaround and to not break any legacy usage, we enforce to only use the
|
* As a workaround and to not break any legacy usage, we enforce to only use the
|
||||||
* equal sign, if the key is "password"
|
* equal sign, if the key is "password"
|
||||||
*/
|
*/
|
||||||
if (input.find("password") != string::npos) { // Line contains a password, use the equal sign as the only delimiter and only split on first occurrence
|
if ((input.find("password") != string::npos) || (input.find("Token") != string::npos)) { // Line contains a password, use the equal sign as the only delimiter and only split on first occurrence
|
||||||
size_t pos = input.find("=");
|
size_t pos = input.find("=");
|
||||||
Output.push_back(trim(input.substr(0, pos), ""));
|
Output.push_back(trim(input.substr(0, pos), ""));
|
||||||
Output.push_back(trim(input.substr(pos +1, string::npos), ""));
|
Output.push_back(trim(input.substr(pos +1, string::npos), ""));
|
||||||
}
|
}
|
||||||
else { // Legacy Mode
|
else { // Legacy Mode
|
||||||
|
input = trim(input, delimiter); // sonst werden delimiter am Ende (z.B. == im Token) gelöscht)
|
||||||
size_t pos = findDelimiterPos(input, delimiter);
|
size_t pos = findDelimiterPos(input, delimiter);
|
||||||
std::string token;
|
std::string token;
|
||||||
while (pos != std::string::npos) {
|
while (pos != std::string::npos) {
|
||||||
@@ -900,3 +933,33 @@ const char* get404(void) {
|
|||||||
" You could try your <a href=index.html target=_parent>luck</a> here!</pre>\n"
|
" You could try your <a href=index.html target=_parent>luck</a> here!</pre>\n"
|
||||||
"<script>document.cookie = \"page=overview.html\"</script>"; // Make sure we load the overview page
|
"<script>document.cookie = \"page=overview.html\"</script>"; // Make sure we load the overview page
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string UrlDecode(const std::string& value)
|
||||||
|
{
|
||||||
|
std::string result;
|
||||||
|
result.reserve(value.size());
|
||||||
|
|
||||||
|
for (std::size_t i = 0; i < value.size(); ++i)
|
||||||
|
{
|
||||||
|
auto ch = value[i];
|
||||||
|
|
||||||
|
if (ch == '%' && (i + 2) < value.size())
|
||||||
|
{
|
||||||
|
auto hex = value.substr(i + 1, 2);
|
||||||
|
auto dec = static_cast<char>(std::strtol(hex.c_str(), nullptr, 16));
|
||||||
|
result.push_back(dec);
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
else if (ch == '+')
|
||||||
|
{
|
||||||
|
result.push_back(' ');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result.push_back(ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@@ -93,4 +93,6 @@ std::string getFormatedUptime(bool compact);
|
|||||||
|
|
||||||
const char* get404(void);
|
const char* get404(void);
|
||||||
|
|
||||||
|
std::string UrlDecode(const std::string& value);
|
||||||
|
|
||||||
#endif //HELPER_H
|
#endif //HELPER_H
|
||||||
|
|||||||
214
code/components/jomjol_influxdb/interface_influxdb._c_pp_old
Normal file
214
code/components/jomjol_influxdb/interface_influxdb._c_pp_old
Normal file
@@ -0,0 +1,214 @@
|
|||||||
|
#ifdef ENABLE_INFLUXDB
|
||||||
|
#include "interface_influxdb.h"
|
||||||
|
|
||||||
|
#include "esp_log.h"
|
||||||
|
#include <time.h>
|
||||||
|
#include "ClassLogFile.h"
|
||||||
|
#include "esp_http_client.h"
|
||||||
|
#include "../../include/defines.h"
|
||||||
|
|
||||||
|
|
||||||
|
static const char *TAG = "INFLUXDB";
|
||||||
|
|
||||||
|
std::string _influxDBURI;
|
||||||
|
std::string _influxDBDatabase;
|
||||||
|
std::string _influxDBMeasurement;
|
||||||
|
std::string _influxDBUser;
|
||||||
|
std::string _influxDBPassword;
|
||||||
|
|
||||||
|
static esp_err_t http_event_handler(esp_http_client_event_t *evt)
|
||||||
|
{
|
||||||
|
switch(evt->event_id)
|
||||||
|
{
|
||||||
|
case HTTP_EVENT_ERROR:
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client Error encountered");
|
||||||
|
break;
|
||||||
|
case HTTP_EVENT_ON_CONNECTED:
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client Error encountered");
|
||||||
|
ESP_LOGI(TAG, "HTTP Client Connected");
|
||||||
|
break;
|
||||||
|
case HTTP_EVENT_HEADERS_SENT:
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client sent all request headers");
|
||||||
|
break;
|
||||||
|
case HTTP_EVENT_ON_HEADER:
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Header: key=" + std::string(evt->header_key) + ", value=" + std::string(evt->header_value));
|
||||||
|
break;
|
||||||
|
case HTTP_EVENT_ON_DATA:
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client data recevied: len=" + std::to_string(evt->data_len));
|
||||||
|
break;
|
||||||
|
case HTTP_EVENT_ON_FINISH:
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client finished");
|
||||||
|
break;
|
||||||
|
case HTTP_EVENT_DISCONNECTED:
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP Client Disconnected");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InfluxDBPublish(std::string _key, std::string _content, std::string _timestamp) {
|
||||||
|
char response_buffer[MAX_HTTP_OUTPUT_BUFFER] = {0};
|
||||||
|
esp_http_client_config_t http_config = {
|
||||||
|
.user_agent = "ESP32 Meter reader",
|
||||||
|
.method = HTTP_METHOD_POST,
|
||||||
|
.event_handler = http_event_handler,
|
||||||
|
.buffer_size = MAX_HTTP_OUTPUT_BUFFER,
|
||||||
|
.user_data = response_buffer
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_influxDBUser.length() && _influxDBPassword.length()){
|
||||||
|
http_config.username = _influxDBUser.c_str();
|
||||||
|
http_config.password = _influxDBPassword.c_str();
|
||||||
|
http_config.auth_type = HTTP_AUTH_TYPE_BASIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "InfluxDBPublish - Key: " + _key + ", Content: " + _content + ", Timestamp: " + _timestamp);
|
||||||
|
|
||||||
|
char nowTimestamp[21];
|
||||||
|
std::string payload;
|
||||||
|
|
||||||
|
if (_timestamp.length() > 0)
|
||||||
|
{
|
||||||
|
struct tm tm;
|
||||||
|
strptime(_timestamp.c_str(), PREVALUE_TIME_FORMAT_OUTPUT, &tm);
|
||||||
|
time_t t = mktime(&tm); // Time in Localtime (looks like timezone is not used by strptime)
|
||||||
|
|
||||||
|
struct tm * ptm;
|
||||||
|
ptm = gmtime ( &t );
|
||||||
|
time_t utc = mktime(ptm);
|
||||||
|
utc = 2*t - utc; // Take care of timezone (looks difficult, but is easy: t = t + (t - utc), weil t-utc = timezone)
|
||||||
|
|
||||||
|
sprintf(nowTimestamp,"%ld000000000", (long) utc); // UTC
|
||||||
|
|
||||||
|
payload = _influxDBMeasurement + " " + _key + "=" + _content + " " + nowTimestamp;
|
||||||
|
// payload = _influxDBMeasurement + " " + _key + "=774 " + nowTimestamp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
payload = _influxDBMeasurement + " " + _key + "=" + _content;
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.shrink_to_fit();
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "sending line to influxdb:" + payload);
|
||||||
|
|
||||||
|
|
||||||
|
// use the default retention policy of the database
|
||||||
|
std::string apiURI = _influxDBURI + "/api/v2/write?bucket=" + _influxDBDatabase + "/";
|
||||||
|
apiURI.shrink_to_fit();
|
||||||
|
http_config.url = apiURI.c_str();
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "API URI: " + apiURI);
|
||||||
|
|
||||||
|
esp_http_client_handle_t http_client = esp_http_client_init(&http_config);
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "client is initialized");
|
||||||
|
|
||||||
|
esp_http_client_set_header(http_client, "Content-Type", "text/plain");
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "header is set");
|
||||||
|
|
||||||
|
ESP_ERROR_CHECK(esp_http_client_set_post_field(http_client, payload.c_str(), payload.length()));
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "post payload is set");
|
||||||
|
|
||||||
|
esp_err_t err = ESP_ERROR_CHECK_WITHOUT_ABORT(esp_http_client_perform(http_client));
|
||||||
|
|
||||||
|
if( err == ESP_OK ) {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP request was performed");
|
||||||
|
int status_code = esp_http_client_get_status_code(http_client);
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP status code" + std::to_string(status_code));
|
||||||
|
} else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP request failed");
|
||||||
|
}
|
||||||
|
esp_http_client_cleanup(http_client);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
void InfluxDBPublish(std::string _key, std::string _content, std::string _timestamp) {
|
||||||
|
char response_buffer[MAX_HTTP_OUTPUT_BUFFER] = {0};
|
||||||
|
esp_http_client_config_t http_config = {
|
||||||
|
.user_agent = "ESP32 Meter reader",
|
||||||
|
.method = HTTP_METHOD_POST,
|
||||||
|
.event_handler = http_event_handler,
|
||||||
|
.buffer_size = MAX_HTTP_OUTPUT_BUFFER,
|
||||||
|
.user_data = response_buffer
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_influxDBUser.length() && _influxDBPassword.length()){
|
||||||
|
http_config.username = _influxDBUser.c_str();
|
||||||
|
http_config.password = _influxDBPassword.c_str();
|
||||||
|
http_config.auth_type = HTTP_AUTH_TYPE_BASIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "InfluxDBPublish - Key: " + _key + ", Content: " + _content + ", Timestamp: " + _timestamp);
|
||||||
|
|
||||||
|
// Format: #define PREVALUE_TIME_FORMAT_OUTPUT "%Y-%m-%dT%H:%M:%S%z"
|
||||||
|
struct tm tm;
|
||||||
|
strptime(_timestamp.c_str(), PREVALUE_TIME_FORMAT_OUTPUT, &tm);
|
||||||
|
time_t t = mktime(&tm); // t is now your desired time_t
|
||||||
|
|
||||||
|
struct tm * ptm;
|
||||||
|
ptm = gmtime ( &t );
|
||||||
|
time_t utc = mktime(ptm);
|
||||||
|
|
||||||
|
// time_t now;
|
||||||
|
// time(&now);
|
||||||
|
char nowTimestamp[21];
|
||||||
|
// pad with zeroes to get nanoseconds
|
||||||
|
// sprintf(nowTimestamp,"%ld000000000", (long) now);
|
||||||
|
// sprintf(nowTimestamp,"%ld000000000", (long) t); // Localtime
|
||||||
|
sprintf(nowTimestamp,"%ld000000000", (long) utc); // UTC
|
||||||
|
|
||||||
|
|
||||||
|
// LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Test Time Conversion - t: " + std::to_string(t) + ", utc: " + std::to_string(utc));
|
||||||
|
// LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Test Time Conversion - now: " + std::to_string(now) + ", timestamp: " + std::to_string(t) + "(correct time not used yet)");
|
||||||
|
|
||||||
|
std::string payload = _influxDBMeasurement + " " + _key + "=" + _content + " " + nowTimestamp;
|
||||||
|
payload.shrink_to_fit();
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "sending line to influxdb:" + payload);
|
||||||
|
|
||||||
|
|
||||||
|
// use the default retention policy of the database
|
||||||
|
std::string apiURI = _influxDBURI + "/api/v2/write?bucket=" + _influxDBDatabase + "/";
|
||||||
|
apiURI.shrink_to_fit();
|
||||||
|
http_config.url = apiURI.c_str();
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "API URI: " + apiURI);
|
||||||
|
|
||||||
|
esp_http_client_handle_t http_client = esp_http_client_init(&http_config);
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "client is initialized");
|
||||||
|
|
||||||
|
esp_http_client_set_header(http_client, "Content-Type", "text/plain");
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "header is set");
|
||||||
|
|
||||||
|
ESP_ERROR_CHECK(esp_http_client_set_post_field(http_client, payload.c_str(), payload.length()));
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "post payload is set");
|
||||||
|
|
||||||
|
esp_err_t err = ESP_ERROR_CHECK_WITHOUT_ABORT(esp_http_client_perform(http_client));
|
||||||
|
|
||||||
|
if( err == ESP_OK ) {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP request was performed");
|
||||||
|
int status_code = esp_http_client_get_status_code(http_client);
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP status code" + std::to_string(status_code));
|
||||||
|
} else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP request failed");
|
||||||
|
}
|
||||||
|
esp_http_client_cleanup(http_client);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
void InfluxDBInit(std::string _uri, std::string _database, std::string _measurement, std::string _user, std::string _password){
|
||||||
|
_influxDBURI = _uri;
|
||||||
|
_influxDBDatabase = _database;
|
||||||
|
_influxDBMeasurement = _measurement;
|
||||||
|
_influxDBUser = _user;
|
||||||
|
_influxDBPassword = _password;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void InfluxDBdestroy() {
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //ENABLE_INFLUXDB
|
||||||
24
code/components/jomjol_influxdb/interface_influxdb._h_old
Normal file
24
code/components/jomjol_influxdb/interface_influxdb._h_old
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#ifdef ENABLE_INFLUXDB
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#ifndef INTERFACE_INFLUXDB_H
|
||||||
|
#define INTERFACE_INFLUXDB_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
// Interface to InfluxDB v1.x
|
||||||
|
void InfluxDBInit(std::string _influxDBURI, std::string _database, std::string _measurement, std::string _user, std::string _password);
|
||||||
|
void InfluxDBPublish(std::string _key, std::string _content, std::string _timestamp);
|
||||||
|
|
||||||
|
// Interface to InfluxDB v2.x
|
||||||
|
void InfluxDB_V2_Init(std::string _uri, std::string _database, std::string _measurement, std::string _org, std::string _token);
|
||||||
|
void InfluxDB_V2_Publish(std::string _key, std::string _content, std::string _timestamp);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void InfluxDBdestroy();
|
||||||
|
|
||||||
|
#endif //INTERFACE_INFLUXDB_H
|
||||||
|
#endif //ENABLE_INFLUXDB
|
||||||
@@ -16,6 +16,101 @@ std::string _influxDBMeasurement;
|
|||||||
std::string _influxDBUser;
|
std::string _influxDBUser;
|
||||||
std::string _influxDBPassword;
|
std::string _influxDBPassword;
|
||||||
|
|
||||||
|
std::string _influxDB_V2_URI;
|
||||||
|
std::string _influxDB_V2_Database;
|
||||||
|
std::string _influxDB_V2_Measurement;
|
||||||
|
std::string _influxDB_V2_Token;
|
||||||
|
std::string _influxDB_V2_Org;
|
||||||
|
|
||||||
|
static esp_err_t http_event_handler(esp_http_client_event_t *evt);
|
||||||
|
|
||||||
|
void InfluxDB_V2_Init(std::string _uri, std::string _database, std::string _measurement, std::string _org, std::string _token)
|
||||||
|
{
|
||||||
|
_influxDB_V2_URI = _uri;
|
||||||
|
_influxDB_V2_Database = _database;
|
||||||
|
_influxDB_V2_Measurement = _measurement;
|
||||||
|
_influxDB_V2_Org = _org;
|
||||||
|
_influxDB_V2_Token = _token;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InfluxDB_V2_Publish(std::string _key, std::string _content, std::string _timestamp)
|
||||||
|
{
|
||||||
|
char response_buffer[MAX_HTTP_OUTPUT_BUFFER] = {0};
|
||||||
|
esp_http_client_config_t http_config = {
|
||||||
|
.user_agent = "ESP32 Meter reader",
|
||||||
|
.method = HTTP_METHOD_POST,
|
||||||
|
.event_handler = http_event_handler,
|
||||||
|
.buffer_size = MAX_HTTP_OUTPUT_BUFFER,
|
||||||
|
.user_data = response_buffer
|
||||||
|
};
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "InfluxDB_V2_Publish - Key: " + _key + ", Content: " + _content + ", Timestamp: " + _timestamp);
|
||||||
|
|
||||||
|
// Format: #define PREVALUE_TIME_FORMAT_OUTPUT "%Y-%m-%dT%H:%M:%S%z"
|
||||||
|
|
||||||
|
char nowTimestamp[21];
|
||||||
|
std::string payload;
|
||||||
|
|
||||||
|
if (_timestamp.length() > 0)
|
||||||
|
{
|
||||||
|
struct tm tm;
|
||||||
|
strptime(_timestamp.c_str(), PREVALUE_TIME_FORMAT_OUTPUT, &tm);
|
||||||
|
time_t t = mktime(&tm); // Time in Localtime (looks like timezone is not used by strptime)
|
||||||
|
|
||||||
|
struct tm * ptm;
|
||||||
|
ptm = gmtime ( &t );
|
||||||
|
time_t utc = mktime(ptm);
|
||||||
|
utc = 2*t - utc; // Take care of timezone (looks difficult, but is easy: t = t + (t - utc), weil t-utc = timezone)
|
||||||
|
|
||||||
|
sprintf(nowTimestamp,"%ld000000000", (long) utc); // UTC
|
||||||
|
|
||||||
|
payload = _influxDB_V2_Measurement + " " + _key + "=" + _content + " " + nowTimestamp;
|
||||||
|
// payload = _influxDB_V2_Measurement + " " + _key + "=774 " + nowTimestamp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
payload = _influxDB_V2_Measurement + " " + _key + "=" + _content;
|
||||||
|
// payload = _influxDB_V2_Measurement + " " + _key + "=774";
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.shrink_to_fit();
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "sending line to influxdb:" + payload);
|
||||||
|
|
||||||
|
std::string apiURI = _influxDB_V2_URI + "/api/v2/write?org=" + _influxDB_V2_Org + "&bucket=" + _influxDB_V2_Database;
|
||||||
|
apiURI.shrink_to_fit();
|
||||||
|
http_config.url = apiURI.c_str();
|
||||||
|
ESP_LOGI(TAG, "http_config: %s", http_config.url); // Add mark on log to see when it restarted
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "API URI: " + apiURI);
|
||||||
|
|
||||||
|
esp_http_client_handle_t http_client = esp_http_client_init(&http_config);
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "client is initialized");
|
||||||
|
|
||||||
|
esp_http_client_set_header(http_client, "Content-Type", "text/plain");
|
||||||
|
std::string _zw = "Token " + _influxDB_V2_Token;
|
||||||
|
// LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Tokenheader: %s\n", _zw.c_str());
|
||||||
|
esp_http_client_set_header(http_client, "Authorization", _zw.c_str());
|
||||||
|
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "header is set");
|
||||||
|
|
||||||
|
ESP_ERROR_CHECK(esp_http_client_set_post_field(http_client, payload.c_str(), payload.length()));
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "post payload is set");
|
||||||
|
|
||||||
|
esp_err_t err = ESP_ERROR_CHECK_WITHOUT_ABORT(esp_http_client_perform(http_client));
|
||||||
|
|
||||||
|
if( err == ESP_OK ) {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP request was performed");
|
||||||
|
int status_code = esp_http_client_get_status_code(http_client);
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP status code" + std::to_string(status_code));
|
||||||
|
} else {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "HTTP request failed");
|
||||||
|
}
|
||||||
|
esp_http_client_cleanup(http_client);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static esp_err_t http_event_handler(esp_http_client_event_t *evt)
|
static esp_err_t http_event_handler(esp_http_client_event_t *evt)
|
||||||
{
|
{
|
||||||
switch(evt->event_id)
|
switch(evt->event_id)
|
||||||
@@ -64,28 +159,30 @@ void InfluxDBPublish(std::string _key, std::string _content, std::string _timest
|
|||||||
|
|
||||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "InfluxDBPublish - Key: " + _key + ", Content: " + _content + ", Timestamp: " + _timestamp);
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "InfluxDBPublish - Key: " + _key + ", Content: " + _content + ", Timestamp: " + _timestamp);
|
||||||
|
|
||||||
// Format: #define PREVALUE_TIME_FORMAT_OUTPUT "%Y-%m-%dT%H:%M:%S%z"
|
|
||||||
struct tm tm;
|
|
||||||
strptime(_timestamp.c_str(), PREVALUE_TIME_FORMAT_OUTPUT, &tm);
|
|
||||||
time_t t = mktime(&tm); // t is now your desired time_t
|
|
||||||
|
|
||||||
struct tm * ptm;
|
|
||||||
ptm = gmtime ( &t );
|
|
||||||
time_t utc = mktime(ptm);
|
|
||||||
|
|
||||||
// time_t now;
|
|
||||||
// time(&now);
|
|
||||||
char nowTimestamp[21];
|
char nowTimestamp[21];
|
||||||
// pad with zeroes to get nanoseconds
|
std::string payload;
|
||||||
// sprintf(nowTimestamp,"%ld000000000", (long) now);
|
|
||||||
// sprintf(nowTimestamp,"%ld000000000", (long) t); // Localtime
|
|
||||||
sprintf(nowTimestamp,"%ld000000000", (long) utc); // UTC
|
|
||||||
|
|
||||||
|
if (_timestamp.length() > 0)
|
||||||
|
{
|
||||||
|
struct tm tm;
|
||||||
|
strptime(_timestamp.c_str(), PREVALUE_TIME_FORMAT_OUTPUT, &tm);
|
||||||
|
time_t t = mktime(&tm); // Time in Localtime (looks like timezone is not used by strptime)
|
||||||
|
|
||||||
// LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Test Time Conversion - t: " + std::to_string(t) + ", utc: " + std::to_string(utc));
|
struct tm * ptm;
|
||||||
// LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Test Time Conversion - now: " + std::to_string(now) + ", timestamp: " + std::to_string(t) + "(correct time not used yet)");
|
ptm = gmtime ( &t );
|
||||||
|
time_t utc = mktime(ptm);
|
||||||
|
utc = 2*t - utc; // Take care of timezone (looks difficult, but is easy: t = t + (t - utc), weil t-utc = timezone)
|
||||||
|
|
||||||
|
sprintf(nowTimestamp,"%ld000000000", (long) utc); // UTC
|
||||||
|
|
||||||
|
payload = _influxDBMeasurement + " " + _key + "=" + _content + " " + nowTimestamp;
|
||||||
|
// payload = _influxDBMeasurement + " " + _key + "=774 " + nowTimestamp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
payload = _influxDBMeasurement + " " + _key + "=" + _content;
|
||||||
|
}
|
||||||
|
|
||||||
std::string payload = _influxDBMeasurement + " " + _key + "=" + _content + " " + nowTimestamp;
|
|
||||||
payload.shrink_to_fit();
|
payload.shrink_to_fit();
|
||||||
|
|
||||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "sending line to influxdb:" + payload);
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "sending line to influxdb:" + payload);
|
||||||
|
|||||||
@@ -8,10 +8,17 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
// Interface to InfluxDB v1.x
|
||||||
void InfluxDBInit(std::string _influxDBURI, std::string _database, std::string _measurement, std::string _user, std::string _password);
|
void InfluxDBInit(std::string _influxDBURI, std::string _database, std::string _measurement, std::string _user, std::string _password);
|
||||||
void InfluxDBdestroy();
|
|
||||||
|
|
||||||
void InfluxDBPublish(std::string _key, std::string _content, std::string _timestamp);
|
void InfluxDBPublish(std::string _key, std::string _content, std::string _timestamp);
|
||||||
|
|
||||||
|
// Interface to InfluxDB v2.x
|
||||||
|
void InfluxDB_V2_Init(std::string _uri, std::string _database, std::string _measurement, std::string _org, std::string _token);
|
||||||
|
void InfluxDB_V2_Publish(std::string _key, std::string _content, std::string _timestamp);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void InfluxDBdestroy();
|
||||||
|
|
||||||
#endif //INTERFACE_INFLUXDB_H
|
#endif //INTERFACE_INFLUXDB_H
|
||||||
#endif //ENABLE_INFLUXDB
|
#endif //ENABLE_INFLUXDB
|
||||||
@@ -25,11 +25,12 @@ bool mqtt_connected = false;
|
|||||||
|
|
||||||
esp_mqtt_client_handle_t client = NULL;
|
esp_mqtt_client_handle_t client = NULL;
|
||||||
std::string uri, client_id, lwt_topic, lwt_connected, lwt_disconnected, user, password, maintopic;
|
std::string uri, client_id, lwt_topic, lwt_connected, lwt_disconnected, user, password, maintopic;
|
||||||
int keepalive, SetRetainFlag;
|
int keepalive;
|
||||||
void (*callbackOnConnected)(std::string, int) = NULL;
|
bool SetRetainFlag;
|
||||||
|
void (*callbackOnConnected)(std::string, bool) = NULL;
|
||||||
|
|
||||||
|
|
||||||
bool MQTTPublish(std::string _key, std::string _content, int retained_flag)
|
bool MQTTPublish(std::string _key, std::string _content, bool retained_flag)
|
||||||
{
|
{
|
||||||
if (!mqtt_enabled) { // MQTT sevice not started / configured (MQTT_Init not called before)
|
if (!mqtt_enabled) { // MQTT sevice not started / configured (MQTT_Init not called before)
|
||||||
return false;
|
return false;
|
||||||
@@ -153,7 +154,7 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_
|
|||||||
|
|
||||||
bool MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _user, std::string _password,
|
bool MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _user, std::string _password,
|
||||||
std::string _maintopic, std::string _lwt, std::string _lwt_connected, std::string _lwt_disconnected,
|
std::string _maintopic, std::string _lwt, std::string _lwt_connected, std::string _lwt_disconnected,
|
||||||
int _keepalive, int _SetRetainFlag, void *_callbackOnConnected) {
|
int _keepalive, bool _SetRetainFlag, void *_callbackOnConnected) {
|
||||||
if ((_mqttURI.length() == 0) || (_maintopic.length() == 0) || (_clientid.length() == 0))
|
if ((_mqttURI.length() == 0) || (_maintopic.length() == 0) || (_clientid.length() == 0))
|
||||||
{
|
{
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Init aborted! Config error (URI, MainTopic or ClientID missing)");
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Init aborted! Config error (URI, MainTopic or ClientID missing)");
|
||||||
@@ -168,7 +169,7 @@ bool MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _us
|
|||||||
keepalive = _keepalive;
|
keepalive = _keepalive;
|
||||||
SetRetainFlag = _SetRetainFlag;
|
SetRetainFlag = _SetRetainFlag;
|
||||||
maintopic = _maintopic;
|
maintopic = _maintopic;
|
||||||
callbackOnConnected = ( void (*)(std::string, int) )(_callbackOnConnected);
|
callbackOnConnected = ( void (*)(std::string, bool) )(_callbackOnConnected);
|
||||||
|
|
||||||
if (_user.length() && _password.length()){
|
if (_user.length() && _password.length()){
|
||||||
user = _user;
|
user = _user;
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
|
|
||||||
bool MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _user, std::string _password,
|
bool MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _user, std::string _password,
|
||||||
std::string _maintopic, std::string _lwt, std::string _lwt_connected, std::string _lwt_disconnected,
|
std::string _maintopic, std::string _lwt, std::string _lwt_connected, std::string _lwt_disconnected,
|
||||||
int _keepalive, int SetRetainFlag, void *callbackOnConnected);
|
int _keepalive, bool SetRetainFlag, void *callbackOnConnected);
|
||||||
int MQTT_Init();
|
int MQTT_Init();
|
||||||
void MQTTdestroy_client(bool _disable);
|
void MQTTdestroy_client(bool _disable);
|
||||||
|
|
||||||
bool MQTTPublish(std::string _key, std::string _content, int retained_flag = 1); // retained Flag as Standart
|
bool MQTTPublish(std::string _key, std::string _content, bool retained_flag = 1); // retained Flag as Standart
|
||||||
|
|
||||||
bool getMQTTisEnabled();
|
bool getMQTTisEnabled();
|
||||||
bool getMQTTisConnected();
|
bool getMQTTisConnected();
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ std::string timeUnit = "";
|
|||||||
std::string rateUnit = "Unit/Minute";
|
std::string rateUnit = "Unit/Minute";
|
||||||
float roundInterval; // Minutes
|
float roundInterval; // Minutes
|
||||||
int keepAlive = 0; // Seconds
|
int keepAlive = 0; // Seconds
|
||||||
int retainFlag;
|
bool retainFlag;
|
||||||
static std::string maintopic;
|
static std::string maintopic;
|
||||||
|
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ esp_err_t sendDiscovery_and_static_Topics(httpd_req_t *req) {
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GotConnected(std::string maintopic, int retainFlag) {
|
void GotConnected(std::string maintopic, bool retainFlag) {
|
||||||
if (HomeassistantDiscovery) {
|
if (HomeassistantDiscovery) {
|
||||||
MQTThomeassistantDiscovery();
|
MQTThomeassistantDiscovery();
|
||||||
}
|
}
|
||||||
@@ -251,7 +251,7 @@ void SetHomeassistantDiscoveryEnabled(bool enabled) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void setMqtt_Server_Retain(int _retainFlag) {
|
void setMqtt_Server_Retain(bool _retainFlag) {
|
||||||
retainFlag = _retainFlag;
|
retainFlag = _retainFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
void SetHomeassistantDiscoveryEnabled(bool enabled);
|
void SetHomeassistantDiscoveryEnabled(bool enabled);
|
||||||
void mqttServer_setParameter(std::vector<NumberPost*>* _NUMBERS, int interval, float roundInterval);
|
void mqttServer_setParameter(std::vector<NumberPost*>* _NUMBERS, int interval, float roundInterval);
|
||||||
void mqttServer_setMeterType(std::string meterType, std::string valueUnit, std::string timeUnit,std::string rateUnit);
|
void mqttServer_setMeterType(std::string meterType, std::string valueUnit, std::string timeUnit,std::string rateUnit);
|
||||||
void setMqtt_Server_Retain(int SetRetainFlag);
|
void setMqtt_Server_Retain(bool SetRetainFlag);
|
||||||
void mqttServer_setMainTopic( std::string maintopic);
|
void mqttServer_setMainTopic( std::string maintopic);
|
||||||
std::string mqttServer_getMainTopic();
|
std::string mqttServer_getMainTopic();
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ void register_server_mqtt_uri(httpd_handle_t server);
|
|||||||
void publishSystemData();
|
void publishSystemData();
|
||||||
|
|
||||||
std::string getTimeUnit(void);
|
std::string getTimeUnit(void);
|
||||||
void GotConnected(std::string maintopic, int SetRetainFlag);
|
void GotConnected(std::string maintopic, bool SetRetainFlag);
|
||||||
|
|
||||||
|
|
||||||
#endif //SERVERMQTT_H
|
#endif //SERVERMQTT_H
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ TaskHandle_t xHandletask_autodoFlow = NULL;
|
|||||||
bool bTaskAutoFlowCreated = false;
|
bool bTaskAutoFlowCreated = false;
|
||||||
bool flowisrunning = false;
|
bool flowisrunning = false;
|
||||||
|
|
||||||
long auto_intervall = 0;
|
long auto_interval = 0;
|
||||||
bool auto_isrunning = false;
|
bool auto_isrunning = false;
|
||||||
|
|
||||||
int countRounds = 0;
|
int countRounds = 0;
|
||||||
@@ -620,8 +620,8 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|||||||
// string zwzw = "Do " + _task + " start\n"; ESP_LOGD(TAG, zwzw.c_str());
|
// string zwzw = "Do " + _task + " start\n"; ESP_LOGD(TAG, zwzw.c_str());
|
||||||
Camera.SetBrightnessContrastSaturation(bri, con, sat);
|
Camera.SetBrightnessContrastSaturation(bri, con, sat);
|
||||||
Camera.SetLEDIntensity(intens);
|
Camera.SetLEDIntensity(intens);
|
||||||
ESP_LOGD(TAG, "test_take - vor MakeImage");
|
ESP_LOGD(TAG, "test_take - vor TakeImage");
|
||||||
std::string zw = tfliteflow.doSingleStep("[MakeImage]", _host);
|
std::string zw = tfliteflow.doSingleStep("[TakeImage]", _host);
|
||||||
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
||||||
httpd_resp_send(req, zw.c_str(), zw.length());
|
httpd_resp_send(req, zw.c_str(), zw.length());
|
||||||
}
|
}
|
||||||
@@ -825,13 +825,13 @@ void task_autodoFlow(void *pvParameter)
|
|||||||
ESP_LOGD(TAG, "task_autodoFlow: start");
|
ESP_LOGD(TAG, "task_autodoFlow: start");
|
||||||
doInit();
|
doInit();
|
||||||
|
|
||||||
auto_isrunning = tfliteflow.isAutoStart(auto_intervall);
|
auto_isrunning = tfliteflow.isAutoStart(auto_interval);
|
||||||
|
|
||||||
if (isSetupModusActive())
|
if (isSetupModusActive())
|
||||||
{
|
{
|
||||||
auto_isrunning = false;
|
auto_isrunning = false;
|
||||||
std::string zw_time = getCurrentTimeString(LOGFILE_TIME_FORMAT);
|
std::string zw_time = getCurrentTimeString(LOGFILE_TIME_FORMAT);
|
||||||
tfliteflow.doFlowMakeImageOnly(zw_time);
|
tfliteflow.doFlowTakeImageOnly(zw_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (auto_isrunning)
|
while (auto_isrunning)
|
||||||
@@ -873,9 +873,9 @@ void task_autodoFlow(void *pvParameter)
|
|||||||
" completed (" + std::to_string(getUpTime() - roundStartTime) + " seconds)");
|
" completed (" + std::to_string(getUpTime() - roundStartTime) + " seconds)");
|
||||||
|
|
||||||
fr_delta_ms = (esp_timer_get_time() - fr_start) / 1000;
|
fr_delta_ms = (esp_timer_get_time() - fr_start) / 1000;
|
||||||
if (auto_intervall > fr_delta_ms)
|
if (auto_interval > fr_delta_ms)
|
||||||
{
|
{
|
||||||
const TickType_t xDelay = (auto_intervall - fr_delta_ms) / portTICK_PERIOD_MS;
|
const TickType_t xDelay = (auto_interval - fr_delta_ms) / portTICK_PERIOD_MS;
|
||||||
ESP_LOGD(TAG, "Autoflow: sleep for: %ldms", (long) xDelay);
|
ESP_LOGD(TAG, "Autoflow: sleep for: %ldms", (long) xDelay);
|
||||||
vTaskDelay( xDelay );
|
vTaskDelay( xDelay );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ std::string hostname = "";
|
|||||||
std::string std_hostname = "watermeter";
|
std::string std_hostname = "watermeter";
|
||||||
std::string ipadress = "";
|
std::string ipadress = "";
|
||||||
std::string ssid = "";
|
std::string ssid = "";
|
||||||
int RSSIThreashold;
|
int RSSIThreshold;
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -403,9 +403,9 @@ void strinttoip4(const char *ip, int &a, int &b, int &c, int &d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostname, const char *_ipadr, const char *_gw, const char *_netmask, const char *_dns, int _rssithreashold)
|
void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostname, const char *_ipadr, const char *_gw, const char *_netmask, const char *_dns, int _rssithreshold)
|
||||||
{
|
{
|
||||||
RSSI_Threshold = _rssithreashold;
|
RSSI_Threshold = _rssithreshold;
|
||||||
s_wifi_event_group = xEventGroupCreate();
|
s_wifi_event_group = xEventGroupCreate();
|
||||||
|
|
||||||
ESP_ERROR_CHECK(esp_netif_init());
|
ESP_ERROR_CHECK(esp_netif_init());
|
||||||
@@ -556,7 +556,9 @@ bool getWIFIisConnected()
|
|||||||
|
|
||||||
void WIFIDestroy()
|
void WIFIDestroy()
|
||||||
{
|
{
|
||||||
esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, event_handler);
|
esp_wifi_disconnect();
|
||||||
|
|
||||||
|
esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, event_handler);
|
||||||
esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, event_handler);
|
esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, event_handler);
|
||||||
#ifdef WLAN_USE_MESH_ROAMING
|
#ifdef WLAN_USE_MESH_ROAMING
|
||||||
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_STA_BSS_RSSI_LOW, esp_bss_rssi_low_handler);
|
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_STA_BSS_RSSI_LOW, esp_bss_rssi_low_handler);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostname, const char *_ipadr, const char *_gw, const char *_netmask, const char *_dns, int _rssithreashold);
|
void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostname, const char *_ipadr, const char *_gw, const char *_netmask, const char *_dns, int _rssithreshold);
|
||||||
void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostname);
|
void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostname);
|
||||||
void wifi_init_sta(const char *_ssid, const char *_password);
|
void wifi_init_sta(const char *_ssid, const char *_password);
|
||||||
|
|
||||||
@@ -17,6 +17,6 @@ void WIFIDestroy();
|
|||||||
|
|
||||||
extern std::string hostname;
|
extern std::string hostname;
|
||||||
extern std::string std_hostname;
|
extern std::string std_hostname;
|
||||||
extern int RSSIThreashold;
|
extern int RSSIThreshold;
|
||||||
|
|
||||||
#endif //CONNECT_WLAN_H
|
#endif //CONNECT_WLAN_H
|
||||||
@@ -41,7 +41,7 @@ std::vector<string> ZerlegeZeileWLAN(std::string input, std::string _delimiter =
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_hostname, char *&_ipadr, char *&_gw, char *&_netmask, char *&_dns, int &_rssithreashold)
|
bool LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_hostname, char *&_ipadr, char *&_gw, char *&_netmask, char *&_dns, int &_rssithreshold)
|
||||||
{
|
{
|
||||||
std::string ssid = "";
|
std::string ssid = "";
|
||||||
std::string passphrase = "";
|
std::string passphrase = "";
|
||||||
@@ -91,7 +91,7 @@ bool LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_ho
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((splitted.size() > 1) && (toUpper(splitted[0]) == "RSSITHREASHOLD")){
|
if ((splitted.size() > 1) && (toUpper(splitted[0]) == "RSSITHRESHOLD")){
|
||||||
string _s = trim(splitted[1]);
|
string _s = trim(splitted[1]);
|
||||||
if ((_s[0] == '"') && (_s[_s.length()-1] == '"')){
|
if ((_s[0] == '"') && (_s[_s.length()-1] == '"')){
|
||||||
_s = _s.substr(1, ssid.length()-2);
|
_s = _s.substr(1, ssid.length()-2);
|
||||||
@@ -194,8 +194,8 @@ bool LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_ho
|
|||||||
else
|
else
|
||||||
_dns = NULL;
|
_dns = NULL;
|
||||||
|
|
||||||
_rssithreashold = rssithreshold;
|
_rssithreshold = rssithreshold;
|
||||||
RSSIThreashold = rssithreshold;
|
RSSIThreshold = rssithreshold;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,9 +274,9 @@ bool ChangeHostName(std::string fn, std::string _newhostname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ChangeRSSIThreashold(std::string fn, int _newrssithreashold)
|
bool ChangeRSSIThreshold(std::string fn, int _newrssithreshold)
|
||||||
{
|
{
|
||||||
if (RSSIThreashold == _newrssithreashold)
|
if (RSSIThreshold == _newrssithreshold)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string line = "";
|
string line = "";
|
||||||
@@ -305,8 +305,8 @@ bool ChangeRSSIThreashold(std::string fn, int _newrssithreashold)
|
|||||||
splitted = ZerlegeZeileWLAN(line, "=");
|
splitted = ZerlegeZeileWLAN(line, "=");
|
||||||
splitted[0] = trim(splitted[0], " ");
|
splitted[0] = trim(splitted[0], " ");
|
||||||
|
|
||||||
if ((splitted.size() > 1) && (toUpper(splitted[0]) == "RSSITHREASHOLD")){
|
if ((splitted.size() > 1) && (toUpper(splitted[0]) == "RSSITHRESHOLD")){
|
||||||
line = "RSSIThreashold = " + to_string(_newrssithreashold) + "\n";
|
line = "RSSIThreshold = " + to_string(_newrssithreshold) + "\n";
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ bool ChangeRSSIThreashold(std::string fn, int _newrssithreashold)
|
|||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
line = "RSSIThreashold = " + to_string(_newrssithreashold) + "\n";
|
line = "RSSIThreshold = " + to_string(_newrssithreshold) + "\n";
|
||||||
neuesfile.push_back(line);
|
neuesfile.push_back(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ bool ChangeRSSIThreashold(std::string fn, int _newrssithreashold)
|
|||||||
|
|
||||||
fclose(pFile);
|
fclose(pFile);
|
||||||
|
|
||||||
ESP_LOGD(TAG, "*** RSSIThreashold update done ***");
|
ESP_LOGD(TAG, "*** RSSIThreshold update done ***");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
bool LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_hostname, char *&_ipadr, char *&_gw, char *&_netmask, char *&_dns, int &_rssithreashold);
|
bool LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_hostname, char *&_ipadr, char *&_gw, char *&_netmask, char *&_dns, int &_rssithreshold);
|
||||||
|
|
||||||
bool ChangeHostName(std::string fn, std::string _newhostname);
|
bool ChangeHostName(std::string fn, std::string _newhostname);
|
||||||
bool ChangeRSSIThreashold(std::string fn, int _newrssithreashold);
|
bool ChangeRSSIThreshold(std::string fn, int _newrssithreshold);
|
||||||
|
|
||||||
|
|
||||||
#endif //READ_WLANINI_H
|
#endif //READ_WLANINI_H
|
||||||
@@ -21,7 +21,9 @@
|
|||||||
|
|
||||||
|
|
||||||
// use himem //https://github.com/jomjol/AI-on-the-edge-device/issues/1842
|
// use himem //https://github.com/jomjol/AI-on-the-edge-device/issues/1842
|
||||||
#define USE_HIMEM_IF_AVAILABLE
|
#if (CONFIG_SPIRAM_BANKSWITCH_ENABLE)
|
||||||
|
#define USE_HIMEM_IF_AVAILABLE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Uncomment this to generate task list with stack sizes using the /heap handler
|
/* Uncomment this to generate task list with stack sizes using the /heap handler
|
||||||
PLEASE BE AWARE: The following CONFIG parameters have to to be set in
|
PLEASE BE AWARE: The following CONFIG parameters have to to be set in
|
||||||
@@ -56,7 +58,7 @@
|
|||||||
//#define CONFIG_IDF_TARGET_ARCH_XTENSA //not needed with platformio/espressif32 @ 5.2.0
|
//#define CONFIG_IDF_TARGET_ARCH_XTENSA //not needed with platformio/espressif32 @ 5.2.0
|
||||||
|
|
||||||
|
|
||||||
//ClassControllCamera + ClassFlowMakeImage + connect_wlan + main
|
//ClassControllCamera + ClassFlowTakeImage + connect_wlan + main
|
||||||
#define FLASH_GPIO GPIO_NUM_4
|
#define FLASH_GPIO GPIO_NUM_4
|
||||||
#define BLINK_GPIO GPIO_NUM_33
|
#define BLINK_GPIO GPIO_NUM_33
|
||||||
|
|
||||||
@@ -69,12 +71,13 @@
|
|||||||
//server_GPIO
|
//server_GPIO
|
||||||
#define __LEDGLOBAL
|
#define __LEDGLOBAL
|
||||||
|
|
||||||
//ClassControllCamera + ClassFlowMakeImage
|
//ClassControllCamera + ClassFlowTakeImage
|
||||||
#define CAMERA_MODEL_AI_THINKER
|
#define CAMERA_MODEL_AI_THINKER
|
||||||
#define BOARD_ESP32CAM_AITHINKER
|
#define BOARD_ESP32CAM_AITHINKER
|
||||||
|
|
||||||
//server_GPIO + server_file + SoftAP
|
//server_GPIO + server_file + SoftAP
|
||||||
#define CONFIG_FILE "/sdcard/config/config.ini"
|
#define CONFIG_FILE "/sdcard/config/config.ini"
|
||||||
|
#define CONFIG_FILE_BACKUP "/sdcard/config/config.bak"
|
||||||
|
|
||||||
//ClassFlowControll + Main + SoftAP
|
//ClassFlowControll + Main + SoftAP
|
||||||
#define WLAN_CONFIG_FILE "/sdcard/wlan.ini"
|
#define WLAN_CONFIG_FILE "/sdcard/wlan.ini"
|
||||||
@@ -116,7 +119,6 @@
|
|||||||
|
|
||||||
//ClassFlowControll: Serve alg_roi.jpg from memory as JPG
|
//ClassFlowControll: Serve alg_roi.jpg from memory as JPG
|
||||||
#define ALGROI_LOAD_FROM_MEM_AS_JPG // Load ALG_ROI.JPG as rendered JPG from RAM
|
#define ALGROI_LOAD_FROM_MEM_AS_JPG // Load ALG_ROI.JPG as rendered JPG from RAM
|
||||||
#define ALGROI_LOAD_FROM_MEM_AS_JPG__SHOW_TAKE_IMAGE_PROCESS // Show take image image processing on webinterface (overview.html)
|
|
||||||
|
|
||||||
//ClassFlowMQTT
|
//ClassFlowMQTT
|
||||||
#define LWT_TOPIC "connection"
|
#define LWT_TOPIC "connection"
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
//#include <string>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <regex>
|
||||||
|
|
||||||
//#include "freertos/FreeRTOS.h"
|
//#include "freertos/FreeRTOS.h"
|
||||||
//#include "freertos/task.h"
|
//#include "freertos/task.h"
|
||||||
//#include "freertos/event_groups.h"
|
//#include "freertos/event_groups.h"
|
||||||
@@ -29,6 +33,7 @@
|
|||||||
#include "server_file.h"
|
#include "server_file.h"
|
||||||
#include "server_ota.h"
|
#include "server_ota.h"
|
||||||
#include "time_sntp.h"
|
#include "time_sntp.h"
|
||||||
|
#include "configFile.h"
|
||||||
//#include "ClassControllCamera.h"
|
//#include "ClassControllCamera.h"
|
||||||
#include "server_main.h"
|
#include "server_main.h"
|
||||||
#include "server_camera.h"
|
#include "server_camera.h"
|
||||||
@@ -78,6 +83,14 @@ extern std::string getFwVersion(void);
|
|||||||
extern std::string getHTMLversion(void);
|
extern std::string getHTMLversion(void);
|
||||||
extern std::string getHTMLcommit(void);
|
extern std::string getHTMLcommit(void);
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<std::string> splitString(const std::string& str);
|
||||||
|
bool replace(std::string& s, std::string const& toReplace, std::string const& replaceWith);
|
||||||
|
bool replace(std::string& s, std::string const& toReplace, std::string const& replaceWith, bool logIt);
|
||||||
|
//bool replace_all(std::string& s, std::string const& toReplace, std::string const& replaceWith);
|
||||||
|
bool isInString(std::string& s, std::string const& toFind);
|
||||||
|
void migrateConfiguration(void);
|
||||||
|
|
||||||
static const char *TAG = "MAIN";
|
static const char *TAG = "MAIN";
|
||||||
|
|
||||||
bool Init_NVS_SDCard()
|
bool Init_NVS_SDCard()
|
||||||
@@ -198,6 +211,8 @@ extern "C" void app_main(void)
|
|||||||
return; // No way to continue without SD-Card!
|
return; // No way to continue without SD-Card!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
migrateConfiguration();
|
||||||
|
|
||||||
setupTime();
|
setupTime();
|
||||||
|
|
||||||
string versionFormated = getFwVersion() + ", Date/Time: " + std::string(BUILD_TIME) + \
|
string versionFormated = getFwVersion() + ", Date/Time: " + std::string(BUILD_TIME) + \
|
||||||
@@ -242,10 +257,10 @@ extern "C" void app_main(void)
|
|||||||
ESP_ERROR_CHECK( heap_trace_start(HEAP_TRACE_LEAKS) );
|
ESP_ERROR_CHECK( heap_trace_start(HEAP_TRACE_LEAKS) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *ssid = NULL, *passwd = NULL, *hostname = NULL, *ip = NULL, *gateway = NULL, *netmask = NULL, *dns = NULL; int rssithreashold = 0;
|
char *ssid = NULL, *passwd = NULL, *hostname = NULL, *ip = NULL, *gateway = NULL, *netmask = NULL, *dns = NULL; int rssithreshold = 0;
|
||||||
LoadWlanFromFile(WLAN_CONFIG_FILE, ssid, passwd, hostname, ip, gateway, netmask, dns, rssithreashold);
|
LoadWlanFromFile(WLAN_CONFIG_FILE, ssid, passwd, hostname, ip, gateway, netmask, dns, rssithreshold);
|
||||||
|
|
||||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "WLAN-Settings - RSSI-Threashold: " + to_string(rssithreashold));
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "WLAN-Settings - RSSI-Threshold: " + to_string(rssithreshold));
|
||||||
|
|
||||||
if (ssid != NULL && passwd != NULL)
|
if (ssid != NULL && passwd != NULL)
|
||||||
#ifdef __HIDE_PASSWORD
|
#ifdef __HIDE_PASSWORD
|
||||||
@@ -268,7 +283,7 @@ extern "C" void app_main(void)
|
|||||||
ESP_LOGD(TAG, "DNS IP: %s", dns);
|
ESP_LOGD(TAG, "DNS IP: %s", dns);
|
||||||
|
|
||||||
|
|
||||||
wifi_init_sta(ssid, passwd, hostname, ip, gateway, netmask, dns, rssithreashold);
|
wifi_init_sta(ssid, passwd, hostname, ip, gateway, netmask, dns, rssithreshold);
|
||||||
|
|
||||||
|
|
||||||
xDelay = 2000 / portTICK_PERIOD_MS;
|
xDelay = 2000 / portTICK_PERIOD_MS;
|
||||||
@@ -398,3 +413,243 @@ extern "C" void app_main(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void migrateConfiguration(void) {
|
||||||
|
bool migrated = false;
|
||||||
|
|
||||||
|
if (!FileExists(CONFIG_FILE)) {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Config file seems to be missing!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string section = "";
|
||||||
|
std::ifstream ifs(CONFIG_FILE);
|
||||||
|
std::string content((std::istreambuf_iterator<char>(ifs)), (std::istreambuf_iterator<char>()));
|
||||||
|
|
||||||
|
/* Split config file it array of lines */
|
||||||
|
std::vector<std::string> configLines = splitString(content);
|
||||||
|
|
||||||
|
/* Process each line */
|
||||||
|
for (int i = 0; i < configLines.size(); i++) {
|
||||||
|
//ESP_LOGI(TAG, "Line %d: %s", i, configLines[i].c_str());
|
||||||
|
|
||||||
|
if (configLines[i].find("[") != std::string::npos) { // Start of new section
|
||||||
|
section = configLines[i];
|
||||||
|
replace(section, ";", "", false); // Remove possible semicolon (just for the string comparison)
|
||||||
|
//ESP_LOGI(TAG, "New section: %s", section.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Migrate parameters as needed
|
||||||
|
* For the boolean parameters, we make them enabled all the time now:
|
||||||
|
* 1. If they where disabled, set them to their default value
|
||||||
|
* 2. Enable them
|
||||||
|
* Notes:
|
||||||
|
* The migration has some simplifications:
|
||||||
|
* - Case Sensitiveness must be like in the initial config.ini
|
||||||
|
* - No Whitespace after a semicollon
|
||||||
|
* - Only one whitespace before/after the equal sign
|
||||||
|
*/
|
||||||
|
if (section == "[MakeImage]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "[MakeImage]", "[TakeImage]"); // Rename the section itself
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[MakeImage]" || section == "[TakeImage]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "LogImageLocation", "RawImagesLocation");
|
||||||
|
migrated = migrated | replace(configLines[i], "LogfileRetentionInDays", "RawImagesRetention");
|
||||||
|
|
||||||
|
migrated = migrated | replace(configLines[i], ";Demo = true", ";Demo = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";Demo", "Demo"); // Enable it
|
||||||
|
|
||||||
|
migrated = migrated | replace(configLines[i], ";FixedExposure = true", ";FixedExposure = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";FixedExposure", "FixedExposure"); // Enable it
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[Alignment]") {
|
||||||
|
migrated = migrated | replace(configLines[i], ";InitialMirror = true", ";InitialMirror = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";InitialMirror", "InitialMirror"); // Enable it
|
||||||
|
|
||||||
|
migrated = migrated | replace(configLines[i], ";FlipImageSize = true", ";FlipImageSize = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";FlipImageSize", "FlipImageSize"); // Enable it
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[Digits]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "LogImageLocation", "ROIImagesLocation");
|
||||||
|
migrated = migrated | replace(configLines[i], "LogfileRetentionInDays", "ROIImagesRetention");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[Analog]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "LogImageLocation", "ROIImagesLocation");
|
||||||
|
migrated = migrated | replace(configLines[i], "LogfileRetentionInDays", "ROIImagesRetention");
|
||||||
|
migrated = migrated | replace(configLines[i], "ExtendedResolution", ";UNUSED_PARAMETER"); // This parameter is no longer used
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[PostProcessing]") {
|
||||||
|
migrated = migrated | replace(configLines[i], ";PreValueUse = true", ";PreValueUse = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";PreValueUse", "PreValueUse"); // Enable it
|
||||||
|
|
||||||
|
/* AllowNegativeRates has a <NUMBER> as prefix! */
|
||||||
|
if (isInString(configLines[i], "AllowNegativeRates") && isInString(configLines[i], ";")) { // It is the parameter "AllowNegativeRates" and it is commented out
|
||||||
|
migrated = migrated | replace(configLines[i], "true", "false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";", ""); // Enable it
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IgnoreLeadingNaN has a <NUMBER> as prefix! */
|
||||||
|
if (isInString(configLines[i], "IgnoreLeadingNaN") && isInString(configLines[i], ";")) { // It is the parameter "IgnoreLeadingNaN" and it is commented out
|
||||||
|
migrated = migrated | replace(configLines[i], "true", "false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";", ""); // Enable it
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ExtendedResolution has a <NUMBER> as prefix! */
|
||||||
|
if (isInString(configLines[i], "ExtendedResolution") && isInString(configLines[i], ";")) { // It is the parameter "ExtendedResolution" and it is commented out
|
||||||
|
migrated = migrated | replace(configLines[i], "true", "false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";", ""); // Enable it
|
||||||
|
}
|
||||||
|
|
||||||
|
migrated = migrated | replace(configLines[i], ";ErrorMessage = true", ";ErrorMessage = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";ErrorMessage", "ErrorMessage"); // Enable it
|
||||||
|
|
||||||
|
migrated = migrated | replace(configLines[i], ";CheckDigitIncreaseConsistency = true", ";CheckDigitIncreaseConsistency = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";CheckDigitIncreaseConsistency", "CheckDigitIncreaseConsistency"); // Enable it
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[MQTT]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "SetRetainFlag", "RetainMessages"); // First rename it, enable it with its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";RetainMessages = true", ";RetainMessages = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";RetainMessages", "RetainMessages"); // Enable it
|
||||||
|
|
||||||
|
migrated = migrated | replace(configLines[i], ";HomeassistantDiscovery = true", ";HomeassistantDiscovery = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";HomeassistantDiscovery", "HomeassistantDiscovery"); // Enable it
|
||||||
|
|
||||||
|
if (configLines[i].rfind("Topic", 0) != std::string::npos) // only if string starts with "Topic" (Was the naming in very old version)
|
||||||
|
{
|
||||||
|
migrated = migrated | replace(configLines[i], "Topic", "MainTopic");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[InfluxDB]") {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[GPIO]") {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[DataLogging]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "DataLogRetentionInDays", "DataFilesRetention");
|
||||||
|
/* DataLogActive is true by default! */
|
||||||
|
migrated = migrated | replace(configLines[i], ";DataLogActive = false", ";DataLogActive = true"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";DataLogActive", "DataLogActive"); // Enable it
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[AutoTimer]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "Intervall", "Interval");
|
||||||
|
migrated = migrated | replace(configLines[i], ";AutoStart = true", ";AutoStart = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";AutoStart", "AutoStart"); // Enable it
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[Debug]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "Logfile ", "LogLevel "); // Whitespace needed so it does not match `LogfileRetentionInDays`
|
||||||
|
/* LogLevel (resp. LogFile) was originally a boolean, but we switched it to an int
|
||||||
|
* For both cases (true/false), we set it to level 2 (WARNING) */
|
||||||
|
migrated = migrated | replace(configLines[i], "LogLevel = true", "LogLevel = 2");
|
||||||
|
migrated = migrated | replace(configLines[i], "LogLevel = false", "LogLevel = 2");
|
||||||
|
migrated = migrated | replace(configLines[i], "LogfileRetentionInDays", "LogfilesRetention");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (section == "[System]") {
|
||||||
|
migrated = migrated | replace(configLines[i], "RSSIThreashold", "RSSIThreshold");
|
||||||
|
migrated = migrated | replace(configLines[i], "AutoAdjustSummertime", ";UNUSED_PARAMETER"); // This parameter is no longer used
|
||||||
|
|
||||||
|
migrated = migrated | replace(configLines[i], ";SetupMode = true", ";SetupMode = false"); // Set it to its default value
|
||||||
|
migrated = migrated | replace(configLines[i], ";SetupMode", "SetupMode"); // Enable it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (migrated) { // At least one replacement happened
|
||||||
|
if (! RenameFile(CONFIG_FILE, CONFIG_FILE_BACKUP)) {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to create backup of Config file!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* pfile = fopen(CONFIG_FILE, "w");
|
||||||
|
for (int i = 0; i < configLines.size(); i++) {
|
||||||
|
fwrite(configLines[i].c_str() , configLines[i].length(), 1, pfile);
|
||||||
|
fwrite("\n" , 1, 1, pfile);
|
||||||
|
}
|
||||||
|
fclose(pfile);
|
||||||
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Config file migrated. Saved backup to " + string(CONFIG_FILE_BACKUP));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<std::string> splitString(const std::string& str) {
|
||||||
|
std::vector<std::string> tokens;
|
||||||
|
|
||||||
|
std::stringstream ss(str);
|
||||||
|
std::string token;
|
||||||
|
|
||||||
|
while (std::getline(ss, token, '\n')) {
|
||||||
|
tokens.push_back(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*bool replace_all(std::string& s, std::string const& toReplace, std::string const& replaceWith) {
|
||||||
|
std::string buf;
|
||||||
|
std::size_t pos = 0;
|
||||||
|
std::size_t prevPos;
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
|
// Reserves rough estimate of final size of string.
|
||||||
|
buf.reserve(s.size());
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
prevPos = pos;
|
||||||
|
pos = s.find(toReplace, pos);
|
||||||
|
if (pos == std::string::npos) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
found = true;
|
||||||
|
buf.append(s, prevPos, pos - prevPos);
|
||||||
|
buf += replaceWith;
|
||||||
|
pos += toReplace.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.append(s, prevPos, s.size() - prevPos);
|
||||||
|
s.swap(buf);
|
||||||
|
|
||||||
|
return found;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
bool replace(std::string& s, std::string const& toReplace, std::string const& replaceWith) {
|
||||||
|
return replace(s, toReplace, replaceWith, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool replace(std::string& s, std::string const& toReplace, std::string const& replaceWith, bool logIt) {
|
||||||
|
std::size_t pos = s.find(toReplace);
|
||||||
|
|
||||||
|
if (pos == std::string::npos) { // Not found
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string old = s;
|
||||||
|
s.replace(pos, toReplace.length(), replaceWith);
|
||||||
|
if (logIt) {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Migrated Configfile line '" + old + "' to '" + s + "'");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool isInString(std::string& s, std::string const& toFind) {
|
||||||
|
std::size_t pos = s.find(toFind);
|
||||||
|
|
||||||
|
if (pos == std::string::npos) { // Not found
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -140,14 +140,14 @@ void SendHTTPResponse(httpd_req_t *req)
|
|||||||
// message += "<tr><td>gateway</td><td><input type=\"text\" name=\"gateway\" id=\"gateway\"></td><td>Leave emtpy if set by router</td></tr>";
|
// message += "<tr><td>gateway</td><td><input type=\"text\" name=\"gateway\" id=\"gateway\"></td><td>Leave emtpy if set by router</td></tr>";
|
||||||
// message += "<tr><td>netmask</td><td><input type=\"text\" name=\"netmask\" id=\"netmask\"></td><td>Leave emtpy if set by router</td>";
|
// message += "<tr><td>netmask</td><td><input type=\"text\" name=\"netmask\" id=\"netmask\"></td><td>Leave emtpy if set by router</td>";
|
||||||
// message += "</tr><tr><td>DNS</td><td><input type=\"text\" name=\"dns\" id=\"dns\"></td><td>Leave emtpy if set by router</td></tr>";
|
// message += "</tr><tr><td>DNS</td><td><input type=\"text\" name=\"dns\" id=\"dns\"></td><td>Leave emtpy if set by router</td></tr>";
|
||||||
// message += "<tr><td>RSSI Threashold</td><td><input type=\"number\" name=\"name\" id=\"threashold\" min=\"-100\" max=\"0\" step=\"1\" value = \"0\"></td><td>WLAN Mesh Parameter: Threashold 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>";
|
// message += "<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>";
|
||||||
// httpd_resp_send_chunk(req, message.c_str(), strlen(message.c_str()));
|
// httpd_resp_send_chunk(req, message.c_str(), strlen(message.c_str()));
|
||||||
|
|
||||||
|
|
||||||
message = "<button class=\"button\" type=\"button\" onclick=\"wr()\">Write wlan.ini</button>";
|
message = "<button class=\"button\" type=\"button\" onclick=\"wr()\">Write wlan.ini</button>";
|
||||||
message += "<script language=\"JavaScript\">async function wr(){";
|
message += "<script language=\"JavaScript\">async function wr(){";
|
||||||
message += "api = \"/config?\"+\"ssid=\"+document.getElementById(\"ssid\").value+\"&pwd=\"+document.getElementById(\"password\").value;";
|
message += "api = \"/config?\"+\"ssid=\"+document.getElementById(\"ssid\").value+\"&pwd=\"+document.getElementById(\"password\").value;";
|
||||||
// message += "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(\"threashold\").value;";
|
// message += "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;";
|
||||||
message += "fetch(api);await new Promise(resolve => setTimeout(resolve, 1000));location.reload();}</script>";
|
message += "fetch(api);await new Promise(resolve => setTimeout(resolve, 1000));location.reload();}</script>";
|
||||||
httpd_resp_send_chunk(req, message.c_str(), strlen(message.c_str()));
|
httpd_resp_send_chunk(req, message.c_str(), strlen(message.c_str()));
|
||||||
return;
|
return;
|
||||||
@@ -213,55 +213,55 @@ esp_err_t config_ini_handler(httpd_req_t *req)
|
|||||||
if (httpd_query_key_value(_query, "ssid", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "ssid", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "ssid is found: %s", _valuechar);
|
ESP_LOGD(TAG, "ssid is found: %s", _valuechar);
|
||||||
ssid = std::string(_valuechar);
|
ssid = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "pwd", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "pwd", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "pwd is found: %s", _valuechar);
|
ESP_LOGD(TAG, "pwd is found: %s", _valuechar);
|
||||||
pwd = std::string(_valuechar);
|
pwd = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "ssid", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "ssid", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "ssid is found: %s", _valuechar);
|
ESP_LOGD(TAG, "ssid is found: %s", _valuechar);
|
||||||
ssid = std::string(_valuechar);
|
ssid = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "hn", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "hn", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "hostname is found: %s", _valuechar);
|
ESP_LOGD(TAG, "hostname is found: %s", _valuechar);
|
||||||
hn = std::string(_valuechar);
|
hn = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "ip", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "ip", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "ip is found: %s", _valuechar);
|
ESP_LOGD(TAG, "ip is found: %s", _valuechar);
|
||||||
ip = std::string(_valuechar);
|
ip = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "gw", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "gw", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "gateway is found: %s", _valuechar);
|
ESP_LOGD(TAG, "gateway is found: %s", _valuechar);
|
||||||
gw = std::string(_valuechar);
|
gw = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "nm", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "nm", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "netmask is found: %s", _valuechar);
|
ESP_LOGD(TAG, "netmask is found: %s", _valuechar);
|
||||||
nm = std::string(_valuechar);
|
nm = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "dns", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "dns", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "dns is found: %s", _valuechar);
|
ESP_LOGD(TAG, "dns is found: %s", _valuechar);
|
||||||
dns = std::string(_valuechar);
|
dns = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpd_query_key_value(_query, "rssi", _valuechar, 30) == ESP_OK)
|
if (httpd_query_key_value(_query, "rssi", _valuechar, 30) == ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "rssi is found: %s", _valuechar);
|
ESP_LOGD(TAG, "rssi is found: %s", _valuechar);
|
||||||
rssi = std::string(_valuechar);
|
rssi = UrlDecode(std::string(_valuechar));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ esp_err_t config_ini_handler(httpd_req_t *req)
|
|||||||
fputs(dns.c_str(), configfilehandle);
|
fputs(dns.c_str(), configfilehandle);
|
||||||
|
|
||||||
if (rssi.length())
|
if (rssi.length())
|
||||||
rssi = "RSSIThreashold = \"" + rssi + "\"\n";
|
rssi = "RSSIThreshold = \"" + rssi + "\"\n";
|
||||||
else
|
else
|
||||||
rssi = ";rssi = \"\"\n";
|
rssi = ";rssi = \"\"\n";
|
||||||
fputs(rssi.c_str(), configfilehandle);
|
fputs(rssi.c_str(), configfilehandle);
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ UnderTestPost* setUpClassFlowPostprocessing(t_CNNType digType, t_CNNType anaType
|
|||||||
ClassFlowCNNGeneral* _analog;
|
ClassFlowCNNGeneral* _analog;
|
||||||
ClassFlowCNNGeneral* _digit;
|
ClassFlowCNNGeneral* _digit;
|
||||||
std::vector<ClassFlow*> FlowControll;
|
std::vector<ClassFlow*> FlowControll;
|
||||||
ClassFlowMakeImage* flowmakeimage;
|
ClassFlowTakeImage* flowtakeimage;
|
||||||
|
|
||||||
// wird im doFlow verwendet
|
// wird im doFlow verwendet
|
||||||
flowmakeimage = new ClassFlowMakeImage(&FlowControll);
|
flowtakeimage = new ClassFlowTakeImage(&FlowControll);
|
||||||
FlowControll.push_back(flowmakeimage);
|
FlowControll.push_back(flowtakeimage);
|
||||||
|
|
||||||
// Die Modeltypen werden gesetzt, da keine Modelle verwendet werden.
|
// Die Modeltypen werden gesetzt, da keine Modelle verwendet werden.
|
||||||
_analog = new ClassFlowCNNGeneral(nullptr, anaType);
|
_analog = new ClassFlowCNNGeneral(nullptr, anaType);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <unity.h>
|
#include <unity.h>
|
||||||
#include <ClassFlowPostProcessing.h>
|
#include <ClassFlowPostProcessing.h>
|
||||||
#include <ClassFlowCNNGeneral.h>
|
#include <ClassFlowCNNGeneral.h>
|
||||||
#include <ClassFlowMakeImage.h>
|
#include <ClassFlowTakeImage.h>
|
||||||
#include <Helper.h>
|
#include <Helper.h>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ The firmware got moved to the [Release page](https://github.com/jomjol/AI-on-the
|
|||||||
|
|
||||||
# Installation Guide
|
# Installation Guide
|
||||||
|
|
||||||
You find the complete installation guide at <https://github.com/jomjol/AI-on-the-edge-device/wiki/Installation>
|
You find the complete installation guide at https://jomjol.github.io/AI-on-the-edge-device-docs/Installation/
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[MakeImage]
|
[TakeImage]
|
||||||
;LogImageLocation = /log/source
|
;RawImagesLocation = /log/source
|
||||||
WaitBeforeTakingPicture = 5
|
WaitBeforeTakingPicture = 5
|
||||||
;LogfileRetentionInDays = 15
|
;RawImagesRetention = 15
|
||||||
Brightness = 0
|
Brightness = 0
|
||||||
Contrast = 0
|
Contrast = 0
|
||||||
Saturation = 0
|
Saturation = 0
|
||||||
@@ -9,7 +9,7 @@ LEDIntensity = 50
|
|||||||
ImageQuality = 12
|
ImageQuality = 12
|
||||||
ImageSize = VGA
|
ImageSize = VGA
|
||||||
FixedExposure = false
|
FixedExposure = false
|
||||||
;Demo = true
|
Demo = false
|
||||||
|
|
||||||
[Alignment]
|
[Alignment]
|
||||||
InitialRotate = 179
|
InitialRotate = 179
|
||||||
@@ -24,8 +24,8 @@ FlipImageSize = false
|
|||||||
[Digits]
|
[Digits]
|
||||||
Model = /config/dig-cont_0600_s3.tflite
|
Model = /config/dig-cont_0600_s3.tflite
|
||||||
CNNGoodThreshold = 0.5
|
CNNGoodThreshold = 0.5
|
||||||
;LogImageLocation = /log/digit
|
;ROIImagesLocation = /log/digit
|
||||||
;LogfileRetentionInDays = 3
|
;ROIImagesRetention = 3
|
||||||
main.dig1 294 126 30 54 false
|
main.dig1 294 126 30 54 false
|
||||||
main.dig2 343 126 30 54 false
|
main.dig2 343 126 30 54 false
|
||||||
main.dig3 391 126 30 54 false
|
main.dig3 391 126 30 54 false
|
||||||
@@ -33,9 +33,8 @@ main.dig3 391 126 30 54 false
|
|||||||
[Analog]
|
[Analog]
|
||||||
Model = /config/ana-cont_11.3.1_s2.tflite
|
Model = /config/ana-cont_11.3.1_s2.tflite
|
||||||
CNNGoodThreshold = 0.5
|
CNNGoodThreshold = 0.5
|
||||||
;LogImageLocation = /log/analog
|
;ROIImagesLocation = /log/analog
|
||||||
;LogfileRetentionInDays = 3
|
;ROIImagesRetention = 3
|
||||||
ExtendedResolution = true
|
|
||||||
main.ana1 432 230 92 92 false
|
main.ana1 432 230 92 92 false
|
||||||
main.ana2 379 332 92 92 false
|
main.ana2 379 332 92 92 false
|
||||||
main.ana3 283 374 92 92 false
|
main.ana3 283 374 92 92 false
|
||||||
@@ -46,11 +45,11 @@ main.DecimalShift = 0
|
|||||||
main.AnalogDigitalTransitionStart = 9.2
|
main.AnalogDigitalTransitionStart = 9.2
|
||||||
PreValueUse = true
|
PreValueUse = true
|
||||||
PreValueAgeStartup = 720
|
PreValueAgeStartup = 720
|
||||||
AllowNegativeRates = false
|
main.AllowNegativeRates = false
|
||||||
main.MaxRateValue = 0.05
|
main.MaxRateValue = 0.05
|
||||||
;main.MaxRateType = AbsoluteChange
|
;main.MaxRateType = AbsoluteChange
|
||||||
;main.ExtendedResolution = false
|
main.ExtendedResolution = false
|
||||||
;main.IgnoreLeadingNaN = true
|
main.IgnoreLeadingNaN = false
|
||||||
ErrorMessage = true
|
ErrorMessage = true
|
||||||
CheckDigitIncreaseConsistency = false
|
CheckDigitIncreaseConsistency = false
|
||||||
|
|
||||||
@@ -60,17 +59,25 @@ CheckDigitIncreaseConsistency = false
|
|||||||
;ClientID = watermeter
|
;ClientID = watermeter
|
||||||
;user = USERNAME
|
;user = USERNAME
|
||||||
;password = PASSWORD
|
;password = PASSWORD
|
||||||
;SetRetainFlag = true
|
RetainMessages = false
|
||||||
;HomeassistantDiscovery = true
|
HomeassistantDiscovery = false
|
||||||
;MeterType = other
|
;MeterType = other
|
||||||
|
|
||||||
;[InfluxDB]
|
;[InfluxDB]
|
||||||
;Uri = undefined
|
;Uri = undefined
|
||||||
;Database =
|
;Database = undefined
|
||||||
;Measurement = undefined
|
;Measurement = undefined
|
||||||
;user = undefined
|
;user = undefined
|
||||||
;password = undefined
|
;password = undefined
|
||||||
|
|
||||||
|
;[InfluxDBv2]
|
||||||
|
;Uri = undefined
|
||||||
|
;Database = undefined
|
||||||
|
;Measurement = undefined
|
||||||
|
;Org = undefined
|
||||||
|
;Token = undefined
|
||||||
|
;main.Fieldname = undefined
|
||||||
|
|
||||||
;[GPIO]
|
;[GPIO]
|
||||||
;MainTopicMQTT = wasserzaehler/GPIO
|
;MainTopicMQTT = wasserzaehler/GPIO
|
||||||
;IO0 = input disabled 10 false false
|
;IO0 = input disabled 10 false false
|
||||||
@@ -85,19 +92,19 @@ LEDColor = 150 150 150
|
|||||||
|
|
||||||
[AutoTimer]
|
[AutoTimer]
|
||||||
AutoStart = true
|
AutoStart = true
|
||||||
Intervall = 5
|
Interval = 5
|
||||||
|
|
||||||
[DataLogging]
|
[DataLogging]
|
||||||
DataLogActive = true
|
DataLogActive = true
|
||||||
DataLogRetentionInDays = 3
|
DataFilesRetention = 3
|
||||||
|
|
||||||
[Debug]
|
[Debug]
|
||||||
Logfile = 1
|
LogLevel = 1
|
||||||
LogfileRetentionInDays = 3
|
LogfilesRetention = 3
|
||||||
|
|
||||||
[System]
|
[System]
|
||||||
TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
|
TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
|
||||||
;TimeServer = pool.ntp.org
|
;TimeServer = pool.ntp.org
|
||||||
;AutoAdjustSummertime = false
|
|
||||||
;Hostname = undefined
|
;Hostname = undefined
|
||||||
|
;RSSIThreshold = 0
|
||||||
SetupMode = true
|
SetupMode = true
|
||||||
|
|||||||
BIN
sd-card/config/dig-cont_0610_s3.tflite
Normal file
BIN
sd-card/config/dig-cont_0610_s3.tflite
Normal file
Binary file not shown.
BIN
sd-card/config/dig-cont_0610_s3_q.tflite
Normal file
BIN
sd-card/config/dig-cont_0610_s3_q.tflite
Normal file
Binary file not shown.
@@ -121,9 +121,15 @@ function fetchFiles(urls, filesData, index, retry, zipFilename) {
|
|||||||
else if (retry == 1) { // longer timeout
|
else if (retry == 1) { // longer timeout
|
||||||
xhr.timeout = 5000; // time in milliseconds
|
xhr.timeout = 5000; // time in milliseconds
|
||||||
}
|
}
|
||||||
else { // very long timeout
|
else if (retry == 2) { // longer timeout
|
||||||
xhr.timeout = 20000; // time in milliseconds
|
xhr.timeout = 20000; // time in milliseconds
|
||||||
}
|
}
|
||||||
|
else if (retry == 3) { // longer timeout
|
||||||
|
xhr.timeout = 30000; // time in milliseconds
|
||||||
|
}
|
||||||
|
else { // very long timeout
|
||||||
|
xhr.timeout = 60000; // time in milliseconds
|
||||||
|
}
|
||||||
|
|
||||||
xhr.onload = () => { // Request finished
|
xhr.onload = () => { // Request finished
|
||||||
//console.log(url + " done");
|
//console.log(url + " done");
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* The UI can also be run locally, but you have to set the IP of your devide accordingly.
|
/* 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! */
|
* And you also might have to disable CORS in your webbrowser! */
|
||||||
var domainname_for_testing = "192.168.178.44";
|
var domainname_for_testing = "192.168.178.62";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
||||||
<title>Make Alignment</title>
|
<title>Alignment Marks</title>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@@ -48,7 +48,11 @@ select {
|
|||||||
|
|
||||||
<body style="font-family: arial; padding: 0px 10px;">
|
<body style="font-family: arial; padding: 0px 10px;">
|
||||||
|
|
||||||
<h2>Define Alignment Structure in Reference Image</h2>
|
<h2>Alignment Marks</h2>
|
||||||
|
<p>On this page you define two Reference Marks.
|
||||||
|
See <a href=https://jomjol.github.io/AI-on-the-edge-device-docs/Alignment/ target=_blank>https://jomjol.github.io/AI-on-the-edge-device-docs/Alignment/</a> for explanations.</p>
|
||||||
|
<p>After saving the Reference Marks, you can define the <a href=edit_digits.html>digit</a> resp. <a href=edit_analog.html>analog</a> ROI's.<br>
|
||||||
|
Only after those steps a reboot is required.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -88,10 +92,8 @@ select {
|
|||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input class="button" type="submit" name="saveroi" onclick="SaveToConfig()" value="Save"></td>
|
<td><input class="button" type="submit" name="saveroi" onclick="SaveToConfig()" value="Save">
|
||||||
</tr>
|
<p>Proceed to update the <a href=edit_digits.html>digit</a> resp. <a href=edit_analog.html>analog</a> ROI's when you are done.</p></td>
|
||||||
<tr>
|
|
||||||
<td><button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate changes</button></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -131,7 +133,7 @@ function SaveToConfig(){
|
|||||||
WriteConfigININew();
|
WriteConfigININew();
|
||||||
UpdateConfigReference(domainname)
|
UpdateConfigReference(domainname)
|
||||||
SaveConfigToServer(domainname);
|
SaveConfigToServer(domainname);
|
||||||
firework.launch('Configuration got updated. Please reboot to activate changes!', 'success', 5000);
|
firework.launch('Configuration got updated. It will get applied after the next reboot!', 'success', 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function EnhanceContrast(){
|
function EnhanceContrast(){
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<title>Make Analog Alignment</title>
|
<title>Analog ROI's</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
h1 {font-size: 2em;}
|
h1 {font-size: 2em;}
|
||||||
@@ -67,9 +67,11 @@ th, td {
|
|||||||
|
|
||||||
<body style="font-family: arial; padding: 0px 10px;">
|
<body style="font-family: arial; padding: 0px 10px;">
|
||||||
|
|
||||||
<h2><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'EnDisableAnalog()' checked >
|
<h2>Analog ROI's</h2>
|
||||||
Edit Analog</h2>
|
<p>On this page you define ROI's for the analog counters.
|
||||||
|
See <a href=https://jomjol.github.io/AI-on-the-edge-device-docs/ROI-Configuration/ target=_blank>https://jomjol.github.io/AI-on-the-edge-device-docs/ROI-Configuration/</a> for explanations.</p>
|
||||||
|
|
||||||
|
<input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'EnDisableAnalog()' checked ><label for="Category_Analog_enabled">Enable Analog ROI's</label></p>
|
||||||
|
|
||||||
<div id="div1">
|
<div id="div1">
|
||||||
<table>
|
<table>
|
||||||
@@ -134,10 +136,10 @@ th, td {
|
|||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input class="button" type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save" tabindex=9></td>
|
<td><input class="button" type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save" tabindex=9>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate changes</button></td>
|
<td><button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate the changes</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -290,7 +292,7 @@ function SaveToConfig(){
|
|||||||
cofcat["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
|
cofcat["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
|
||||||
WriteConfigININew();
|
WriteConfigININew();
|
||||||
SaveConfigToServer(domainname);
|
SaveConfigToServer(domainname);
|
||||||
firework.launch('Configuration got updated. Please reboot to activate changes!', 'success', 5000);
|
firework.launch('Configuration got updated. It will get applied after the next reboot!', 'success', 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ function saveTextAsFile()
|
|||||||
FileDeleteOnServer("/config/config.ini", domainname);
|
FileDeleteOnServer("/config/config.ini", domainname);
|
||||||
var textToSave = document.getElementById("inputTextToSave").value;
|
var textToSave = document.getElementById("inputTextToSave").value;
|
||||||
FileSendContent(textToSave, "/config/config.ini", domainname);
|
FileSendContent(textToSave, "/config/config.ini", domainname);
|
||||||
firework.launch('Configuration got updated. Please reboot to activate changes!', 'success', 5000);
|
firework.launch('Configuration got updated. It will get applied after the next reboot!', 'success', 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,23 +102,23 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="MakeImage_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "LogImageLocation")' unchecked >
|
<input type="checkbox" id="TakeImage_RawImagesLocation_enabled" value="1" onclick = 'InvertEnableItem("TakeImage", "RawImagesLocation")' unchecked >
|
||||||
<label for=MakeImage_LogImageLocation_enabled><class id="MakeImage_LogImageLocation_text" style="color:black;">LogImageLocation</class></label>
|
<label for=TakeImage_RawImagesLocation_enabled><class id="TakeImage_RawImagesLocation_text" style="color:black;">RawImagesLocation</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="name" id="MakeImage_LogImageLocation_value1">
|
<input type="text" name="name" id="TakeImage_RawImagesLocation_value1">
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Location to store raw images for logging
|
Location to store raw camera images
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="MakeImage_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "LogfileRetentionInDays")' unchecked >
|
<input type="checkbox" id="TakeImage_RawImagesRetention_enabled" value="1" onclick = 'InvertEnableItem("TakeImage", "RawImagesRetention")' unchecked >
|
||||||
<label for=MakeImage_LogfileRetentionInDays_enabled><class id="MakeImage_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class></label>
|
<label for=TakeImage_RawImagesRetention_enabled><class id="TakeImage_RawImagesRetention_text" style="color:black;">RawImagesRetention</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="MakeImage_LogfileRetentionInDays_value1" size="13" min="0" step="1">
|
<input type="number" id="TakeImage_RawImagesRetention_value1" size="13" min="0" step="1">
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Time to keep the raw image (in days, resp. "0" = forever)
|
Time to keep the raw image (in days, resp. "0" = forever)
|
||||||
@@ -126,11 +126,10 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="expert" id="ex1">
|
<tr class="expert" id="ex1">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="MakeImage_Demo_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "Demo")' unchecked >
|
<label for=TakeImage_Demo_enabled><class id="TakeImage_Demo_text" style="color:black;">Demo Mode</class></label>
|
||||||
<label for=MakeImage_Demo_enabled><class id="MakeImage_Demo_text" style="color:black;">Demo Mode</class></label>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="MakeImage_Demo_value1">
|
<select id="TakeImage_Demo_value1">
|
||||||
<option value="true">true</option>
|
<option value="true">true</option>
|
||||||
<option value="false" selected>false</option>
|
<option value="false" selected>false</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -144,10 +143,10 @@ textarea {
|
|||||||
<tr class="expert" id="ex1">
|
<tr class="expert" id="ex1">
|
||||||
|
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="MakeImage_WaitBeforeTakingPicture_text" style="color:black;">WaitBeforeTakingPicture</class>
|
<class id="TakeImage_WaitBeforeTakingPicture_text" style="color:black;">WaitBeforeTakingPicture</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="MakeImage_WaitBeforeTakingPicture_value1" size="13" min="0" step="any">
|
<input type="number" id="TakeImage_WaitBeforeTakingPicture_value1" size="13" min="0" step="any">
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Wait time between switching illumination on and taking the picture (in seconds)
|
Wait time between switching illumination on and taking the picture (in seconds)
|
||||||
@@ -155,22 +154,23 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="expert" id="ex2">
|
<tr class="expert" id="ex2">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="MakeImage_ImageQuality_text" style="color:black;">ImageQuality</class>
|
<class id="TakeImage_ImageQuality_text" style="color:black;">ImageQuality</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="MakeImage_ImageQuality_value1" size="13" min="0" max="63">
|
<input type="number" id="TakeImage_ImageQuality_value1" size="13" min="0" max="63">
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Quality index for picture (default = "12" - "0" high ... "63" low) <br>
|
Image quality index (default = 12) <br>
|
||||||
Remark: values smaller than 12 can result in a reboot, as the bigger sized JPEG might not fit in the available RAM!
|
Input range: 8 [highest quality] ... 63 [lowest quality] <br>
|
||||||
|
Remark: Value < 12 could result in system instabilities!
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="expert" id="ex3">
|
<tr class="expert" id="ex3">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="MakeImage_ImageSize_text" style="color:black;">ImageSize</class>
|
<class id="TakeImage_ImageSize_text" style="color:black;">ImageSize</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="MakeImage_ImageSize_value1">
|
<select id="TakeImage_ImageSize_value1">
|
||||||
<option value="VGA" selected>VGA</option>
|
<option value="VGA" selected>VGA</option>
|
||||||
<option value="QVGA" >QVGA</option>
|
<option value="QVGA" >QVGA</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -182,10 +182,10 @@ textarea {
|
|||||||
|
|
||||||
<tr class="expert" id="LEDIntensity_ex3">
|
<tr class="expert" id="LEDIntensity_ex3">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="MakeImage_LEDIntensity_text" style="color:black;">LEDIntensity</class>
|
<class id="TakeImage_LEDIntensity_text" style="color:black;">LEDIntensity</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="MakeImage_LEDIntensity_value1" size="13" min="0" max="100">
|
<input type="number" id="TakeImage_LEDIntensity_value1" size="13" min="0" max="100">
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 80%;">
|
<td style="font-size: 80%;">
|
||||||
Internal LED Flash Intensity (PWM from 0% - 100%). <br>
|
Internal LED Flash Intensity (PWM from 0% - 100%). <br>
|
||||||
@@ -195,48 +195,49 @@ textarea {
|
|||||||
|
|
||||||
<tr class="expert" id="Brightness_ex3">
|
<tr class="expert" id="Brightness_ex3">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="MakeImage_Brightness_text" style="color:black;">Brightness</class>
|
<class id="TakeImage_Brightness_text" style="color:black;">Brightness</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="MakeImage_Brightness_value1" size="13" min="-2" max="2">
|
<input type="number" id="TakeImage_Brightness_value1" size="13" min="-2" max="2">
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 80%;">
|
<td style="font-size: 80%;">
|
||||||
Image Brightness (-2 .. 2 - default = "0")
|
Image brightness (default = 0) <br>
|
||||||
|
Input range: -2 ... 2
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="expert" id="Contrast_ex3">
|
<tr class="expert" id="Contrast_ex3">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
|
<class id="TakeImage_Contrast_text" style="color:black;">Contrast</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="MakeImage_Contrast_value1" size="13" min="-2" max="2">
|
<input type="number" id="TakeImage_Contrast_value1" size="13" min="-2" max="2">
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 80%;">
|
<td style="font-size: 80%;">
|
||||||
Image Contrast (-2 .. 2 - default = "0") <br>
|
Image contrast (default = 0) <br>
|
||||||
Remark: camera driver is not fully supporting this setting yet (no impact on image)
|
Input range: -2 ... 2
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="expert" id="Saturation_ex3">
|
<tr class="expert" id="Saturation_ex3">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
|
<class id="TakeImage_Saturation_text" style="color:black;">Saturation</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="MakeImage_Saturation_value1" size="13" min="-2" max="2">
|
<input type="number" id="TakeImage_Saturation_value1" size="13" min="-2" max="2">
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 80%;">
|
<td style="font-size: 80%;">
|
||||||
Image Saturation (-2 .. 2 - default = "0") <br>
|
Image saturation (default = 0) <br>
|
||||||
Remark: camera driver is not fully supporting this setting yet (no impact on image)
|
Input range: -2 ... 2
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="expert" id="MakeImage_FixedExposure_ex10">
|
<tr class="expert" id="TakeImage_FixedExposure_ex10">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="MakeImage_FixedExposure_text" style="color:black;">FixedExposure</class>
|
<class id="TakeImage_FixedExposure_text" style="color:black;">FixedExposure</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="MakeImage_FixedExposure_value1">
|
<select id="TakeImage_FixedExposure_value1">
|
||||||
<option value="true" selected>true</option>
|
<option value="true" selected>true</option>
|
||||||
<option value="false" >false</option>
|
<option value="false" >false</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -282,6 +283,7 @@ textarea {
|
|||||||
<option value="default" selected>Default</option>
|
<option value="default" selected>Default</option>
|
||||||
<option value="highAccuracy" >HighAccuracy</option>
|
<option value="highAccuracy" >HighAccuracy</option>
|
||||||
<option value="fast" >Fast</option>
|
<option value="fast" >Fast</option>
|
||||||
|
<option value="off" >Off</option><!-- add disable aligment algo |01.2023 -->
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 80%;">
|
<td style="font-size: 80%;">
|
||||||
@@ -289,6 +291,37 @@ textarea {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr class="expert" id="ex13">
|
||||||
|
<td class="indent1">
|
||||||
|
<class id="Alignment_FlipImageSize_text" style="color:black;">FlipImageSize</class>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="Alignment_FlipImageSize_value1">
|
||||||
|
<option value="true">true</option>
|
||||||
|
<option value="false" selected>false</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
Rotate the viewport together with the alignment rotation.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr class="expert" id="ex13">
|
||||||
|
<td class="indent1">
|
||||||
|
<class id="Alignment_InitialMirror_text" style="color:black;">InitialMirror</class>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="Alignment_InitialMirror_value1">
|
||||||
|
<option value="true">true</option>
|
||||||
|
<option value="false" selected>false</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
Rotate the viewport together with the alignment rotation.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr id="Category_Digits_ex4">
|
<tr id="Category_Digits_ex4">
|
||||||
<td colspan="3" style="padding-left: 20px;">
|
<td colspan="3" style="padding-left: 20px;">
|
||||||
@@ -325,11 +358,11 @@ textarea {
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="Digits_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("Digits", "LogImageLocation")' unchecked >
|
<input type="checkbox" id="Digits_ROIImagesLocation_enabled" value="1" onclick = 'InvertEnableItem("Digits", "ROIImagesLocation")' unchecked >
|
||||||
<label for=Digits_LogImageLocation_enabled><class id="Digits_LogImageLocation_text" style="color:black;">LogImageLocation</class></label>
|
<label for=Digits_ROIImagesLocation_enabled><class id="Digits_ROIImagesLocation_text" style="color:black;">ROIImagesLocation</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="name" id="Digits_LogImageLocation_value1">
|
<input type="text" name="name" id="Digits_ROIImagesLocation_value1">
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 80%;">
|
<td style="font-size: 80%;">
|
||||||
Location to store separated digits for logging
|
Location to store separated digits for logging
|
||||||
@@ -337,11 +370,11 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="Digits_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Digits", "LogfileRetentionInDays")' unchecked >
|
<input type="checkbox" id="Digits_ROIImagesRetention_enabled" value="1" onclick = 'InvertEnableItem("Digits", "ROIImagesRetention")' unchecked >
|
||||||
<label for=Digits_LogfileRetentionInDays_enabled><class id="Digits_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class></label>
|
<label for=Digits_ROIImagesRetention_enabled><class id="Digits_ROIImagesRetention_text" style="color:black;">ROIImagesRetention</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="Digits_LogfileRetentionInDays_value1" min="0" step="1">
|
<input type="number" id="Digits_ROIImagesRetention_value1" min="0" step="1">
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 80%;">
|
<td style="font-size: 80%;">
|
||||||
Time to keep the separated digit images (in days, resp. "0" = forever)
|
Time to keep the separated digit images (in days, resp. "0" = forever)
|
||||||
@@ -367,18 +400,18 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="Analog_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("Analog", "LogImageLocation")' unchecked >
|
<input type="checkbox" id="Analog_ROIImagesLocation_enabled" value="1" onclick = 'InvertEnableItem("Analog", "ROIImagesLocation")' unchecked >
|
||||||
<label for=Analog_LogImageLocation_enabled><class id="Analog_LogImageLocation_text" style="color:black;">LogImageLocation</class>
|
<label for=Analog_ROIImagesLocation_enabled><class id="Analog_ROIImagesLocation_text" style="color:black;">ROIImagesLocation</class>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
<td> <input type="text" name="name" id="Analog_LogImageLocation_value1"> </td>
|
<td> <input type="text" name="name" id="Analog_ROIImagesLocation_value1"> </td>
|
||||||
<td style="font-size: 80%;"> Location to store separated digits for logging </td>
|
<td style="font-size: 80%;"> Location to store separated digits for logging </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="Analog_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Analog", "LogfileRetentionInDays")' unchecked >
|
<input type="checkbox" id="Analog_ROIImagesRetention_enabled" value="1" onclick = 'InvertEnableItem("Analog", "ROIImagesRetention")' unchecked >
|
||||||
<label for=Analog_LogfileRetentionInDays_enabled><class id="Analog_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class></label></td>
|
<label for=Analog_ROIImagesRetention_enabled><class id="Analog_ROIImagesRetention_text" style="color:black;">ROIImagesRetention</class></label></td>
|
||||||
<td> <input type="number" id="Analog_LogfileRetentionInDays_value1" min="0" step="1"> </td>
|
<td> <input type="number" id="Analog_ROIImagesRetention_value1" min="0" step="1"> </td>
|
||||||
<td style="font-size: 80%;"> Time to keep the separated digit images (in days, resp. "0" = forever) </td>
|
<td style="font-size: 80%;"> Time to keep the separated digit images (in days, resp. "0" = forever) </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -387,7 +420,6 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="PostProcessing_PreValueUse_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "PreValueUse")' unchecked >
|
|
||||||
<label for=PostProcessing_PreValueUse_enabled><class id="PostProcessing_PreValueUse_text" style="color:black;">PreValueUse</class></label>
|
<label for=PostProcessing_PreValueUse_enabled><class id="PostProcessing_PreValueUse_text" style="color:black;">PreValueUse</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -414,7 +446,6 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="expert" id="ex12">
|
<tr class="expert" id="ex12">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="PostProcessing_ErrorMessage_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "ErrorMessage")' unchecked >
|
|
||||||
<label for=PostProcessing_ErrorMessage_enabled><class id="PostProcessing_ErrorMessage_text" style="color:black;">ErrorMessage</class></label>
|
<label for=PostProcessing_ErrorMessage_enabled><class id="PostProcessing_ErrorMessage_text" style="color:black;">ErrorMessage</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -429,7 +460,6 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="expert" id="ex1dddd">
|
<tr class="expert" id="ex1dddd">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="PostProcessing_CheckDigitIncreaseConsistency_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "CheckDigitIncreaseConsistency")' unchecked >
|
|
||||||
<label for=PostProcessing_CheckDigitIncreaseConsistency_enabled><class id="PostProcessing_CheckDigitIncreaseConsistency_text" style="color:black;">CheckDigitIncreaseConsistency</class></label>
|
<label for=PostProcessing_CheckDigitIncreaseConsistency_enabled><class id="PostProcessing_CheckDigitIncreaseConsistency_text" style="color:black;">CheckDigitIncreaseConsistency</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -455,8 +485,7 @@ textarea {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1" style="padding-left: 75px;">
|
||||||
<input type="checkbox" id="PostProcessing_AllowNegativeRates_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "AllowNegativeRates")' unchecked >
|
|
||||||
<label for=PostProcessing_AllowNegativeRates_enabled><class id="PostProcessing_AllowNegativeRates_text" style="color:black;">AllowNegativeRates</class></label>
|
<label for=PostProcessing_AllowNegativeRates_enabled><class id="PostProcessing_AllowNegativeRates_text" style="color:black;">AllowNegativeRates</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -470,7 +499,7 @@ textarea {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1" style="padding-left: 75px;">
|
||||||
<input type="checkbox" id="PostProcessing_DecimalShift_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "DecimalShift")' unchecked >
|
<input type="checkbox" id="PostProcessing_DecimalShift_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "DecimalShift")' unchecked >
|
||||||
<label for=PostProcessing_DecimalShift_enabled><class id="PostProcessing_DecimalShift_text" style="color:black;">DecimalShift</class></label>
|
<label for=PostProcessing_DecimalShift_enabled><class id="PostProcessing_DecimalShift_text" style="color:black;">DecimalShift</class></label>
|
||||||
</td>
|
</td>
|
||||||
@@ -483,7 +512,7 @@ textarea {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1" style="padding-left: 75px;">
|
||||||
<input type="checkbox" id="PostProcessing_AnalogDigitalTransitionStart_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "AnalogDigitalTransitionStart")' unchecked >
|
<input type="checkbox" id="PostProcessing_AnalogDigitalTransitionStart_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "AnalogDigitalTransitionStart")' unchecked >
|
||||||
<label for=PostProcessing_AnalogDigitalTransitionStart_enabled><class id="PostProcessing_AnalogDigitalTransitionStart_text" style="color:black;">AnalogDigitalTransitionStart</class></label>
|
<label for=PostProcessing_AnalogDigitalTransitionStart_enabled><class id="PostProcessing_AnalogDigitalTransitionStart_text" style="color:black;">AnalogDigitalTransitionStart</class></label>
|
||||||
</td>
|
</td>
|
||||||
@@ -497,7 +526,7 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1" style="padding-left: 75px;">
|
||||||
<input type="checkbox" id="PostProcessing_MaxRateValue_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateValue")' unchecked >
|
<input type="checkbox" id="PostProcessing_MaxRateValue_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateValue")' unchecked >
|
||||||
<label for=PostProcessing_MaxRateValue_enabled><class id="PostProcessing_MaxRateValue_text" style="color:black;">MaxRateValue</class></label>
|
<label for=PostProcessing_MaxRateValue_enabled><class id="PostProcessing_MaxRateValue_text" style="color:black;">MaxRateValue</class></label>
|
||||||
</td>
|
</td>
|
||||||
@@ -509,7 +538,7 @@ textarea {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1" style="padding-left: 75px;">
|
||||||
<input type="checkbox" id="PostProcessing_MaxRateType_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateType")' unchecked >
|
<input type="checkbox" id="PostProcessing_MaxRateType_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateType")' unchecked >
|
||||||
<label for=PostProcessing_MaxRateType_enabled><class id="PostProcessing_MaxRateType_text" style="color:black;">MaxRateType</class></label>
|
<label for=PostProcessing_MaxRateType_enabled><class id="PostProcessing_MaxRateType_text" style="color:black;">MaxRateType</class></label>
|
||||||
</td>
|
</td>
|
||||||
@@ -524,9 +553,8 @@ textarea {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1" style="padding-left: 75px;">
|
||||||
<input type="checkbox" id="PostProcessing_ExtendedResolution_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "ExtendedResolution")' unchecked >
|
<label for=PostProcessing_ExtendedResolution_enabled><class id="PostProcessing_ExtendedResolution_text" style="color:black;">ExtendedResolution</class></label>
|
||||||
<label for=PostProcessing_ExtendedResolution_enabled><class id="PostProcessing_ExtendedResolution_text" style="color:black;">ExtendedResolution</class></label>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="PostProcessing_ExtendedResolution_value1">
|
<select id="PostProcessing_ExtendedResolution_value1">
|
||||||
@@ -538,11 +566,9 @@ textarea {
|
|||||||
Enable to use the decimal place of the last analog counter
|
Enable to use the decimal place of the last analog counter
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td id="ex121" class="indent1">
|
<td id="ex121" class="indent1" style="padding-left: 75px;">
|
||||||
<input type="checkbox" id="PostProcessing_IgnoreLeadingNaN_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "IgnoreLeadingNaN")' unchecked >
|
<label for=PostProcessing_IgnoreLeadingNaN_enabled><class id="PostProcessing_IgnoreLeadingNaN_text" style="color:black;">IgnoreLeadingNaN</class></label>
|
||||||
<label for=PostProcessing_IgnoreLeadingNaN_enabled><class id="PostProcessing_IgnoreLeadingNaN_text" style="color:black;">IgnoreLeadingNaN</class></label>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="PostProcessing_IgnoreLeadingNaN_value1">
|
<select id="PostProcessing_IgnoreLeadingNaN_value1">
|
||||||
@@ -633,11 +659,10 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="MQTT_SetRetainFlag_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "SetRetainFlag")' unchecked >
|
<label for=MQTT_RetainMessages_enabled><class id="MQTT_RetainMessages_text" style="color:black;">Enable MQTT Retain Flag</class></label>
|
||||||
<label for=MQTT_SetRetainFlag_enabled><class id="MQTT_SetRetainFlag_text" style="color:black;">Enable MQTT Retain Flag</class></label>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="MQTT_SetRetainFlag_value1">
|
<select id="MQTT_RetainMessages_value1">
|
||||||
<option value="true" selected>true</option>
|
<option value="true" selected>true</option>
|
||||||
<option value="false" >false</option>
|
<option value="false" >false</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -655,7 +680,6 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="MQTT_HomeassistantDiscovery_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "HomeassistantDiscovery")' unchecked >
|
|
||||||
<label for=MQTT_HomeassistantDiscovery_enabled><class id="MQTT_HomeassistantDiscovery_text" style="color:black;">Homeassistant Discovery</class></label>
|
<label for=MQTT_HomeassistantDiscovery_enabled><class id="MQTT_HomeassistantDiscovery_text" style="color:black;">Homeassistant Discovery</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -700,7 +724,7 @@ textarea {
|
|||||||
<td colspan="3" style="padding-left: 20px;">
|
<td colspan="3" style="padding-left: 20px;">
|
||||||
<h4>
|
<h4>
|
||||||
<input type="checkbox" id="Category_InfluxDB_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
|
<input type="checkbox" id="Category_InfluxDB_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
|
||||||
<label for=Category_InfluxDB_enabled>InfluxDB</h4><h5>Only InfluxDB v1.x is supported, v2.x has a changed interface</h5></label>
|
<label for=Category_InfluxDB_enabled>InfluxDB</h4><h5>Only InfluxDB v1.x is supported as of now</h5></label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -764,6 +788,100 @@ textarea {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" style="padding-left: 20px;">
|
||||||
|
<h4>
|
||||||
|
<input type="checkbox" id="Category_InfluxDBv2_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
|
||||||
|
<label for=Category_InfluxDBv2_enabled>InfluxDBv2</h4><h5>Only InfluxDB v2.x is configured here, v1.x see above [InfluxDB]</h5></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent1">
|
||||||
|
<input type="checkbox" id="InfluxDBv2_Uri_enabled" value="1" onclick = 'InvertEnableItem("InfluxDBv2", "Uri")' unchecked >
|
||||||
|
<label for=InfluxDBv2_Uri_enabled><class id="InfluxDBv2_Uri_text" style="color:black;">Uri</class></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="InfluxDBv2_Uri_value1">
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
URI of the HTTP interface to InfluxDB (Version2), without traililing slash, e.g. http://IP-Address:Port
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent1">
|
||||||
|
<input type="checkbox" id="InfluxDBv2_Database_enabled" value="1" onclick = 'InvertEnableItem("InfluxDBv2", "Database")' unchecked >
|
||||||
|
<label for=InfluxDBv2_Database_enabled><class id="InfluxDBv2_Database_text" style="color:black;">Database</class></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="InfluxDBv2_Database_value1">
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
Database name in which to publish the read value.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent1">
|
||||||
|
<input type="checkbox" id="InfluxDBv2_Measurement_enabled" value="1" onclick = 'InvertEnableItem("InfluxDBv2", "Measurement")' unchecked >
|
||||||
|
<label for=InfluxDBv2_Measurement_enabled><class id="InfluxDBv2_Measurement_text" style="color:black;">Measurement</class></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="InfluxDBv2_Measurement_value1">
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
Measurement name to use to publish the read value.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent1">
|
||||||
|
<input type="checkbox" id="InfluxDBv2_Org_enabled" value="1" onclick = 'InvertEnableItem("InfluxDBv2", "Org")' unchecked >
|
||||||
|
<label for=InfluxDBv2_Org_enabled><class id="InfluxDBv2_Org_text" style="color:black;">Org</class></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="InfluxDBv2_Org_value1">
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
Organisation (Org) for InfluxDBv2 authentication
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent1">
|
||||||
|
<input type="checkbox" id="InfluxDBv2_Token_enabled" value="1" onclick = 'InvertEnableItem("InfluxDBv2", "Token")' unchecked >
|
||||||
|
<label for=InfluxDBv2_Token_enabled><class id="InfluxDBv2_Token_text" style="color:black;">Token</class></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="InfluxDBv2_Token_value1">
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
Token for InfluxDB authentication
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent1" colspan="3">
|
||||||
|
<br>
|
||||||
|
<b>Postprocessing Individual Parameters:
|
||||||
|
<select id="NumbersInfluxDB_value1" onchange="numberInfluxDBChanged()">
|
||||||
|
<option value="0" selected>default</option>
|
||||||
|
<option value="1" >NT</option>
|
||||||
|
<option value="2" >HT</option>
|
||||||
|
</select></b>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent1" style="padding-left: 75px;">
|
||||||
|
<input type="checkbox" id="InfluxDBv2_Fieldname_enabled" value="1" onclick = 'InvertEnableItem("InfluxDBv2", "Fieldname")' unchecked >
|
||||||
|
<label for=InfluxDBv2_Fieldname_enabled><class id="InfluxDBv2_Fieldname_text" style="color:black;">Fieldname</class></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="InfluxDBv2_Fieldname_value1">
|
||||||
|
</td>
|
||||||
|
<td style="font-size: 80%;">
|
||||||
|
Fieldname to use for saving.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3" style="padding-left: 20px;">
|
<td colspan="3" style="padding-left: 20px;">
|
||||||
<h4><input type="checkbox" id="Category_GPIO_enabled" value="1" onclick='UpdateAfterCategoryCheck()' unchecked >
|
<h4><input type="checkbox" id="Category_GPIO_enabled" value="1" onclick='UpdateAfterCategoryCheck()' unchecked >
|
||||||
@@ -1286,10 +1404,10 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="AutoTimer_Intervall_text" style="color:black;">Interval</class>
|
<class id="AutoTimer_Interval_text" style="color:black;">Interval</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="AutoTimer_Intervall_value1" size="13" min="3" step="any">
|
<input type="number" id="AutoTimer_Interval_value1" size="13" min="3" step="any">
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 80%;">
|
<td style="font-size: 80%;">
|
||||||
Interval in which the number(s) are read (in minutes). If a digitalization round takes longer than this interval, the next run gets postponed until the current run completes.
|
Interval in which the number(s) are read (in minutes). If a digitalization round takes longer than this interval, the next run gets postponed until the current run completes.
|
||||||
@@ -1316,10 +1434,10 @@ textarea {
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="DataLogging_DataLogRetentionInDays_text" style="color:black;">DataLogRetentionInDays</class>
|
<class id="DataLogging_DataFilesRetention_text" style="color:black;">DataFilesRetention</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="DataLogging_DataLogRetentionInDays_value1" size="13" min="0" step="1">
|
<input type="number" id="DataLogging_DataFilesRetention_value1" size="13" min="0" step="1">
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Time to keep the data files (in days - "0" = forever)
|
Time to keep the data files (in days - "0" = forever)
|
||||||
@@ -1331,10 +1449,10 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="Debug_Logfile_text" style="color:black;">Logfile Log Level</class>
|
<class id="Debug_LogLevel_text" style="color:black;">Logfile Log Level</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="Debug_Logfile_value1">
|
<select id="Debug_LogLevel_value1">
|
||||||
<option value="1" selected>ERROR</option> <!-- matches esp_log_level_t -->
|
<option value="1" selected>ERROR</option> <!-- matches esp_log_level_t -->
|
||||||
<option value="2">WARNING</option>
|
<option value="2">WARNING</option>
|
||||||
<option value="3">INFO</option>
|
<option value="3">INFO</option>
|
||||||
@@ -1347,10 +1465,10 @@ textarea {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<class id="Debug_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class>
|
<class id="Debug_LogfilesRetention_text" style="color:black;">LogfilesRetention</class>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" id="Debug_LogfileRetentionInDays_value1" size="13" min="0" step="1">
|
<input type="number" id="Debug_LogfilesRetention_value1" size="13" min="0" step="1">
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Time to keep the log files (in days - "0" = forever)
|
Time to keep the log files (in days - "0" = forever)
|
||||||
@@ -1400,15 +1518,15 @@ textarea {
|
|||||||
Hostname for server - will be transfered to wlan.ini at next startup)
|
Hostname for server - will be transfered to wlan.ini at next startup)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="expert" id="System_RSSIThreashold">
|
<tr class="expert" id="System_RSSIThreshold">
|
||||||
<td class="indent1">
|
<td class="indent1">
|
||||||
<input type="checkbox" id="System_RSSIThreashold_enabled" value="1" onclick = 'InvertEnableItem("System", "RSSIThreashold")' unchecked >
|
<input type="checkbox" id="System_RSSIThreshold_enabled" value="1" onclick = 'InvertEnableItem("System", "RSSIThreshold")' unchecked >
|
||||||
<label for=System_RSSIThreashold_enabled><class id="System_RSSIThreashold_text" style="color:black;">RSSIThreashold</class></label>
|
<label for=System_RSSIThreshold_enabled><class id="System_RSSIThreshold_text" style="color:black;">RSSIThreshold</class></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" name="name" id="System_RSSIThreashold_value1" min="-100" max="0" step="1">
|
<input type="number" name="name" id="System_RSSIThreshold_value1" min="-100" max="0" step="1">
|
||||||
<td class="description">
|
<td class="description">
|
||||||
WLAN Mesh Parameter: Threashold for RSSI value to check for start switching access point in a mesh system.
|
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)
|
Possible values: -100 to 0, 0 = disabled - Value will be transfered to wlan.ini at next startup)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -1463,7 +1581,8 @@ function LoadConfigNeu() {
|
|||||||
InitIndivParameter();
|
InitIndivParameter();
|
||||||
|
|
||||||
UpdateInput();
|
UpdateInput();
|
||||||
UpdateInputIndividual();
|
var sel = document.getElementById("Numbers_value1");
|
||||||
|
UpdateInputIndividual(sel);
|
||||||
UpdateExpertModus();
|
UpdateExpertModus();
|
||||||
document.getElementById("divall").style.display = '';
|
document.getElementById("divall").style.display = '';
|
||||||
}
|
}
|
||||||
@@ -1475,14 +1594,23 @@ function InitIndivParameter()
|
|||||||
var _index = document.getElementById("Numbers_value1");
|
var _index = document.getElementById("Numbers_value1");
|
||||||
while (_index.length)
|
while (_index.length)
|
||||||
_index.remove(0);
|
_index.remove(0);
|
||||||
|
var _indexInflux = document.getElementById("NumbersInfluxDB_value1");
|
||||||
|
while (_indexInflux.length)
|
||||||
|
_indexInflux.remove(0);
|
||||||
|
|
||||||
for (var i = 0; i < NUMBERS.length; ++i){
|
for (var i = 0; i < NUMBERS.length; ++i){
|
||||||
var option = document.createElement("option");
|
var option = document.createElement("option");
|
||||||
option.text = NUMBERS[i]["name"];
|
option.text = NUMBERS[i]["name"];
|
||||||
option.value = i;
|
option.value = i;
|
||||||
_index.add(option);
|
_index.add(option);
|
||||||
|
|
||||||
|
var optionInflux = document.createElement("option");
|
||||||
|
optionInflux.text = NUMBERS[i]["name"];
|
||||||
|
optionInflux.value = i;
|
||||||
|
_indexInflux.add(optionInflux);
|
||||||
}
|
}
|
||||||
_index.selectedIndex = 0;
|
_index.selectedIndex = 0;
|
||||||
|
_indexInflux.selectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1497,8 +1625,14 @@ function getParameterByName(name, url = window.location.href) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function WriteParameter(_param, _category, _cat, _name, _optional, _number = -1){
|
function WriteParameter(_param, _category, _cat, _name, _optional, _number = -1){
|
||||||
|
let anzpara;
|
||||||
let anzpara = _param[_cat][_name].anzParam;
|
try {
|
||||||
|
anzpara = _param[_cat][_name].anzParam;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
firework.launch("Parameter '" + _name + "' in category '" + _cat + "' is unknown!", 'danger', 30000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_number > -1) {
|
if (_number > -1) {
|
||||||
if ((NUMBERS[_number] == undefined) || (NUMBERS[_number][_cat] == undefined) || (NUMBERS[_number][_cat][_name] == undefined))
|
if ((NUMBERS[_number] == undefined) || (NUMBERS[_number][_cat] == undefined) || (NUMBERS[_number][_cat][_name] == undefined))
|
||||||
@@ -1767,7 +1901,7 @@ function ReadParameter(_param, _cat, _name, _optional, _number = -1){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateInputIndividual()
|
function UpdateInputIndividual(sel)
|
||||||
{
|
{
|
||||||
if (NUNBERSAkt != -1)
|
if (NUNBERSAkt != -1)
|
||||||
{
|
{
|
||||||
@@ -1775,20 +1909,22 @@ function UpdateInputIndividual()
|
|||||||
ReadParameter(param, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt)
|
||||||
ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt)
|
||||||
ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt)
|
||||||
ReadParameter(param, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "ExtendedResolution", false, NUNBERSAkt)
|
||||||
ReadParameter(param, "PostProcessing", "IgnoreLeadingNaN", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "IgnoreLeadingNaN", false, NUNBERSAkt)
|
||||||
ReadParameter(param, "PostProcessing", "AllowNegativeRates", true, NUNBERSAkt)
|
ReadParameter(param, "PostProcessing", "AllowNegativeRates", false, NUNBERSAkt)
|
||||||
|
ReadParameter(param, "InfluxDBv2", "Fieldname", true, NUNBERSAkt)
|
||||||
}
|
}
|
||||||
|
|
||||||
var sel = document.getElementById("Numbers_value1");
|
// var sel = document.getElementById("Numbers_value1");
|
||||||
NUNBERSAkt = sel.selectedIndex;
|
NUNBERSAkt = sel.selectedIndex;
|
||||||
WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "AnalogDigitalTransitionStart", true, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "ExtendedResolution", false, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "IgnoreLeadingNaN", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "IgnoreLeadingNaN", false, NUNBERSAkt);
|
||||||
WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true, NUNBERSAkt);
|
WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", false, NUNBERSAkt);
|
||||||
|
WriteParameter(param, category, "InfluxDBv2", "Fieldname", true, NUNBERSAkt);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateInput() {
|
function UpdateInput() {
|
||||||
@@ -1797,44 +1933,45 @@ function UpdateInput() {
|
|||||||
document.getElementById("Category_MQTT_enabled").checked = category["MQTT"]["enabled"];
|
document.getElementById("Category_MQTT_enabled").checked = category["MQTT"]["enabled"];
|
||||||
document.getElementById("Category_GPIO_enabled").checked = category["GPIO"]["enabled"];
|
document.getElementById("Category_GPIO_enabled").checked = category["GPIO"]["enabled"];
|
||||||
document.getElementById("Category_InfluxDB_enabled").checked = category["InfluxDB"]["enabled"];
|
document.getElementById("Category_InfluxDB_enabled").checked = category["InfluxDB"]["enabled"];
|
||||||
|
document.getElementById("Category_InfluxDBv2_enabled").checked = category["InfluxDBv2"]["enabled"];
|
||||||
setVisible("GPIO_item", category["GPIO"]["enabled"]);
|
setVisible("GPIO_item", category["GPIO"]["enabled"]);
|
||||||
|
|
||||||
WriteParameter(param, category, "MakeImage", "LogImageLocation", true);
|
WriteParameter(param, category, "TakeImage", "RawImagesLocation", true);
|
||||||
WriteParameter(param, category, "MakeImage", "LogfileRetentionInDays", true);
|
WriteParameter(param, category, "TakeImage", "RawImagesRetention", true);
|
||||||
WriteParameter(param, category, "MakeImage", "Demo", true);
|
WriteParameter(param, category, "TakeImage", "Demo", false);
|
||||||
WriteParameter(param, category, "MakeImage", "WaitBeforeTakingPicture", false);
|
WriteParameter(param, category, "TakeImage", "WaitBeforeTakingPicture", false);
|
||||||
WriteParameter(param, category, "MakeImage", "ImageQuality", false);
|
WriteParameter(param, category, "TakeImage", "ImageQuality", false);
|
||||||
WriteParameter(param, category, "MakeImage", "Brightness", false);
|
WriteParameter(param, category, "TakeImage", "Brightness", false);
|
||||||
WriteParameter(param, category, "MakeImage", "Contrast", false);
|
WriteParameter(param, category, "TakeImage", "Contrast", false);
|
||||||
WriteParameter(param, category, "MakeImage", "Saturation", false);
|
WriteParameter(param, category, "TakeImage", "Saturation", false);
|
||||||
WriteParameter(param, category, "MakeImage", "LEDIntensity", false);
|
WriteParameter(param, category, "TakeImage", "LEDIntensity", false);
|
||||||
WriteParameter(param, category, "MakeImage", "ImageSize", false);
|
WriteParameter(param, category, "TakeImage", "ImageSize", false);
|
||||||
WriteParameter(param, category, "MakeImage", "FixedExposure", false);
|
WriteParameter(param, category, "TakeImage", "FixedExposure", false);
|
||||||
|
|
||||||
WriteParameter(param, category, "Alignment", "SearchFieldX", false);
|
WriteParameter(param, category, "Alignment", "SearchFieldX", false);
|
||||||
WriteParameter(param, category, "Alignment", "SearchFieldY", false);
|
WriteParameter(param, category, "Alignment", "SearchFieldY", false);
|
||||||
WriteParameter(param, category, "Alignment", "AlignmentAlgo", true);
|
WriteParameter(param, category, "Alignment", "AlignmentAlgo", true);
|
||||||
|
|
||||||
WriteParameter(param, category, "Digits", "CNNGoodThreshold", true);
|
WriteParameter(param, category, "Digits", "CNNGoodThreshold", true);
|
||||||
WriteParameter(param, category, "Digits", "LogImageLocation", true);
|
WriteParameter(param, category, "Digits", "ROIImagesLocation", true);
|
||||||
WriteParameter(param, category, "Digits", "LogfileRetentionInDays", true);
|
WriteParameter(param, category, "Digits", "ROIImagesRetention", true);
|
||||||
|
|
||||||
WriteParameter(param, category, "Analog", "LogImageLocation", true);
|
WriteParameter(param, category, "Analog", "ROIImagesLocation", true);
|
||||||
WriteParameter(param, category, "Analog", "LogfileRetentionInDays", true);
|
WriteParameter(param, category, "Analog", "ROIImagesRetention", true);
|
||||||
|
|
||||||
WriteParameter(param, category, "PostProcessing", "PreValueUse", true);
|
WriteParameter(param, category, "PostProcessing", "PreValueUse", false);
|
||||||
WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true);
|
WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true);
|
||||||
// WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true);
|
// WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true);
|
||||||
WriteParameter(param, category, "PostProcessing", "ErrorMessage", true);
|
WriteParameter(param, category, "PostProcessing", "ErrorMessage", false);
|
||||||
WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", true);
|
WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", false);
|
||||||
|
|
||||||
WriteParameter(param, category, "MQTT", "Uri", true);
|
WriteParameter(param, category, "MQTT", "Uri", true);
|
||||||
WriteParameter(param, category, "MQTT", "MainTopic", true);
|
WriteParameter(param, category, "MQTT", "MainTopic", true);
|
||||||
WriteParameter(param, category, "MQTT", "ClientID", true);
|
WriteParameter(param, category, "MQTT", "ClientID", true);
|
||||||
WriteParameter(param, category, "MQTT", "user", true);
|
WriteParameter(param, category, "MQTT", "user", true);
|
||||||
WriteParameter(param, category, "MQTT", "password", true);
|
WriteParameter(param, category, "MQTT", "password", true);
|
||||||
WriteParameter(param, category, "MQTT", "SetRetainFlag", true);
|
WriteParameter(param, category, "MQTT", "RetainMessages", false);
|
||||||
WriteParameter(param, category, "MQTT", "HomeassistantDiscovery", true);
|
WriteParameter(param, category, "MQTT", "HomeassistantDiscovery", false);
|
||||||
WriteParameter(param, category, "MQTT", "MeterType", true);
|
WriteParameter(param, category, "MQTT", "MeterType", true);
|
||||||
|
|
||||||
WriteParameter(param, category, "InfluxDB", "Uri", true);
|
WriteParameter(param, category, "InfluxDB", "Uri", true);
|
||||||
@@ -1843,6 +1980,13 @@ function UpdateInput() {
|
|||||||
WriteParameter(param, category, "InfluxDB", "user", true);
|
WriteParameter(param, category, "InfluxDB", "user", true);
|
||||||
WriteParameter(param, category, "InfluxDB", "password", true);
|
WriteParameter(param, category, "InfluxDB", "password", true);
|
||||||
|
|
||||||
|
WriteParameter(param, category, "InfluxDBv2", "Uri", true);
|
||||||
|
WriteParameter(param, category, "InfluxDBv2", "Database", true);
|
||||||
|
WriteParameter(param, category, "InfluxDBv2", "Measurement", true);
|
||||||
|
WriteParameter(param, category, "InfluxDBv2", "Org", true);
|
||||||
|
WriteParameter(param, category, "InfluxDBv2", "Token", true);
|
||||||
|
WriteParameter(param, category, "InfluxDBv2", "Fieldname", true);
|
||||||
|
|
||||||
WriteParameter(param, category, "GPIO", "IO0", true);
|
WriteParameter(param, category, "GPIO", "IO0", true);
|
||||||
WriteParameter(param, category, "GPIO", "IO1", true);
|
WriteParameter(param, category, "GPIO", "IO1", true);
|
||||||
WriteParameter(param, category, "GPIO", "IO3", true);
|
WriteParameter(param, category, "GPIO", "IO3", true);
|
||||||
@@ -1854,18 +1998,18 @@ function UpdateInput() {
|
|||||||
WriteParameter(param, category, "GPIO", "LEDColor", false);
|
WriteParameter(param, category, "GPIO", "LEDColor", false);
|
||||||
|
|
||||||
WriteParameter(param, category, "AutoTimer", "AutoStart", false);
|
WriteParameter(param, category, "AutoTimer", "AutoStart", false);
|
||||||
WriteParameter(param, category, "AutoTimer", "Intervall", false);
|
WriteParameter(param, category, "AutoTimer", "Interval", false);
|
||||||
|
|
||||||
WriteParameter(param, category, "DataLogging", "DataLogActive", false);
|
WriteParameter(param, category, "DataLogging", "DataLogActive", false);
|
||||||
WriteParameter(param, category, "DataLogging", "DataLogRetentionInDays", false);
|
WriteParameter(param, category, "DataLogging", "DataFilesRetention", false);
|
||||||
|
|
||||||
WriteParameter(param, category, "Debug", "Logfile", false);
|
WriteParameter(param, category, "Debug", "LogLevel", false);
|
||||||
WriteParameter(param, category, "Debug", "LogfileRetentionInDays", false);
|
WriteParameter(param, category, "Debug", "LogfilesRetention", false);
|
||||||
|
|
||||||
WriteParameter(param, category, "System", "TimeZone", true);
|
WriteParameter(param, category, "System", "TimeZone", true);
|
||||||
WriteParameter(param, category, "System", "Hostname", true);
|
WriteParameter(param, category, "System", "Hostname", true);
|
||||||
WriteParameter(param, category, "System", "TimeServer", true);
|
WriteParameter(param, category, "System", "TimeServer", true);
|
||||||
WriteParameter(param, category, "System", "RSSIThreashold", true);
|
WriteParameter(param, category, "System", "RSSIThreshold", true);
|
||||||
|
|
||||||
WriteModelFiles();
|
WriteModelFiles();
|
||||||
}
|
}
|
||||||
@@ -1918,19 +2062,20 @@ function ReadParameterAll()
|
|||||||
category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
|
category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
|
||||||
category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
|
category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
|
||||||
category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked;
|
category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked;
|
||||||
|
category["InfluxDBv2"]["enabled"] = document.getElementById("Category_InfluxDBv2_enabled").checked;
|
||||||
category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked;
|
category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked;
|
||||||
|
|
||||||
ReadParameter(param, "MakeImage", "LogImageLocation", true);
|
ReadParameter(param, "TakeImage", "RawImagesLocation", true);
|
||||||
ReadParameter(param, "MakeImage", "LogfileRetentionInDays", true);
|
ReadParameter(param, "TakeImage", "RawImagesRetention", true);
|
||||||
ReadParameter(param, "MakeImage", "Demo", true);
|
ReadParameter(param, "TakeImage", "Demo", false);
|
||||||
ReadParameter(param, "MakeImage", "WaitBeforeTakingPicture", false);
|
ReadParameter(param, "TakeImage", "WaitBeforeTakingPicture", false);
|
||||||
ReadParameter(param, "MakeImage", "ImageQuality", false);
|
ReadParameter(param, "TakeImage", "ImageQuality", false);
|
||||||
ReadParameter(param, "MakeImage", "Brightness", false);
|
ReadParameter(param, "TakeImage", "Brightness", false);
|
||||||
ReadParameter(param, "MakeImage", "Contrast", false);
|
ReadParameter(param, "TakeImage", "Contrast", false);
|
||||||
ReadParameter(param, "MakeImage", "Saturation", false);
|
ReadParameter(param, "TakeImage", "Saturation", false);
|
||||||
ReadParameter(param, "MakeImage", "LEDIntensity", false);
|
ReadParameter(param, "TakeImage", "LEDIntensity", false);
|
||||||
ReadParameter(param, "MakeImage", "ImageSize", false);
|
ReadParameter(param, "TakeImage", "ImageSize", false);
|
||||||
ReadParameter(param, "MakeImage", "FixedExposure", false);
|
ReadParameter(param, "TakeImage", "FixedExposure", false);
|
||||||
|
|
||||||
ReadParameter(param, "Alignment", "SearchFieldX", false);
|
ReadParameter(param, "Alignment", "SearchFieldX", false);
|
||||||
ReadParameter(param, "Alignment", "SearchFieldY", false);
|
ReadParameter(param, "Alignment", "SearchFieldY", false);
|
||||||
@@ -1938,26 +2083,25 @@ function ReadParameterAll()
|
|||||||
|
|
||||||
ReadParameter(param, "Digits", "Model", false);
|
ReadParameter(param, "Digits", "Model", false);
|
||||||
ReadParameter(param, "Digits", "CNNGoodThreshold", true);
|
ReadParameter(param, "Digits", "CNNGoodThreshold", true);
|
||||||
ReadParameter(param, "Digits", "LogImageLocation", true);
|
ReadParameter(param, "Digits", "ROIImagesLocation", true);
|
||||||
ReadParameter(param, "Digits", "LogfileRetentionInDays", true);
|
ReadParameter(param, "Digits", "ROIImagesRetention", true);
|
||||||
|
|
||||||
ReadParameter(param, "Analog", "Model", false);
|
ReadParameter(param, "Analog", "Model", false);
|
||||||
ReadParameter(param, "Analog", "LogImageLocation", true);
|
ReadParameter(param, "Analog", "ROIImagesLocation", true);
|
||||||
ReadParameter(param, "Analog", "LogfileRetentionInDays", true);
|
ReadParameter(param, "Analog", "ROIImagesRetention", true);
|
||||||
|
|
||||||
ReadParameter(param, "PostProcessing", "PreValueUse", true);
|
ReadParameter(param, "PostProcessing", "PreValueUse", false);
|
||||||
ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true);
|
ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true);
|
||||||
// ReadParameter(param, "PostProcessing", "AllowNegativeRates", true);
|
ReadParameter(param, "PostProcessing", "ErrorMessage", false);
|
||||||
ReadParameter(param, "PostProcessing", "ErrorMessage", true);
|
ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", false);
|
||||||
ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", true);
|
|
||||||
|
|
||||||
ReadParameter(param, "MQTT", "Uri", true);
|
ReadParameter(param, "MQTT", "Uri", true);
|
||||||
ReadParameter(param, "MQTT", "MainTopic", true);
|
ReadParameter(param, "MQTT", "MainTopic", true);
|
||||||
ReadParameter(param, "MQTT", "ClientID", true);
|
ReadParameter(param, "MQTT", "ClientID", true);
|
||||||
ReadParameter(param, "MQTT", "user", true);
|
ReadParameter(param, "MQTT", "user", true);
|
||||||
ReadParameter(param, "MQTT", "password", true);
|
ReadParameter(param, "MQTT", "password", true);
|
||||||
ReadParameter(param, "MQTT", "SetRetainFlag", true);
|
ReadParameter(param, "MQTT", "RetainMessages", false);
|
||||||
ReadParameter(param, "MQTT", "HomeassistantDiscovery", true);
|
ReadParameter(param, "MQTT", "HomeassistantDiscovery", false);
|
||||||
ReadParameter(param, "MQTT", "MeterType", true);
|
ReadParameter(param, "MQTT", "MeterType", true);
|
||||||
|
|
||||||
ReadParameter(param, "InfluxDB", "Uri", true);
|
ReadParameter(param, "InfluxDB", "Uri", true);
|
||||||
@@ -1966,6 +2110,13 @@ function ReadParameterAll()
|
|||||||
ReadParameter(param, "InfluxDB", "user", true);
|
ReadParameter(param, "InfluxDB", "user", true);
|
||||||
ReadParameter(param, "InfluxDB", "password", true);
|
ReadParameter(param, "InfluxDB", "password", true);
|
||||||
|
|
||||||
|
ReadParameter(param, "InfluxDBv2", "Uri", true);
|
||||||
|
ReadParameter(param, "InfluxDBv2", "Database", true);
|
||||||
|
ReadParameter(param, "InfluxDBv2", "Measurement", true);
|
||||||
|
ReadParameter(param, "InfluxDBv2", "Org", true);
|
||||||
|
ReadParameter(param, "InfluxDBv2", "Token", true);
|
||||||
|
// ReadParameter(param, "InfluxDB", "Fieldname", true);
|
||||||
|
|
||||||
ReadParameter(param, "GPIO", "IO0", true);
|
ReadParameter(param, "GPIO", "IO0", true);
|
||||||
ReadParameter(param, "GPIO", "IO1", true);
|
ReadParameter(param, "GPIO", "IO1", true);
|
||||||
ReadParameter(param, "GPIO", "IO3", true);
|
ReadParameter(param, "GPIO", "IO3", true);
|
||||||
@@ -1984,20 +2135,21 @@ function ReadParameterAll()
|
|||||||
param["GPIO"]["LEDColor"]["found"] = true;
|
param["GPIO"]["LEDColor"]["found"] = true;
|
||||||
|
|
||||||
ReadParameter(param, "AutoTimer", "AutoStart", false);
|
ReadParameter(param, "AutoTimer", "AutoStart", false);
|
||||||
ReadParameter(param, "AutoTimer", "Intervall", false);
|
ReadParameter(param, "AutoTimer", "Interval", false);
|
||||||
|
|
||||||
ReadParameter(param, "DataLogging", "DataLogActive", false);
|
ReadParameter(param, "DataLogging", "DataLogActive", false);
|
||||||
ReadParameter(param, "DataLogging", "DataLogRetentionInDays", false);
|
ReadParameter(param, "DataLogging", "DataFilesRetention", false);
|
||||||
|
|
||||||
ReadParameter(param, "Debug", "Logfile", false);
|
ReadParameter(param, "Debug", "LogLevel", false);
|
||||||
ReadParameter(param, "Debug", "LogfileRetentionInDays", false);
|
ReadParameter(param, "Debug", "LogfilesRetention", false);
|
||||||
|
|
||||||
ReadParameter(param, "System", "TimeZone", true);
|
ReadParameter(param, "System", "TimeZone", true);
|
||||||
ReadParameter(param, "System", "Hostname", true);
|
ReadParameter(param, "System", "Hostname", true);
|
||||||
ReadParameter(param, "System", "TimeServer", true);
|
ReadParameter(param, "System", "TimeServer", true);
|
||||||
ReadParameter(param, "System", "RSSIThreashold", true);
|
ReadParameter(param, "System", "RSSIThreshold", true);
|
||||||
|
|
||||||
UpdateInputIndividual();
|
var sel = document.getElementById("Numbers_value1");
|
||||||
|
UpdateInputIndividual(sel);
|
||||||
|
|
||||||
// FormatDecimalValue(param, "PostProcessing", "MaxRateValue");
|
// FormatDecimalValue(param, "PostProcessing", "MaxRateValue");
|
||||||
}
|
}
|
||||||
@@ -2017,10 +2169,12 @@ function UpdateAfterCategoryCheck() {
|
|||||||
category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
|
category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
|
||||||
category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
|
category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
|
||||||
category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked;
|
category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked;
|
||||||
|
category["InfluxDBv2"]["enabled"] = document.getElementById("Category_InfluxDBv2_enabled").checked;
|
||||||
category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked;
|
category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked;
|
||||||
|
|
||||||
UpdateInput();
|
UpdateInput();
|
||||||
UpdateInputIndividual();
|
var sel = document.getElementById("Numbers_value1");
|
||||||
|
UpdateInputIndividual(sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateExpertModus()
|
function UpdateExpertModus()
|
||||||
@@ -2071,7 +2225,7 @@ function saveTextAsFile()
|
|||||||
ReadParameterAll();
|
ReadParameterAll();
|
||||||
WriteConfigININew();
|
WriteConfigININew();
|
||||||
SaveConfigToServer(domainname);
|
SaveConfigToServer(domainname);
|
||||||
firework.launch('Configuration got updated. Please reboot to activate changes!', 'success', 5000);
|
firework.launch('Configuration got updated. It will get applied after the next reboot!', 'success', 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2097,7 +2251,24 @@ function editConfigDirect() {
|
|||||||
|
|
||||||
function numberChanged()
|
function numberChanged()
|
||||||
{
|
{
|
||||||
UpdateInputIndividual();
|
var sel = document.getElementById("Numbers_value1");
|
||||||
|
_neu = sel.selectedIndex;
|
||||||
|
UpdateInputIndividual(sel);
|
||||||
|
|
||||||
|
var _selInflux = document.getElementById("NumbersInfluxDB_value1");
|
||||||
|
if (_selInflux.selectedIndex != _neu)
|
||||||
|
_selInflux.selectedIndex = _neu
|
||||||
|
}
|
||||||
|
|
||||||
|
function numberInfluxDBChanged()
|
||||||
|
{
|
||||||
|
var sel = document.getElementById("NumbersInfluxDB_value1");
|
||||||
|
_neu = sel.selectedIndex;
|
||||||
|
UpdateInputIndividual(sel);
|
||||||
|
|
||||||
|
var _sel2 = document.getElementById("Numbers_value1");
|
||||||
|
if (_sel2.selectedIndex != _neu)
|
||||||
|
_sel2.selectedIndex = _neu
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadConfigNeu();
|
LoadConfigNeu();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<title>Make Digital Alignment</title>
|
<title>Digit ROI's</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
h1 {font-size: 2em;}
|
h1 {font-size: 2em;}
|
||||||
@@ -58,8 +58,15 @@ th, td {
|
|||||||
|
|
||||||
<body style="font-family: arial; padding: 0px 10px;">
|
<body style="font-family: arial; padding: 0px 10px;">
|
||||||
|
|
||||||
<h2><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'EnDisableDigits()' checked >
|
<h2>Digit ROI's</h2>
|
||||||
Edit Digits</h2>
|
<p>On this page you define ROI's for the digits.
|
||||||
|
See <a href=https://jomjol.github.io/AI-on-the-edge-device-docs/ROI-Configuration/ target=_blank>https://jomjol.github.io/AI-on-the-edge-device-docs/ROI-Configuration/</a> for explanations.</p>
|
||||||
|
|
||||||
|
<p><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'EnDisableDigits()' checked><label for="Category_Digits_enabled">Enable Digit ROI's</label></p>
|
||||||
|
|
||||||
|
<p>After saving the digit ROI's, you can define the <a href=edit_analog.html>analog</a> ROI's if your meter has analog counters.<br>
|
||||||
|
Only after those steps a reboot is required.</p>
|
||||||
|
|
||||||
|
|
||||||
<div id="div1">
|
<div id="div1">
|
||||||
|
|
||||||
@@ -126,10 +133,8 @@ th, td {
|
|||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input class="button" type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save" tabindex=10></td>
|
<td><input class="button" type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save" tabindex=10>
|
||||||
</tr>
|
<p>Proceed to update the <a href=edit_analog.html>analog</a> ROI's when you are done or <a href=reboot_page.html>reboot</a> if there are no analogue counters.</p></td>
|
||||||
<tr>
|
|
||||||
<td><button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate changes</button></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -291,7 +296,7 @@ function SaveToConfig(){
|
|||||||
cofcat["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
|
cofcat["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
|
||||||
WriteConfigININew();
|
WriteConfigININew();
|
||||||
SaveConfigToServer(domainname);
|
SaveConfigToServer(domainname);
|
||||||
firework.launch('Configuration got updated. Please reboot to activate changes!', 'success', 5000);
|
firework.launch('Configuration got updated. It will get applied after the next reboot!', 'success', 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,12 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
This is the first time you started the digitizer after the initial installation. You have been automatically routed to the <b>initial setup procedure</b>.
|
This is the first time you started the digitizer after the initial installation. You have been automatically routed to the <b>initial setup procedure</b>.
|
||||||
Here you adjust the settings for your counter within five steps. In the final step the inital setup will be disabled and it will restart to the normal mode.
|
Here you adjust the settings for your meter within five steps. In the final step the inital setup will be disabled and it will restart to the normal mode.
|
||||||
All settings will also be accessible there.
|
All settings will also be accessible there. See <a href=https://jomjol.github.io/AI-on-the-edge-device-docs/initial-setup target=_blank>
|
||||||
<br>
|
https://jomjol.github.io/AI-on-the-edge-device-docs/initial-setup</a> for additional explanations.</p>
|
||||||
<br>
|
</p>
|
||||||
You can navigate forward and backward during the setup with the buttons "Next" and "Previous".<br><br>
|
<p>You can navigate forward and backward during the setup with the buttons "Next" and "Previous".<br><br>
|
||||||
<span color=red>Do not forget to save in each step!</span><br>
|
<span color=red>Do not forget to save in each step before heading to another step!</span><br>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
This is an overview over the five steps:
|
This is an overview over the five steps:
|
||||||
@@ -41,26 +41,27 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Create reference image <br>
|
<li><p>Create the <b>Reference Image</b>.<br>
|
||||||
Base for the position referencing and the identification of the digits and counters.</li>
|
It is the base for the position referencing and the identification of the digits and counters.</p></li>
|
||||||
<li>Define two unique references <br>
|
<li><p>Define two unique <b>Reference Marks</b>.<br>
|
||||||
Used to align the individual camera shot and identify the absolut positions</li>
|
They is used to align the individual camera images and identify the absolut positions.</p></li>
|
||||||
<li>Define the digits <br>
|
<li></p>Define <b>ROI's</b> for the <b>Digits</b>.<br>
|
||||||
Digital digits to be recognized</li>
|
They will be used to digitize the digit part of your meter.<br>
|
||||||
<li>Define the analog counters <br>
|
If your meter has no digits, this step can be skipped.</p></li>
|
||||||
Analog counters to be identified</li>
|
<li>Define <b>ROI's</b>> for the <b>Analog Counters</b>.<br>
|
||||||
<li>General settings <br>
|
They will be used to digitize the analog part of your meter.<br>
|
||||||
Most settings can be used with default value at the beginning. MQTT connection can be specified here</li>
|
If your meter has no analog counters, this step can be skipped.</p></li>
|
||||||
|
<li><p><b>General Settings</b><br>
|
||||||
|
Further configuration of your device.</p></li>
|
||||||
</ol>
|
</ol>
|
||||||
<p>
|
|
||||||
|
|
||||||
After step 5 setup mode is completed, it then reboots and starts into the normal mode.
|
<p>Please be patient when switching to another step. The device takes some time to load all needed information!</p>
|
||||||
<br><br>
|
|
||||||
|
|
||||||
If you need support, have a look to the <a href=https://jomjol.github.io/AI-on-the-edge-device-docs target=_blank>documenation</a> or the <a href=https://github.com/jomjol/AI-on-the-edge-device/discussions target=_blank>discussion</a> pages.<br>
|
<p>After step 5 the setup is completed, you then can reboot and starts into the normal operation mode.</p>
|
||||||
|
|
||||||
<h4>Have fun with the digitizer!</h4>
|
<p>If you need support, have a look to the <a href=https://jomjol.github.io/AI-on-the-edge-device-docs target=_blank>documentation</a> or the <a href=https://github.com/jomjol/AI-on-the-edge-device/discussions target=_blank>discussion</a> pages.</p>
|
||||||
|
|
||||||
|
<p><b>Have fun with your digitizer!</b></p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -28,16 +28,11 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<body style="font-family: arial">
|
<body style="font-family: arial">
|
||||||
|
|
||||||
<h4>Finished!</h4>
|
<h4>Step 6: Setup Completed!</h4>
|
||||||
|
|
||||||
<p>
|
<p>Congratulations, you completed the setup and are now ready to reboot to the normal mode!</p>
|
||||||
Now you are finished with the setup and ready to reboot to the normal mode.
|
<p>Once you have pushed the button below, the setup modus will be left and the digitizer will restart to normal operation mode.<br>
|
||||||
<br>
|
The Web Interface will automatically reload. It will take some minutes until you get the first reading.
|
||||||
Once you have pushed below button, the setup modus will be left and the digitizer will restart to normal operation mode.
|
|
||||||
<br>
|
|
||||||
The Web Interface will automatically reload. It will take two to four minutes, until you get the first reading.
|
|
||||||
<br>
|
|
||||||
All settings can be changed as well in the configuration menu in the Normal modus.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
||||||
<title>Make Reference</title>
|
<title>Reference Image</title>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@@ -36,8 +36,12 @@ table {
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="font-family: arial; padding: 0px 10px;">
|
<body style="font-family: arial; padding: 0px 10px;">
|
||||||
<h2>Create Reference out of Raw Image</h2>
|
<h2>Reference Image</h2>
|
||||||
<p><b>Note: After saving a new Reference Image, make sure to update the Alignment Marks and the ROI's and reboot once!</b></p>
|
<p>On this page you define the Reference Image.
|
||||||
|
See <a href=https://jomjol.github.io/AI-on-the-edge-device-docs/Reference-Image/ target=_blank>https://jomjol.github.io/AI-on-the-edge-device-docs/Reference-Image/</a> for explanations.</p>
|
||||||
|
<p>After saving a new Reference Image, make sure to update the <a href=edit_alignment.html>Alignment Marks</a> and then
|
||||||
|
the <a href=edit_digits.html>digit</a> resp. <a href=edit_analog.html>analog</a> ROI's.<br>
|
||||||
|
Only after those steps a reboot is required.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -49,8 +53,8 @@ table {
|
|||||||
<td style="padding-top: 10px"><label for="mirror" id="labelmirror">Mirror Image:</label></td>
|
<td style="padding-top: 10px"><label for="mirror" id="labelmirror">Mirror Image:</label></td>
|
||||||
<td style="padding-top: 10px"><input type="checkbox" id="mirror" name="mirror" value="1" onchange="drawRotated()"></td>
|
<td style="padding-top: 10px"><input type="checkbox" id="mirror" name="mirror" value="1" onchange="drawRotated()"></td>
|
||||||
<td>
|
<td>
|
||||||
<class id="MakeImage_LEDIntensity_text" style="color:black;">LEDIntensity: </class>
|
<class id="TakeImage_LEDIntensity_text" style="color:black;">LEDIntensity: </class>
|
||||||
<input type="number" id="MakeImage_LEDIntensity_value1" size="13" value=0 min="0" max="100" style="float: right; clear: both;">
|
<input type="number" id="TakeImage_LEDIntensity_value1" size="13" value=0 min="0" max="100" style="float: right; clear: both;">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -58,8 +62,8 @@ table {
|
|||||||
<td><label for="flip" id="labelflip">Flip Image Size:</label></td>
|
<td><label for="flip" id="labelflip">Flip Image Size:</label></td>
|
||||||
<td><input type="checkbox" id="flip" name="flip" value="1" onchange="drawRotated()"></td>
|
<td><input type="checkbox" id="flip" name="flip" value="1" onchange="drawRotated()"></td>
|
||||||
<td>
|
<td>
|
||||||
<class id="MakeImage_Brightness_text" style="color:black;">Brightness: </class>
|
<class id="TakeImage_Brightness_text" style="color:black;">Brightness: </class>
|
||||||
<input type="number" id="MakeImage_Brightness_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
<input type="number" id="TakeImage_Brightness_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@@ -67,16 +71,16 @@ table {
|
|||||||
<td><label for="mirror">Pre-rotate Angle:</label></td>
|
<td><label for="mirror">Pre-rotate Angle:</label></td>
|
||||||
<td><input type="number" id="prerotateangle" name="prerotateangle" value="0" min="-360" max="360" onchange="drawRotated()">Degrees</td>
|
<td><input type="number" id="prerotateangle" name="prerotateangle" value="0" min="-360" max="360" onchange="drawRotated()">Degrees</td>
|
||||||
<td>
|
<td>
|
||||||
<class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
|
<class id="TakeImage_Contrast_text" style="color:black;">Contrast</class>
|
||||||
<input type="number" id="MakeImage_Contrast_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
<input type="number" id="TakeImage_Contrast_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="mirror">Fine Alignment:</label></td>
|
<td><label for="mirror">Fine Alignment:</label></td>
|
||||||
<td><input type="number" id="finerotate" name="finerotate" value=0.0 min="-1" max="1" step="0.2" onchange="drawRotated()">Degrees</td>
|
<td><input type="number" id="finerotate" name="finerotate" value=0.0 min="-1" max="1" step="0.2" onchange="drawRotated()">Degrees</td>
|
||||||
<td>
|
<td>
|
||||||
<class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
|
<class id="TakeImage_Saturation_text" style="color:black;">Saturation</class>
|
||||||
<input type="number" id="MakeImage_Saturation_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
<input type="number" id="TakeImage_Saturation_value1" size="13" value=0 min="-2" max="2" style="float: right; clear: both;">
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@@ -87,10 +91,8 @@ table {
|
|||||||
<td><canvas id="canvas"></canvas></td>
|
<td><canvas id="canvas"></canvas></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input class="button" type="button" id="updatereferenceimage" value="Save" onclick="SaveReference()"></td>
|
<td><input class="button" type="button" id="updatereferenceimage" value="Save" onclick="SaveReference()">
|
||||||
</tr>
|
<p>Proceed to update the <a href=edit_alignment.html>Alignment Marks</a> when you are done.</p></td>
|
||||||
<tr>
|
|
||||||
<td><button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate saved Reference</button></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -121,15 +123,15 @@ table {
|
|||||||
|
|
||||||
function doTake(){
|
function doTake(){
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
if (param["TakeImage"]["Brightness"].found && param["TakeImage"]["Brightness"].enabled)
|
||||||
{
|
{
|
||||||
_intensity = document.getElementById("MakeImage_LEDIntensity_value1").value;
|
_intensity = document.getElementById("TakeImage_LEDIntensity_value1").value;
|
||||||
if (_intensity == "") _intensity = "50";
|
if (_intensity == "") _intensity = "50";
|
||||||
_brightness = document.getElementById("MakeImage_Brightness_value1").value;
|
_brightness = document.getElementById("TakeImage_Brightness_value1").value;
|
||||||
_contrast = document.getElementById("MakeImage_Contrast_value1").value;
|
_contrast = document.getElementById("TakeImage_Contrast_value1").value;
|
||||||
_saturation = document.getElementById("MakeImage_Saturation_value1").value;
|
_saturation = document.getElementById("TakeImage_Saturation_value1").value;
|
||||||
url = getDomainname() + "/editflow?task=test_take&bri=" + _brightness;
|
url = getDomainname() + "/editflow?task=test_take&bri=" + _brightness;
|
||||||
url = url + "&con=" + _saturation + "&sat=" + _saturation + "&int=" + _intensity;
|
url = url + "&con=" + _contrast + "&sat=" + _saturation + "&int=" + _intensity;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -166,24 +168,24 @@ table {
|
|||||||
document.getElementById("labelflip").style = "color:lightgrey;";
|
document.getElementById("labelflip").style = "color:lightgrey;";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
if (param["TakeImage"]["Brightness"].found && param["TakeImage"]["Brightness"].enabled)
|
||||||
{
|
{
|
||||||
document.getElementById("MakeImage_Brightness_value1").disabled = false;
|
document.getElementById("TakeImage_Brightness_value1").disabled = false;
|
||||||
document.getElementById("MakeImage_Contrast_value1").disabled = false;
|
document.getElementById("TakeImage_Contrast_value1").disabled = false;
|
||||||
document.getElementById("MakeImage_Saturation_value1").disabled = false;
|
document.getElementById("TakeImage_Saturation_value1").disabled = false;
|
||||||
document.getElementById("MakeImage_LEDIntensity_value1").disabled = false;
|
document.getElementById("TakeImage_LEDIntensity_value1").disabled = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
document.getElementById("MakeImage_Brightness_value1").type = "hidden";
|
document.getElementById("TakeImage_Brightness_value1").type = "hidden";
|
||||||
document.getElementById("MakeImage_Brightness_text").style.visibility = "hidden";
|
document.getElementById("TakeImage_Brightness_text").style.visibility = "hidden";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (param["MakeImage"]["Saturation"].found)
|
// if (param["TakeImage"]["Saturation"].found)
|
||||||
// document.getElementById("MakeImage_Saturation_value1").disabled = false;
|
// document.getElementById("TakeImage_Saturation_value1").disabled = false;
|
||||||
// if (param["MakeImage"]["Contrast"].found)
|
// if (param["TakeImage"]["Contrast"].found)
|
||||||
// document.getElementById("MakeImage_Contrast_value1").disabled = false;
|
// document.getElementById("TakeImage_Contrast_value1").disabled = false;
|
||||||
|
|
||||||
isActReference = false;
|
isActReference = false;
|
||||||
loadCanvas(url);
|
loadCanvas(url);
|
||||||
@@ -205,16 +207,16 @@ table {
|
|||||||
document.getElementById("prerotateangle").disabled = true;
|
document.getElementById("prerotateangle").disabled = true;
|
||||||
document.getElementById("updatereferenceimage").disabled = true;
|
document.getElementById("updatereferenceimage").disabled = true;
|
||||||
document.getElementById("take").disabled = true;
|
document.getElementById("take").disabled = true;
|
||||||
document.getElementById("MakeImage_Brightness_value1").disabled = true;
|
document.getElementById("TakeImage_Brightness_value1").disabled = true;
|
||||||
document.getElementById("MakeImage_Saturation_value1").disabled = true;
|
document.getElementById("TakeImage_Saturation_value1").disabled = true;
|
||||||
document.getElementById("MakeImage_Contrast_value1").disabled = true;
|
document.getElementById("TakeImage_Contrast_value1").disabled = true;
|
||||||
document.getElementById("MakeImage_LEDIntensity_value1").disabled = true;
|
document.getElementById("TakeImage_LEDIntensity_value1").disabled = true;
|
||||||
document.getElementById("mirror").disabled = false;
|
document.getElementById("mirror").disabled = false;
|
||||||
document.getElementById("flip").disabled = false;
|
document.getElementById("flip").disabled = false;
|
||||||
if (!(param["MakeImage"]["Brightness"].found))
|
if (!(param["TakeImage"]["Brightness"].found))
|
||||||
{
|
{
|
||||||
document.getElementById("MakeImage_Brightness_value1").type = "hidden";
|
document.getElementById("TakeImage_Brightness_value1").type = "hidden";
|
||||||
document.getElementById("MakeImage_Brightness_text").style.visibility = "hidden";
|
document.getElementById("TakeImage_Brightness_text").style.visibility = "hidden";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -253,12 +255,12 @@ table {
|
|||||||
else
|
else
|
||||||
param["Alignment"]["FlipImageSize"].value1 = "false";
|
param["Alignment"]["FlipImageSize"].value1 = "false";
|
||||||
|
|
||||||
if (param["MakeImage"]["Brightness"].found && param["MakeImage"]["Brightness"].enabled)
|
if (param["TakeImage"]["Brightness"].found && param["TakeImage"]["Brightness"].enabled)
|
||||||
{
|
{
|
||||||
ReadParameter(param, "MakeImage", "Brightness", false);
|
ReadParameter(param, "TakeImage", "Brightness", false);
|
||||||
ReadParameter(param, "MakeImage", "Contrast", false);
|
ReadParameter(param, "TakeImage", "Contrast", false);
|
||||||
ReadParameter(param, "MakeImage", "Saturation", false);
|
ReadParameter(param, "TakeImage", "Saturation", false);
|
||||||
ReadParameter(param, "MakeImage", "LEDIntensity", false);
|
ReadParameter(param, "TakeImage", "LEDIntensity", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var canvas = document.getElementById("canvas");
|
var canvas = document.getElementById("canvas");
|
||||||
@@ -270,7 +272,7 @@ table {
|
|||||||
SaveCanvasToImage(canvas, "/config/reference.jpg", true, getDomainname());
|
SaveCanvasToImage(canvas, "/config/reference.jpg", true, getDomainname());
|
||||||
showReference(param);
|
showReference(param);
|
||||||
UpdatePage();
|
UpdatePage();
|
||||||
firework.launch('Reference got updated. Please reboot to activate changes!', 'success', 5000);
|
firework.launch('Reference got updated. It will get applied after the next reboot!', 'success', 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,30 +309,30 @@ table {
|
|||||||
ParseConfig();
|
ParseConfig();
|
||||||
param = getConfigParameters();
|
param = getConfigParameters();
|
||||||
|
|
||||||
param["MakeImage"]["LEDIntensity"]["enabled"] = true;
|
param["TakeImage"]["LEDIntensity"]["enabled"] = true;
|
||||||
param["MakeImage"]["Brightness"]["enabled"] = true;
|
param["TakeImage"]["Brightness"]["enabled"] = true;
|
||||||
param["MakeImage"]["Contrast"]["enabled"] = true;
|
param["TakeImage"]["Contrast"]["enabled"] = true;
|
||||||
param["MakeImage"]["Saturation"]["enabled"] = true;
|
param["TakeImage"]["Saturation"]["enabled"] = true;
|
||||||
|
|
||||||
if (!param["MakeImage"]["LEDIntensity"]["found"])
|
if (!param["TakeImage"]["LEDIntensity"]["found"])
|
||||||
{
|
{
|
||||||
param["MakeImage"]["LEDIntensity"]["found"] = true;
|
param["TakeImage"]["LEDIntensity"]["found"] = true;
|
||||||
param["MakeImage"]["LEDIntensity"]["value1"] = "50";
|
param["TakeImage"]["LEDIntensity"]["value1"] = "50";
|
||||||
}
|
}
|
||||||
if (!param["MakeImage"]["Brightness"]["found"])
|
if (!param["TakeImage"]["Brightness"]["found"])
|
||||||
{
|
{
|
||||||
param["MakeImage"]["Brightness"]["found"] = true;
|
param["TakeImage"]["Brightness"]["found"] = true;
|
||||||
param["MakeImage"]["Brightness"]["value1"] = "0";
|
param["TakeImage"]["Brightness"]["value1"] = "0";
|
||||||
}
|
}
|
||||||
if (!param["MakeImage"]["Contrast"]["found"])
|
if (!param["TakeImage"]["Contrast"]["found"])
|
||||||
{
|
{
|
||||||
param["MakeImage"]["Contrast"]["found"] = true;
|
param["TakeImage"]["Contrast"]["found"] = true;
|
||||||
param["MakeImage"]["Contrast"]["value1"] = "0";
|
param["TakeImage"]["Contrast"]["value1"] = "0";
|
||||||
}
|
}
|
||||||
if (!param["MakeImage"]["Saturation"]["found"])
|
if (!param["TakeImage"]["Saturation"]["found"])
|
||||||
{
|
{
|
||||||
param["MakeImage"]["Saturation"]["found"] = true;
|
param["TakeImage"]["Saturation"]["found"] = true;
|
||||||
param["MakeImage"]["Saturation"]["value1"] = "0";
|
param["TakeImage"]["Saturation"]["value1"] = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateInput();
|
UpdateInput();
|
||||||
@@ -338,10 +340,10 @@ table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function UpdateInput() {
|
function UpdateInput() {
|
||||||
WriteParameter(param, category, "MakeImage", "Brightness", false);
|
WriteParameter(param, category, "TakeImage", "Brightness", false);
|
||||||
WriteParameter(param, category, "MakeImage", "Contrast", false);
|
WriteParameter(param, category, "TakeImage", "Contrast", false);
|
||||||
WriteParameter(param, category, "MakeImage", "Saturation", false);
|
WriteParameter(param, category, "TakeImage", "Saturation", false);
|
||||||
WriteParameter(param, category, "MakeImage", "LEDIntensity", false);
|
WriteParameter(param, category, "TakeImage", "LEDIntensity", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,14 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<body style="font-family: arial">
|
<body style="font-family: arial">
|
||||||
|
|
||||||
<h4>Reference Image</h4>
|
<h4>Step 1: Define a Reference Image</h4>
|
||||||
The reference image is the base to define the digits, counters and references positions.
|
The reference image is the base to define the digits, counters and references positions.
|
||||||
<p>
|
<p>
|
||||||
Firstly you see the default image. Use the Button "Create New Reference" to start to create your own reference image.<br>
|
Firstly you see the default image. Use the Button "Create New Reference" to start to create your own reference image.<br>
|
||||||
Most important feature is a straight alignment of the image. Use the Pre-rotate angle and the fine alignment to adjust the rotation of the image<br>
|
Most important feature is a straight alignment of the image. Use the Pre-rotate angle and the fine alignment to adjust the rotation of the image.
|
||||||
Store the reference image by pushing <b>"Update Reference Image"</b>. A reboot is not yet required.
|
</p>
|
||||||
|
<p>
|
||||||
|
Don't forget to save your changes with the <b>"Save"</b> button!
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -19,15 +19,15 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<body style="font-family: arial">
|
<body style="font-family: arial">
|
||||||
|
|
||||||
<h4>Alignment References</h4>
|
<h4>Step 2: Define two Alignment Marks</h4>
|
||||||
Two opposite alignment references are needed to identify unique fix points on the image.
|
Two opposite alignment marks are needed to identify unique fix points on the image.
|
||||||
<p>
|
<p>
|
||||||
Mark the reference by drag and dop with the mouse or with the coordinates and push <b>"Update Reference"</b>.
|
Mark the reference by drag and dop with the mouse or with the coordinates and push <b>"Update Reference"</b>.
|
||||||
<br>
|
<br>
|
||||||
You can switch between the two reference with <b>"Select Reference"</b>.
|
You can switch between the two reference with <b>"Select Reference"</b>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Don't forget to save your changes! A reboot is not yet required.
|
Don't forget to save your changes with the <b>"Save"</b> button!
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<body style="font-family: arial">
|
<body style="font-family: arial">
|
||||||
|
|
||||||
<h4>Define Digits</h4>
|
<h4>Step 3: Define ROI's for your Digits</h4>
|
||||||
Here you define your digits you want to read. If you have more than one number on the reading you can define several numbers with the <b>"Number"</b> selector. There you can also define new numbers.
|
Here you define your digits you want to read. If you have more than one number on the reading you can define several numbers with the <b>"Number"</b> selector. There you can also define new numbers.
|
||||||
<p>
|
<p>
|
||||||
With the drop down menue <b>"ROI x"</b> you can change between the different digits. Mark them with the mouse or the coordinates.
|
With the drop down menue <b>"ROI x"</b> you can change between the different digits. Mark them with the mouse or the coordinates.
|
||||||
@@ -29,7 +29,7 @@ Here you define your digits you want to read. If you have more than one number o
|
|||||||
You can change it with <b>"move Next" / "move Previous"</b>.
|
You can change it with <b>"move Next" / "move Previous"</b>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Don't forget to save your changes! A reboot is not yet required.
|
Don't forget to save your changes with the <b>"Save"</b> button!
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<body style="font-family: arial">
|
<body style="font-family: arial">
|
||||||
|
|
||||||
<h4>Define Digits</h4>
|
<h4>Step 4: Define ROI's for your Analog Counters</h4>
|
||||||
Here you define your analog counters you want to read. If you have more than one number on the reading you can define several numbers with the <b>"Number"</b> selector. There you can also define new numbers. If you do not have analog counters delete all ROIs.
|
Here you define your analog counters you want to read. If you have more than one number on the reading you can define several numbers with the <b>"Number"</b> selector. There you can also define new numbers. If you do not have analog counters delete all ROIs.
|
||||||
<p>
|
<p>
|
||||||
With the drop down menue <b>"ROI x"</b> you can change between the different counters. Mark them with the mouse or the coordinates.
|
With the drop down menue <b>"ROI x"</b> you can change between the different counters. Mark them with the mouse or the coordinates.
|
||||||
@@ -28,7 +28,7 @@ Here you define your analog counters you want to read. If you have more than one
|
|||||||
You can change it with <b>"move Next" / "move Previous"</b>.
|
You can change it with <b>"move Next" / "move Previous"</b>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Don't forget to save your changes with <b>"Save all to Config.ini"</b>! A reboot is not yet required.
|
Don't forget to save your changes with the <b>"Save"</b> button!
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<body style="font-family: arial">
|
<body style="font-family: arial">
|
||||||
|
|
||||||
<h4>General configuration parameters</h4>
|
<h4>Step 5: General Configuration Settings</h4>
|
||||||
<p>Here you can define additional settings. The settings should fit for a normal setup.</p>
|
<p>Here you can define additional settings. The default settings should fit for a normal/initial setup.</p>
|
||||||
<p>You will also be availabl</p>
|
<p>You will also be able to change them later, so don't worry if you do not understand the parameters yet!</p>
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Don't forget to save your changes!
|
Don't forget to save your changes with the <b>"Save"</b> button!
|
||||||
<br><span color=red>You should not reboot here, but leave the setup modus on the next page!</span>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,26 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!-- This page is never shown -->
|
||||||
<html style="width: fit-content">
|
|
||||||
<head>
|
|
||||||
<link rel="icon" href="favicon.ico?v=$COMMIT_HASH" type="image/x-icon">
|
|
||||||
<title>AI on the edge</title>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
h1 {font-size: 2em; margin-block-end: 0.3em;}
|
|
||||||
h2 {font-size: 1.5em;margin-block-start: 0.3em;}
|
|
||||||
h3 {font-size: 1.2em;}
|
|
||||||
p {font-size: 1em;}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body style="font-family: arial">
|
|
||||||
|
|
||||||
<h4>Finished!</h4>
|
|
||||||
Read below!
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -13,7 +13,7 @@ function getbasepath(){
|
|||||||
{
|
{
|
||||||
// host = "http://192.168.2.219"; // jomjol interner test
|
// host = "http://192.168.2.219"; // jomjol interner test
|
||||||
// host = "http://192.168.178.46"; // jomjol interner test
|
// host = "http://192.168.178.46"; // jomjol interner test
|
||||||
host = "http://192.168.178.62"; // jomjol interner Real
|
host = "http://192.168.178.44"; // jomjol interner Real
|
||||||
// host = "http://192.168.43.191";
|
// host = "http://192.168.43.191";
|
||||||
// host = "."; // jomjol interner localhost
|
// host = "."; // jomjol interner localhost
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
* - *.bin
|
* - *.bin
|
||||||
* - *.zip */
|
* - *.zip */
|
||||||
else if (filename.endsWith(".zip") || filename.endsWith(".bin")) { // Warning but still accepted
|
else if (filename.endsWith(".zip") || filename.endsWith(".bin")) { // Warning but still accepted
|
||||||
firework.launch('The filename does not match the suggested filename pattern, but is nevertheless accepted. You can now press "Upload and install', 'warning', 10000);
|
firework.launch('The filename does not match the suggested filename pattern, but is nevertheless accepted. You can now press "Upload and install".', 'warning', 10000);
|
||||||
}
|
}
|
||||||
/* Any other file name format is not accepted */
|
/* Any other file name format is not accepted */
|
||||||
else { // invalid
|
else { // invalid
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ function ZerlegeZeile(input, delimiter = " =\t\r")
|
|||||||
var Output = Array(0);
|
var Output = Array(0);
|
||||||
// delimiter = " =,\t";
|
// delimiter = " =,\t";
|
||||||
|
|
||||||
input = trim(input, delimiter);
|
|
||||||
|
|
||||||
/* The input can have multiple formats:
|
/* The input can have multiple formats:
|
||||||
* - key = value
|
* - key = value
|
||||||
@@ -61,12 +60,14 @@ function ZerlegeZeile(input, delimiter = " =\t\r")
|
|||||||
* As a workaround and to not break any legacy usage, we enforce to only use the
|
* As a workaround and to not break any legacy usage, we enforce to only use the
|
||||||
* equal sign, if the key is "password"
|
* equal sign, if the key is "password"
|
||||||
*/
|
*/
|
||||||
if (input.includes("password")) { // Line contains a password, use the equal sign as the only delimiter and only split on first occurrence
|
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 pos = input.indexOf("=");
|
var pos = input.indexOf("=");
|
||||||
|
delimiter = " \t\r"
|
||||||
Output.push(trim(input.substr(0, pos), delimiter));
|
Output.push(trim(input.substr(0, pos), delimiter));
|
||||||
Output.push(trim(input.substr(pos +1, input.length), delimiter));
|
Output.push(trim(input.substr(pos +1, input.length), delimiter));
|
||||||
}
|
}
|
||||||
else { // Legacy Mode
|
else { // Legacy Mode
|
||||||
|
input = trim(input, delimiter);
|
||||||
var pos = findDelimiterPos(input, delimiter);
|
var pos = findDelimiterPos(input, delimiter);
|
||||||
var token;
|
var token;
|
||||||
while (pos > -1) {
|
while (pos > -1) {
|
||||||
|
|||||||
@@ -105,14 +105,14 @@ function ParseConfig() {
|
|||||||
param = new Object();
|
param = new Object();
|
||||||
category = new Object();
|
category = new Object();
|
||||||
|
|
||||||
var catname = "MakeImage";
|
var catname = "TakeImage";
|
||||||
category[catname] = new Object();
|
category[catname] = new Object();
|
||||||
category[catname]["enabled"] = false;
|
category[catname]["enabled"] = false;
|
||||||
category[catname]["found"] = false;
|
category[catname]["found"] = false;
|
||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "LogImageLocation");
|
ParamAddValue(param, catname, "RawImagesLocation");
|
||||||
ParamAddValue(param, catname, "WaitBeforeTakingPicture");
|
ParamAddValue(param, catname, "WaitBeforeTakingPicture");
|
||||||
ParamAddValue(param, catname, "LogfileRetentionInDays");
|
ParamAddValue(param, catname, "RawImagesRetention");
|
||||||
ParamAddValue(param, catname, "Demo");
|
ParamAddValue(param, catname, "Demo");
|
||||||
ParamAddValue(param, catname, "Brightness");
|
ParamAddValue(param, catname, "Brightness");
|
||||||
ParamAddValue(param, catname, "Contrast");
|
ParamAddValue(param, catname, "Contrast");
|
||||||
@@ -141,8 +141,8 @@ function ParseConfig() {
|
|||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "Model");
|
ParamAddValue(param, catname, "Model");
|
||||||
ParamAddValue(param, catname, "CNNGoodThreshold", 1);
|
ParamAddValue(param, catname, "CNNGoodThreshold", 1);
|
||||||
ParamAddValue(param, catname, "LogImageLocation");
|
ParamAddValue(param, catname, "ROIImagesLocation");
|
||||||
ParamAddValue(param, catname, "LogfileRetentionInDays");
|
ParamAddValue(param, catname, "ROIImagesRetention");
|
||||||
|
|
||||||
var catname = "Analog";
|
var catname = "Analog";
|
||||||
category[catname] = new Object();
|
category[catname] = new Object();
|
||||||
@@ -150,8 +150,8 @@ function ParseConfig() {
|
|||||||
category[catname]["found"] = false;
|
category[catname]["found"] = false;
|
||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "Model");
|
ParamAddValue(param, catname, "Model");
|
||||||
ParamAddValue(param, catname, "LogImageLocation");
|
ParamAddValue(param, catname, "ROIImagesLocation");
|
||||||
ParamAddValue(param, catname, "LogfileRetentionInDays");
|
ParamAddValue(param, catname, "ROIImagesRetention");
|
||||||
|
|
||||||
var catname = "PostProcessing";
|
var catname = "PostProcessing";
|
||||||
category[catname] = new Object();
|
category[catname] = new Object();
|
||||||
@@ -177,11 +177,10 @@ function ParseConfig() {
|
|||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "Uri");
|
ParamAddValue(param, catname, "Uri");
|
||||||
ParamAddValue(param, catname, "MainTopic", 1, false);
|
ParamAddValue(param, catname, "MainTopic", 1, false);
|
||||||
ParamAddValue(param, catname, "Topic", 1, false);
|
|
||||||
ParamAddValue(param, catname, "ClientID");
|
ParamAddValue(param, catname, "ClientID");
|
||||||
ParamAddValue(param, catname, "user");
|
ParamAddValue(param, catname, "user");
|
||||||
ParamAddValue(param, catname, "password");
|
ParamAddValue(param, catname, "password");
|
||||||
ParamAddValue(param, catname, "SetRetainFlag");
|
ParamAddValue(param, catname, "RetainMessages");
|
||||||
ParamAddValue(param, catname, "HomeassistantDiscovery");
|
ParamAddValue(param, catname, "HomeassistantDiscovery");
|
||||||
ParamAddValue(param, catname, "MeterType");
|
ParamAddValue(param, catname, "MeterType");
|
||||||
|
|
||||||
@@ -196,6 +195,18 @@ function ParseConfig() {
|
|||||||
ParamAddValue(param, catname, "user");
|
ParamAddValue(param, catname, "user");
|
||||||
ParamAddValue(param, catname, "password");
|
ParamAddValue(param, catname, "password");
|
||||||
|
|
||||||
|
var catname = "InfluxDBv2";
|
||||||
|
category[catname] = new Object();
|
||||||
|
category[catname]["enabled"] = false;
|
||||||
|
category[catname]["found"] = false;
|
||||||
|
param[catname] = new Object();
|
||||||
|
ParamAddValue(param, catname, "Uri");
|
||||||
|
ParamAddValue(param, catname, "Database");
|
||||||
|
ParamAddValue(param, catname, "Measurement");
|
||||||
|
ParamAddValue(param, catname, "Org");
|
||||||
|
ParamAddValue(param, catname, "Token");
|
||||||
|
ParamAddValue(param, catname, "Fieldname", 1, true);
|
||||||
|
|
||||||
var catname = "GPIO";
|
var catname = "GPIO";
|
||||||
category[catname] = new Object();
|
category[catname] = new Object();
|
||||||
category[catname]["enabled"] = false;
|
category[catname]["enabled"] = false;
|
||||||
@@ -224,7 +235,7 @@ function ParseConfig() {
|
|||||||
category[catname]["found"] = false;
|
category[catname]["found"] = false;
|
||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "AutoStart");
|
ParamAddValue(param, catname, "AutoStart");
|
||||||
ParamAddValue(param, catname, "Intervall");
|
ParamAddValue(param, catname, "Interval");
|
||||||
|
|
||||||
var catname = "DataLogging";
|
var catname = "DataLogging";
|
||||||
category[catname] = new Object();
|
category[catname] = new Object();
|
||||||
@@ -232,15 +243,15 @@ function ParseConfig() {
|
|||||||
category[catname]["found"] = false;
|
category[catname]["found"] = false;
|
||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "DataLogActive");
|
ParamAddValue(param, catname, "DataLogActive");
|
||||||
ParamAddValue(param, catname, "DataLogRetentionInDays");
|
ParamAddValue(param, catname, "DataFilesRetention");
|
||||||
|
|
||||||
var catname = "Debug";
|
var catname = "Debug";
|
||||||
category[catname] = new Object();
|
category[catname] = new Object();
|
||||||
category[catname]["enabled"] = false;
|
category[catname]["enabled"] = false;
|
||||||
category[catname]["found"] = false;
|
category[catname]["found"] = false;
|
||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "Logfile");
|
ParamAddValue(param, catname, "LogLevel");
|
||||||
ParamAddValue(param, catname, "LogfileRetentionInDays");
|
ParamAddValue(param, catname, "LogfilesRetention");
|
||||||
|
|
||||||
var catname = "System";
|
var catname = "System";
|
||||||
category[catname] = new Object();
|
category[catname] = new Object();
|
||||||
@@ -249,9 +260,8 @@ function ParseConfig() {
|
|||||||
param[catname] = new Object();
|
param[catname] = new Object();
|
||||||
ParamAddValue(param, catname, "TimeZone");
|
ParamAddValue(param, catname, "TimeZone");
|
||||||
ParamAddValue(param, catname, "TimeServer");
|
ParamAddValue(param, catname, "TimeServer");
|
||||||
ParamAddValue(param, catname, "AutoAdjustSummertime");
|
|
||||||
ParamAddValue(param, catname, "Hostname");
|
ParamAddValue(param, catname, "Hostname");
|
||||||
ParamAddValue(param, catname, "RSSIThreashold");
|
ParamAddValue(param, catname, "RSSIThreshold");
|
||||||
ParamAddValue(param, catname, "SetupMode");
|
ParamAddValue(param, catname, "SetupMode");
|
||||||
|
|
||||||
|
|
||||||
@@ -273,22 +283,7 @@ function ParseConfig() {
|
|||||||
aktline++;
|
aktline++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make the downward compatiblity
|
||||||
// Make the downward compatiblity with MQTT (Maintopic --> topic)
|
|
||||||
if (param["MQTT"]["Topic"]["found"] == true && param["MQTT"]["MainTopic"]["found"] == false)
|
|
||||||
{
|
|
||||||
param["MQTT"]["MainTopic"] = param["MQTT"]["Topic"]
|
|
||||||
}
|
|
||||||
delete param["MQTT"]["Topic"] // Dient nur der Downwardskompatibilität
|
|
||||||
|
|
||||||
|
|
||||||
if (param["Debug"]["Logfile"]["value1"] == "false" || param["Debug"]["Logfile"]["value1"] == "true")
|
|
||||||
{
|
|
||||||
param["Debug"]["Logfile"]["value1"] = "2";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Make the downward compatiblity with MQTT (Maintopic --> topic)
|
|
||||||
if (category["DataLogging"]["found"] == false)
|
if (category["DataLogging"]["found"] == false)
|
||||||
{
|
{
|
||||||
category["DataLogging"]["found"] = true;
|
category["DataLogging"]["found"] = true;
|
||||||
@@ -298,9 +293,9 @@ function ParseConfig() {
|
|||||||
param["DataLogging"]["DataLogActive"]["enabled"] = true;
|
param["DataLogging"]["DataLogActive"]["enabled"] = true;
|
||||||
param["DataLogging"]["DataLogActive"]["value1"] = "true";
|
param["DataLogging"]["DataLogActive"]["value1"] = "true";
|
||||||
|
|
||||||
param["DataLogging"]["DataLogRetentionInDays"]["found"] = true;
|
param["DataLogging"]["DataFilesRetention"]["found"] = true;
|
||||||
param["DataLogging"]["DataLogRetentionInDays"]["enabled"] = true;
|
param["DataLogging"]["DataFilesRetention"]["enabled"] = true;
|
||||||
param["DataLogging"]["DataLogRetentionInDays"]["value1"] = "3";
|
param["DataLogging"]["DataFilesRetention"]["value1"] = "3";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (category["DataLogging"]["enabled"] == false)
|
if (category["DataLogging"]["enabled"] == false)
|
||||||
@@ -313,11 +308,11 @@ function ParseConfig() {
|
|||||||
param["DataLogging"]["DataLogActive"]["value1"] = "true";
|
param["DataLogging"]["DataLogActive"]["value1"] = "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param["DataLogging"]["DataLogRetentionInDays"]["enabled"] == false && param["DataLogging"]["DataLogRetentionInDays"]["value1"] == "")
|
if (param["DataLogging"]["DataFilesRetention"]["enabled"] == false && param["DataLogging"]["DataFilesRetention"]["value1"] == "")
|
||||||
{
|
{
|
||||||
param["DataLogging"]["DataLogRetentionInDays"]["found"] = true;
|
param["DataLogging"]["DataFilesRetention"]["found"] = true;
|
||||||
param["DataLogging"]["DataLogRetentionInDays"]["enabled"] = true;
|
param["DataLogging"]["DataFilesRetention"]["enabled"] = true;
|
||||||
param["DataLogging"]["DataLogRetentionInDays"]["value1"] = "3";
|
param["DataLogging"]["DataFilesRetention"]["value1"] = "3";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ p {font-size: 1em;}
|
|||||||
<td>
|
<td>
|
||||||
<button class="button" id="previous" name="previous" onclick="clickPrevious()">Previous</button>
|
<button class="button" id="previous" name="previous" onclick="clickPrevious()">Previous</button>
|
||||||
<button class="button" id="next" name="next" onclick="clickNext()">Next</button>
|
<button class="button" id="next" name="next" onclick="clickNext()">Next</button>
|
||||||
If you need support, have a look to the <a href=https://jomjol.github.io/AI-on-the-edge-device-docs target=_blank>documenation</a> or the <a href=https://github.com/jomjol/AI-on-the-edge-device/discussions target=_blank>discussion</a> pages.
|
If you need support, have a look to the <a href=https://jomjol.github.io/AI-on-the-edge-device-docs target=_blank>documentation</a> or the <a href=https://github.com/jomjol/AI-on-the-edge-device/discussions target=_blank>discussion</a> pages.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -83,53 +83,53 @@ function clickPrevious() {
|
|||||||
function LoadStep(){
|
function LoadStep(){
|
||||||
switch (aktstatu) {
|
switch (aktstatu) {
|
||||||
case 0:
|
case 0:
|
||||||
document.getElementById('maincontent').src = '/edit_explain_0.html?v=$COMMIT_HASH';
|
document.getElementById('maincontent').src = 'edit_explain_0.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('h_iframe_explain').style.display = "none";
|
document.getElementById('h_iframe_explain').style.display = "none";
|
||||||
document.getElementById("previous").disabled = true;
|
document.getElementById("previous").disabled = true;
|
||||||
document.getElementById("next").disabled = false;
|
document.getElementById("next").disabled = false;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
document.getElementById('maincontent').src = '/edit_reference.html?v=$COMMIT_HASH';
|
document.getElementById('maincontent').src = 'edit_reference.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('explaincontent').src = '/explain_1.html?v=$COMMIT_HASH';
|
document.getElementById('explaincontent').src = 'explain_1.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('h_iframe_explain').style.display = "";
|
document.getElementById('h_iframe_explain').style.display = "";
|
||||||
document.getElementById("previous").disabled = false;
|
document.getElementById("previous").disabled = false;
|
||||||
document.getElementById("next").disabled = false;
|
document.getElementById("next").disabled = false;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
document.getElementById('maincontent').src = '/edit_alignment.html?v=$COMMIT_HASH';
|
document.getElementById('maincontent').src = 'edit_alignment.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('explaincontent').src = '/explain_2.html?v=$COMMIT_HASH';
|
document.getElementById('explaincontent').src = 'explain_2.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('h_iframe_explain').style.display = "";
|
document.getElementById('h_iframe_explain').style.display = "";
|
||||||
document.getElementById("previous").disabled = false;
|
document.getElementById("previous").disabled = false;
|
||||||
document.getElementById("next").disabled = false;
|
document.getElementById("next").disabled = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
document.getElementById('maincontent').src = '/edit_digits.html?v=$COMMIT_HASH';
|
document.getElementById('maincontent').src = 'edit_digits.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('explaincontent').src = '/explain_3.html?v=$COMMIT_HASH';
|
document.getElementById('explaincontent').src = 'explain_3.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('h_iframe_explain').style.display = "";
|
document.getElementById('h_iframe_explain').style.display = "";
|
||||||
document.getElementById("previous").disabled = false;
|
document.getElementById("previous").disabled = false;
|
||||||
document.getElementById("next").disabled = false;
|
document.getElementById("next").disabled = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
document.getElementById('maincontent').src = '/edit_analog.html?v=$COMMIT_HASH';
|
document.getElementById('maincontent').src = 'edit_analog.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('explaincontent').src = '/explain_4.html?v=$COMMIT_HASH';
|
document.getElementById('explaincontent').src = 'explain_4.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('h_iframe_explain').style.display = "";
|
document.getElementById('h_iframe_explain').style.display = "";
|
||||||
document.getElementById("previous").disabled = false;
|
document.getElementById("previous").disabled = false;
|
||||||
document.getElementById("next").disabled = false;
|
document.getElementById("next").disabled = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
document.getElementById('maincontent').src = '/edit_config_param.html?v=$COMMIT_HASH?InitialSetup=true';
|
document.getElementById('maincontent').src = 'edit_config_param.html?v=$COMMIT_HASH?InitialSetup=true';
|
||||||
document.getElementById('explaincontent').src = '/explain_5.html?v=$COMMIT_HASH';
|
document.getElementById('explaincontent').src = 'explain_5.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('h_iframe_explain').style.display = "";
|
document.getElementById('h_iframe_explain').style.display = "";
|
||||||
document.getElementById("previous").disabled = false;
|
document.getElementById("previous").disabled = false;
|
||||||
document.getElementById("next").disabled = false;
|
document.getElementById("next").disabled = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
document.getElementById('maincontent').src = '/edit_explain_6.html?v=$COMMIT_HASH';
|
document.getElementById('maincontent').src = 'edit_explain_6.html?v=$COMMIT_HASH';
|
||||||
document.getElementById('explaincontent').src = '/explain_6.html?v=$COMMIT_HASH';
|
document.getElementById('explaincontent').src = 'explain_6.html?v=$COMMIT_HASH'; // Note: The page never gets shown!
|
||||||
document.getElementById('h_iframe_explain').style.display = "none";
|
document.getElementById('h_iframe_explain').style.display = "none";
|
||||||
document.getElementById("previous").disabled = false;
|
document.getElementById("previous").disabled = false;
|
||||||
document.getElementById("next").disabled = true;
|
document.getElementById("next").disabled = true;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<tr><td>gateway</td><td><input type="text" name="gateway" id="gateway"></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><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><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 Threashold</td><td><input type="number" name="name" id="threashold" min="-100" max="0" step="1" value = "0"></td><td>WLAN Mesh Parameter: Threashold 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>
|
<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: Threashold 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>
|
</table>
|
||||||
<button class="button" type="button" onclick="wr()">Write wlan.ini</button>
|
<button class="button" type="button" onclick="wr()">Write wlan.ini</button>
|
||||||
<input id="newfile" type="file">
|
<input id="newfile" type="file">
|
||||||
|
|||||||
Reference in New Issue
Block a user