Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*** OLD *** Migrated parameters #2017

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
69583db
Correct influx utc (#1964)
jomjol Feb 2, 2023
1d2f920
Option alignment algo off (#1924)
nliaudat Feb 3, 2023
2ee8500
Cleanup defines.h (#1967)
Slider0007 Feb 3, 2023
d63dc08
Update manual-update-webinstaller.yml
caco3 Feb 3, 2023
4bfe542
fix broken webinstaller update
caco3 Feb 3, 2023
34a3d6d
Merge branch 'Increase-max-JPG-size' into rolling
jomjol Feb 4, 2023
800e231
Update Changelog.md
jomjol Feb 4, 2023
55efc3b
wifi disconnect before deinit (#1978)
Slider0007 Feb 5, 2023
06f4d41
Cleanup config (#1972)
caco3 Feb 5, 2023
b9134f9
ota_page: Add missing quotation mark (#1977)
Slider0007 Feb 5, 2023
3fa16c5
Use the preprocessed Web UI for the manual.zip (#1983)
caco3 Feb 5, 2023
30a5072
Update manual-update-webinstaller.yml
caco3 Feb 5, 2023
bf090f3
Update README.md
caco3 Feb 7, 2023
876adc5
Fix small typo (#1995)
joergrosenkranz Feb 8, 2023
a9c5beb
Update interface_influxdb.cpp
jomjol Feb 8, 2023
0b2e389
Update Changelog.md
jomjol Feb 8, 2023
795bcd0
Merge branch 'InfluxDB-Fix-Timeshift' into rolling
jomjol Feb 8, 2023
1acd72d
Implement InfluxDB v2 (#2004)
jomjol Feb 9, 2023
55be652
Update Changelog.md
jomjol Feb 9, 2023
44e186e
Update backup.html (#2015)
caco3 Feb 11, 2023
1e633bb
Migrated parameters
Feb 12, 2023
764c462
Merge branch 'rolling' into migrate-parameters
caco3 Feb 12, 2023
a27bad4
.
Feb 12, 2023
13e3ba1
re-implemented parameter migration
Feb 12, 2023
cfc6ea2
renaming
Feb 12, 2023
d1e3751
.
Feb 12, 2023
7eb690a
.
Feb 12, 2023
10e84e6
.
Feb 12, 2023
6d111eb
.
Feb 12, 2023
ebcd858
.
Feb 12, 2023
21c835c
.
Feb 12, 2023
15ca4e0
.
Feb 12, 2023
60e7596
.
Feb 12, 2023
92bed76
.
Feb 12, 2023
da487f7
.
Feb 12, 2023
31f6bfe
.
Feb 12, 2023
55523ac
removed influxDB2, we do not want it yet in v14.1!
Feb 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/manual-update-webinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: InsonusK/get-latest-release@v1.0.1
with:
myToken: ${{ github.token }}
exclude_types: "release"
exclude_types: "draft|prerelease"
view_top: 1

- name: Add binary to Web Installer and update manifest
Expand Down
27 changes: 26 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
## [14.0.2] - 2023-02-05
## [Unreleased]

**Rolling**



#### Added

- Additional interface to InfluxDB Version 2 upwards

#### Changed

- n.a.

#### Fixed

- n.a.

#### Removed

- n.a.



## [14.0.3] -2023-02-05

**Stabilization and Improved User Experience**

Expand Down Expand Up @@ -47,6 +71,7 @@ For a full list of changes see [Full list of changes](https://github.com/jomjol/
- [1530](https://github.com/jomjol/AI-on-the-edge-device/pull/1530) Homeassistant `Problem Sensor`
- [1518](https://github.com/jomjol/AI-on-the-edge-device/pull/1518) JSON Strings
- [1817](https://github.com/jomjol/AI-on-the-edge-device/pull/1817) DataGraph: datafiles sorted -> newest on top
- **New 14.0.4:** Fix for InfluxDB timeshift problem [#1991](https://github.com/jomjol/AI-on-the-edge-device/issues/1991)

#### Removed

Expand Down
40 changes: 28 additions & 12 deletions code/components/jomjol_flowcontroll/ClassFlowAlignment.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ClassFlowAlignment.h"
#include "ClassFlowMakeImage.h"
#include "ClassFlowTakeImage.h"
#include "ClassFlow.h"
#include "server_tflite.h"

Expand Down Expand Up @@ -46,9 +46,9 @@ ClassFlowAlignment::ClassFlowAlignment(std::vector<ClassFlow*>* lfc)

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;
}
}

Expand All @@ -65,7 +65,7 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
std::vector<string> splitted;
int suchex = 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);
Expand All @@ -74,7 +74,7 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
if (!this->GetNextParagraph(pfile, aktparamgraph))
return false;

if (aktparamgraph.compare("[Alignment]") != 0) //Paragraph does not fit MakeImage
if (aktparamgraph.compare("[Alignment]") != 0) //Paragraph does not fit Alignment
return false;

while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
Expand Down Expand Up @@ -130,6 +130,8 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
alg_algo = 1;
if (toUpper(splitted[1]) == "FAST")
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;
}
}

Expand All @@ -145,7 +147,10 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
#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;

Expand Down Expand Up @@ -234,14 +239,22 @@ bool ClassFlowAlignment::doFlow(string time)
AlignAndCutImage->SaveToFile(FormatFileName("/sdcard/img_tmp/rot.jpg"));
}

if (!AlignAndCutImage->Align(&References[0], &References[1]))
{
SaveReferenceAlignmentValues();
}

//no align algo if set to 3 = off //add disable aligment algo |01.2023
if(References[0].alignment_algo != 3){
if (!AlignAndCutImage->Align(&References[0], &References[1]))
{
SaveReferenceAlignmentValues();
}
}// no align


#ifdef ALGROI_LOAD_FROM_MEM_AS_JPG
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.AnalogDrawROI(ImageTMP);
ImageTMP->writeToMemoryAsJPG((ImageData*)AlgROI, 90);
Expand All @@ -258,7 +271,10 @@ bool ClassFlowAlignment::doFlow(string time)
delete ImageTMP;
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;
}
Expand Down
10 changes: 5 additions & 5 deletions code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ClassFlowCNNGeneral::ClassFlowCNNGeneral(ClassFlowAlignment *_flowalign, t_CNNTy
CNNType = AutoDetect;
CNNType = _cnntype;
flowpostalignment = _flowalign;
logfileRetentionInDays = 5;
imagesRetention = 5;
}


Expand Down Expand Up @@ -324,9 +324,9 @@ bool ClassFlowCNNGeneral::ReadParameter(FILE* pfile, string& aktparamgraph)
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
{
splitted = ZerlegeZeile(aktparamgraph);
if ((toUpper(splitted[0]) == "LOGIMAGELOCATION") && (splitted.size() > 1))
if ((toUpper(splitted[0]) == "ROIIMAGELOCATION") && (splitted.size() > 1))
{
this->LogImageLocation = "/sdcard" + splitted[1];
this->imagesLocation = "/sdcard" + splitted[1];
this->isLogImage = true;
}
if ((toUpper(splitted[0]) == "LOGIMAGESELECT") && (splitted.size() > 1))
Expand All @@ -335,9 +335,9 @@ bool ClassFlowCNNGeneral::ReadParameter(FILE* pfile, string& aktparamgraph)
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))
Expand Down
47 changes: 24 additions & 23 deletions code/components/jomjol_flowcontroll/ClassFlowControll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _

ESP_LOGD(TAG, "Step %s start", _stepname.c_str());

if ((_stepname.compare("[MakeImage]") == 0) || (_stepname.compare(";[MakeImage]") == 0)){
_classname = "ClassFlowMakeImage";
if ((_stepname.compare("[TakeImage]") == 0) || (_stepname.compare(";[TakeImage]") == 0)){
_classname = "ClassFlowTakeImage";
}
if ((_stepname.compare("[Alignment]") == 0) || (_stepname.compare(";[Alignment]") == 0)){
_classname = "ClassFlowAlignment";
Expand All @@ -64,7 +64,7 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _

for (int i = 0; i < FlowControll.size(); ++i)
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("");
result = FlowControll[i]->getHTMLSingleStep(_host);
}
Expand All @@ -77,7 +77,7 @@ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _

std::string ClassFlowControll::TranslateAktstatus(std::string _input)
{
if (_input.compare("ClassFlowMakeImage") == 0)
if (_input.compare("ClassFlowTakeImage") == 0)
return ("Take Image");
if (_input.compare("ClassFlowAlignment") == 0)
return ("Aligning");
Expand Down Expand Up @@ -171,7 +171,7 @@ bool ClassFlowControll::StartMQTTService() {
/* Start the MQTT service */
for (int i = 0; i < FlowControll.size(); ++i) {
if (FlowControll[i]->name().compare("ClassFlowMQTT") == 0) {
return ((ClassFlowMQTT*) (FlowControll[i]))->Start(AutoIntervall);
return ((ClassFlowMQTT*) (FlowControll[i]))->Start(AutoInterval);
}
}
return false;
Expand All @@ -183,7 +183,7 @@ void ClassFlowControll::SetInitialParameter(void)
{
AutoStart = false;
SetupModeActive = false;
AutoIntervall = 10; // Minutes
AutoInterval = 10; // Minutes
flowdigit = NULL;
flowanalog = NULL;
flowpostprocessing = NULL;
Expand All @@ -193,9 +193,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;
}

Expand All @@ -206,10 +206,10 @@ ClassFlow* ClassFlowControll::CreateClassFlow(std::string _type)

_type = trim(_type);

if (toUpper(_type).compare("[MAKEIMAGE]") == 0)
if (toUpper(_type).compare("[TAKEIMAGE]") == 0)
{
cfc = new ClassFlowMakeImage(&FlowControll);
flowmakeimage = (ClassFlowMakeImage*) cfc;
cfc = new ClassFlowTakeImage(&FlowControll);
flowtakeimage = (ClassFlowTakeImage*) cfc;
}
if (toUpper(_type).compare("[ALIGNMENT]") == 0)
{
Expand Down Expand Up @@ -290,6 +290,7 @@ void ClassFlowControll::InitFlow(std::string config)
while ((line.size() > 0) && !(feof(pFile)))
{
cfc = CreateClassFlow(line);
// printf("Name: %s\n", cfc->name().c_str());
if (cfc)
{
ESP_LOGD(TAG, "Start ReadParameter (%s)", line.c_str());
Expand Down Expand Up @@ -322,13 +323,13 @@ void ClassFlowControll::setActStatus(std::string _aktstatus)
}


void ClassFlowControll::doFlowMakeImageOnly(string time)
void ClassFlowControll::doFlowTakeImageOnly(string time)
{
std::string zw_time;

for (int i = 0; i < FlowControll.size(); ++i)
{
if (FlowControll[i]->name() == "ClassFlowMakeImage") {
if (FlowControll[i]->name() == "ClassFlowTakeImage") {
zw_time = getCurrentTimeString("%H:%M:%S");
std::string flowStatus = TranslateAktstatus(FlowControll[i]->name());
aktstatus = flowStatus + " (" + zw_time + ")";
Expand Down Expand Up @@ -527,7 +528,7 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)


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;

while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
Expand All @@ -541,9 +542,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))
Expand All @@ -557,12 +558,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]));
}

if ((toUpper(splitted[0]) == "LOGFILE") && (splitted.size() > 1))
if ((toUpper(splitted[0]) == "LOGLEVEL") && (splitted.size() > 1))
{
/* matches esp_log_level_t */
if ((toUpper(splitted[1]) == "TRUE") || (toUpper(splitted[1]) == "2"))
Expand All @@ -582,20 +583,20 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
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]));
}

/* 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 !!!
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();
hard_restart();
doReboot();
Expand Down Expand Up @@ -660,7 +661,7 @@ int ClassFlowControll::CleanTempFolder() {

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;
}


Expand Down
10 changes: 5 additions & 5 deletions code/components/jomjol_flowcontroll/ClassFlowControll.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <string>

#include "ClassFlow.h"
#include "ClassFlowMakeImage.h"
#include "ClassFlowTakeImage.h"
#include "ClassFlowAlignment.h"
#include "ClassFlowCNNGeneral.h"
#include "ClassFlowPostProcessing.h"
Expand All @@ -29,11 +29,11 @@ class ClassFlowControll :
ClassFlowCNNGeneral* flowanalog;
ClassFlowCNNGeneral* flowdigit;
// ClassFlowDigit* flowdigit;
ClassFlowMakeImage* flowmakeimage;
ClassFlowTakeImage* flowtakeimage;
ClassFlow* CreateClassFlow(std::string _type);

bool AutoStart;
float AutoIntervall;
float AutoInterval;
bool SetupModeActive;
void SetInitialParameter(void);
std::string aktstatus;
Expand All @@ -42,7 +42,7 @@ class ClassFlowControll :
public:
void InitFlow(std::string config);
bool doFlow(string time);
void doFlowMakeImageOnly(string time);
void doFlowTakeImageOnly(string time);
bool getStatusSetupModus(){return SetupModeActive;};
string getReadout(bool _rawvalue, bool _noerror);
string getReadoutAll(int _type);
Expand All @@ -68,7 +68,7 @@ class ClassFlowControll :

std::string doSingleStep(std::string _stepname, std::string _host);

bool isAutoStart(long &_intervall);
bool isAutoStart(long &_interval);

std::string* getActStatus();
void setActStatus(std::string _aktstatus);
Expand Down
2 changes: 1 addition & 1 deletion code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct NumberPost {
int DecimalShift;
int DecimalShiftInitial;
float AnalogDigitalTransitionStart; // When is the digit > x.1, i.e. when does it start to tilt?
int Nachkomma;
int Nachkomma;

bool isExtendedResolution;

Expand Down
Loading