mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-07 20:16:55 +03:00
v0.1.1
This commit is contained in:
@@ -9,6 +9,11 @@ Details can be found on the Wiki pages.
|
|||||||
|
|
||||||
## Changelog - lastest version
|
## Changelog - lastest version
|
||||||
|
|
||||||
|
##### 0.1.1 (2020-08-13)
|
||||||
|
|
||||||
|
* Implementation of Digital Consistency Check: check if Digit shows next number earlier, than previous number has gone through zero - Turn on/off - see updated config.ini `CheckDigitIncreaseConsistency = True`)
|
||||||
|
Not fully tested!
|
||||||
|
|
||||||
##### 0.1.0 (2020-08-07)
|
##### 0.1.0 (2020-08-07)
|
||||||
|
|
||||||
* Initial Version
|
* Initial Version
|
||||||
@@ -19,6 +24,7 @@ Details can be found on the Wiki pages.
|
|||||||
|
|
||||||
* spontaneous reboot, especially in case of intensive web server access
|
* spontaneous reboot, especially in case of intensive web server access
|
||||||
* stopping automated tflite flow - Error teared down to alignment procedure (results in restart)
|
* stopping automated tflite flow - Error teared down to alignment procedure (results in restart)
|
||||||
|
* Camera initialization stuck not often, but randomly 5s after reboot - Hard reboot (power on/off) necessary :-(
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ ClassFlowPostProcessing::ClassFlowPostProcessing()
|
|||||||
ListFlowControll = NULL;
|
ListFlowControll = NULL;
|
||||||
PreValueOkay = false;
|
PreValueOkay = false;
|
||||||
useMaxRateValue = false;
|
useMaxRateValue = false;
|
||||||
|
checkDigitIncreaseConsistency = false;
|
||||||
FilePreValue = FormatFileName("/sdcard/config/prevalue.ini");
|
FilePreValue = FormatFileName("/sdcard/config/prevalue.ini");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +115,7 @@ ClassFlowPostProcessing::ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc)
|
|||||||
ListFlowControll = NULL;
|
ListFlowControll = NULL;
|
||||||
PreValueOkay = false;
|
PreValueOkay = false;
|
||||||
useMaxRateValue = false;
|
useMaxRateValue = false;
|
||||||
|
checkDigitIncreaseConsistency = false;
|
||||||
FilePreValue = FormatFileName("/sdcard/config/prevalue.ini");
|
FilePreValue = FormatFileName("/sdcard/config/prevalue.ini");
|
||||||
ListFlowControll = lfc;
|
ListFlowControll = lfc;
|
||||||
}
|
}
|
||||||
@@ -157,14 +159,19 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ((zerlegt[0] == "CheckDigitIncreaseConsistency") && (zerlegt.size() > 1))
|
||||||
|
{
|
||||||
|
if (toUpper(zerlegt[1]) == "TRUE")
|
||||||
|
checkDigitIncreaseConsistency = true;
|
||||||
|
}
|
||||||
if ((zerlegt[0] == "AllowNegativeRates") && (zerlegt.size() > 1))
|
if ((zerlegt[0] == "AllowNegativeRates") && (zerlegt.size() > 1))
|
||||||
{
|
{
|
||||||
if ((zerlegt[1] == "True") || (zerlegt[1] == "true"))
|
if (toUpper(zerlegt[1]) == "TRUE")
|
||||||
AllowNegativeRates = true;
|
AllowNegativeRates = true;
|
||||||
}
|
}
|
||||||
if ((zerlegt[0] == "ErrorMessage") && (zerlegt.size() > 1))
|
if ((zerlegt[0] == "ErrorMessage") && (zerlegt.size() > 1))
|
||||||
{
|
{
|
||||||
if ((zerlegt[1] == "True") || (zerlegt[1] == "true"))
|
if (toUpper(zerlegt[1]) == "TRUE")
|
||||||
ErrorMessage = true;
|
ErrorMessage = true;
|
||||||
}
|
}
|
||||||
if ((zerlegt[0] == "PreValueAgeStartup") && (zerlegt.size() > 1))
|
if ((zerlegt[0] == "PreValueAgeStartup") && (zerlegt.size() > 1))
|
||||||
@@ -253,9 +260,13 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
|||||||
|
|
||||||
if (isdigit)
|
if (isdigit)
|
||||||
{
|
{
|
||||||
digit = ErsetzteN(digit);
|
int lastanalog = -1;
|
||||||
|
if (isanalog)
|
||||||
|
lastanalog = analog[0] - 48;
|
||||||
|
digit = ErsetzteN(digit, lastanalog);
|
||||||
zw = digit;
|
zw = digit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdigit && isanalog)
|
if (isdigit && isanalog)
|
||||||
zw = zw + ".";
|
zw = zw + ".";
|
||||||
if (isanalog)
|
if (isanalog)
|
||||||
@@ -304,7 +315,7 @@ string ClassFlowPostProcessing::getReadoutParam(bool _rawValue)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string ClassFlowPostProcessing::ErsetzteN(string input)
|
string ClassFlowPostProcessing::ErsetzteN(string input, int lastvalueanalog = -1)
|
||||||
{
|
{
|
||||||
int posN, posPunkt;
|
int posN, posPunkt;
|
||||||
int pot, ziffer;
|
int pot, ziffer;
|
||||||
@@ -322,5 +333,45 @@ string ClassFlowPostProcessing::ErsetzteN(string input)
|
|||||||
|
|
||||||
posN = findDelimiterPos(input, "N");
|
posN = findDelimiterPos(input, "N");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////// TestCode
|
||||||
|
/*
|
||||||
|
input = "10";
|
||||||
|
posPunkt = input.length();
|
||||||
|
PreValue = 9.5;
|
||||||
|
lastvalueanalog = 7;
|
||||||
|
*/
|
||||||
|
if (checkDigitIncreaseConsistency && lastvalueanalog > -1)
|
||||||
|
{
|
||||||
|
int zifferIST;
|
||||||
|
int substrakt = 0;
|
||||||
|
bool lastcorrected = false;
|
||||||
|
for (int i = input.length() - 1; i >= 0; --i)
|
||||||
|
{
|
||||||
|
zifferIST = input[i] - 48; //std::stoi(std::string(input[i]));
|
||||||
|
if (lastcorrected)
|
||||||
|
{
|
||||||
|
zifferIST--;
|
||||||
|
input[i] = zifferIST + 48;
|
||||||
|
lastcorrected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
pot = posPunkt - i - 1;
|
||||||
|
zw = PreValue / pow(10, pot);
|
||||||
|
ziffer = ((int) zw) % 10;
|
||||||
|
if (zifferIST < ziffer)
|
||||||
|
{
|
||||||
|
if (lastvalueanalog >= 7)
|
||||||
|
{
|
||||||
|
input[i] = ziffer + 48;
|
||||||
|
lastvalueanalog = ziffer;
|
||||||
|
lastcorrected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ protected:
|
|||||||
bool useMaxRateValue;
|
bool useMaxRateValue;
|
||||||
bool ErrorMessage;
|
bool ErrorMessage;
|
||||||
bool PreValueOkay;
|
bool PreValueOkay;
|
||||||
|
bool checkDigitIncreaseConsistency;
|
||||||
|
|
||||||
string FilePreValue;
|
string FilePreValue;
|
||||||
float PreValue;
|
float PreValue;
|
||||||
@@ -25,7 +26,7 @@ protected:
|
|||||||
bool LoadPreValue(void);
|
bool LoadPreValue(void);
|
||||||
|
|
||||||
|
|
||||||
string ErsetzteN(string);
|
string ErsetzteN(string, int lastvalueanalog);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ClassFlowPostProcessing();
|
ClassFlowPostProcessing();
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ bool CTfLiteClass::LoadInputImage(std::string _fn)
|
|||||||
*(input_data_ptr) = (float) blue;
|
*(input_data_ptr) = (float) blue;
|
||||||
input_data_ptr++;
|
input_data_ptr++;
|
||||||
|
|
||||||
printf("BMP: %f %f %f\n", (float) red, (float) green, (float) blue);
|
// printf("BMP: %f %f %f\n", (float) red, (float) green, (float) blue);
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -104,22 +104,26 @@ void Init_NVS_SDCard()
|
|||||||
|
|
||||||
extern "C" void app_main()
|
extern "C" void app_main()
|
||||||
{
|
{
|
||||||
|
// LogFile.WriteToFile("Startsequence 01");
|
||||||
Init_NVS_SDCard();
|
Init_NVS_SDCard();
|
||||||
|
LogFile.WriteToFile("Startsequence 02");
|
||||||
CheckOTAUpdate();
|
CheckOTAUpdate();
|
||||||
|
LogFile.WriteToFile("Startsequence 03");
|
||||||
std::string ssid = "";
|
std::string ssid = "";
|
||||||
std::string password = "";
|
std::string password = "";
|
||||||
LoadWlanFromFile("/sdcard/wlan.ini", ssid, password);
|
LoadWlanFromFile("/sdcard/wlan.ini", ssid, password);
|
||||||
|
LogFile.WriteToFile("Startsequence 04");
|
||||||
printf("WLan: %s, %s\n", ssid.c_str(), password.c_str());
|
printf("WLan: %s, %s\n", ssid.c_str(), password.c_str());
|
||||||
|
|
||||||
initialise_wifi(ssid, password);
|
initialise_wifi(ssid, password);
|
||||||
|
LogFile.WriteToFile("Startsequence 05");
|
||||||
|
|
||||||
TickType_t xDelay;
|
TickType_t xDelay;
|
||||||
xDelay = 2000 / portTICK_PERIOD_MS;
|
xDelay = 2000 / portTICK_PERIOD_MS;
|
||||||
printf("Autoflow: sleep for : %ldms\n", (long) xDelay);
|
printf("Autoflow: sleep for : %ldms\n", (long) xDelay);
|
||||||
|
LogFile.WriteToFile("Startsequence 06");
|
||||||
vTaskDelay( xDelay );
|
vTaskDelay( xDelay );
|
||||||
|
LogFile.WriteToFile("Startsequence 07");
|
||||||
setup_time();
|
setup_time();
|
||||||
LogFile.WriteToFile("======================== Main Started ================================");
|
LogFile.WriteToFile("======================== Main Started ================================");
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -15,9 +15,9 @@ SearchFieldY = 20
|
|||||||
Model=/config/dig0622.tfl
|
Model=/config/dig0622.tfl
|
||||||
ModelInputSize 20, 32
|
ModelInputSize 20, 32
|
||||||
LogImageLocation = /log/digit
|
LogImageLocation = /log/digit
|
||||||
digit1, 291, 97, 37, 67
|
digit1, 290, 99, 37, 67
|
||||||
digit2, 344, 97, 37, 67
|
digit2, 342, 99, 37, 67
|
||||||
digit3, 394, 97, 37, 67
|
digit3, 392, 99, 37, 67
|
||||||
|
|
||||||
[Analog]
|
[Analog]
|
||||||
Model=/config/ana0622.tfl
|
Model=/config/ana0622.tfl
|
||||||
@@ -34,6 +34,7 @@ PreValueAgeStartup = 30
|
|||||||
AllowNegativeRates = False
|
AllowNegativeRates = False
|
||||||
MaxRateValue = 0.1
|
MaxRateValue = 0.1
|
||||||
ErrorMessage = True
|
ErrorMessage = True
|
||||||
|
CheckDigitIncreaseConsistency = True
|
||||||
|
|
||||||
|
|
||||||
[AutoTimer]
|
[AutoTimer]
|
||||||
|
|||||||
Reference in New Issue
Block a user