Rolling 210527

This commit is contained in:
jomjol
2021-05-27 19:22:27 +02:00
parent 026bac121f
commit 6e0a7a742e
14 changed files with 61 additions and 14 deletions

View File

@@ -44,7 +44,14 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
**General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated! **General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated!
##### Rolling - (2021-05-22 - v2)
##### Rolling - (2021-05-27)
* MQTT error message: changes from blank to "no error" in case everything is okay
* Bug fix: disable LED, enable GPIO again
* Bug fix: if in fixed ip modus no DNS is specified, the gateway will be used
Rolling - (2021-05-22 - v2)
* Bug fix: calculation of flow rate, MQTT sending of rate * Bug fix: calculation of flow rate, MQTT sending of rate
Rolling - (2021-05-20) Rolling - (2021-05-20)

View File

@@ -222,6 +222,7 @@ void CCamera::SetQualitySize(int qual, framesize_t resol)
void CCamera::EnableAutoExposure(int flashdauer) void CCamera::EnableAutoExposure(int flashdauer)
{ {
LEDOnOff(true); LEDOnOff(true);
if (flashdauer > 0)
LightOnOff(true); LightOnOff(true);
const TickType_t xDelay = flashdauer / portTICK_PERIOD_MS; const TickType_t xDelay = flashdauer / portTICK_PERIOD_MS;
vTaskDelay( xDelay ); vTaskDelay( xDelay );

View File

@@ -22,13 +22,16 @@ static const char* TAG = "flow_controll";
std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _host){ std::string ClassFlowControll::doSingleStep(std::string _stepname, std::string _host){
std::string _classname = ""; std::string _classname = "";
std::string result = ""; std::string result = "";
// printf("_stepname: %s\n", _stepname.c_str());
if ((_stepname.compare("[MakeImage]") == 0) || (_stepname.compare(";[MakeImage]") == 0)){ if ((_stepname.compare("[MakeImage]") == 0) || (_stepname.compare(";[MakeImage]") == 0)){
_classname = "ClassFlowMakeImage"; _classname = "ClassFlowMakeImage";
} }
if ((_stepname.compare("[Alignment]") == 0) || (_stepname.compare(";[Alignment]") == 0)){ if ((_stepname.compare("[Alignment]") == 0) || (_stepname.compare(";[Alignment]") == 0)){
_classname = "ClassFlowAlignment"; _classname = "ClassFlowAlignment";
} }
if ((_stepname.compare("[Digits]") == 0) || (_stepname.compare(";[Digits]") == 0)){ if ((_stepname.compare(0, 7, "[Digits") == 0) || (_stepname.compare(0, 8, ";[Digits") == 0)) {
// if ((_stepname.compare("[Digits]") == 0) || (_stepname.compare(";[Digits]") == 0)){
// printf("Digits!!!\n");
_classname = "ClassFlowDigit"; _classname = "ClassFlowDigit";
} }
if ((_stepname.compare("[Analog]") == 0) || (_stepname.compare(";[Analog]") == 0)){ if ((_stepname.compare("[Analog]") == 0) || (_stepname.compare(";[Analog]") == 0)){
@@ -110,7 +113,7 @@ ClassFlow* ClassFlowControll::CreateClassFlow(std::string _type)
cfc = new ClassFlowAnalog(&FlowControll); cfc = new ClassFlowAnalog(&FlowControll);
flowanalog = (ClassFlowAnalog*) cfc; flowanalog = (ClassFlowAnalog*) cfc;
} }
if (toUpper(_type).compare("[DIGITS]") == 0) if (toUpper(_type).compare(0, 7, "[DIGITS") == 0)
{ {
cfc = new ClassFlowDigit(&FlowControll); cfc = new ClassFlowDigit(&FlowControll);
flowdigit = (ClassFlowDigit*) cfc; flowdigit = (ClassFlowDigit*) cfc;

View File

@@ -26,7 +26,8 @@ void ClassFlowDigit::SetInitialParameter(void)
previousElement = NULL; previousElement = NULL;
SaveAllFiles = false; SaveAllFiles = false;
disabled = false; disabled = false;
DecimalShift = 0;
DecimalShiftEnabled = false;
} }
ClassFlowDigit::ClassFlowDigit() : ClassFlowImage(TAG) ClassFlowDigit::ClassFlowDigit() : ClassFlowImage(TAG)
@@ -88,8 +89,25 @@ bool ClassFlowDigit::ReadParameter(FILE* pfile, string& aktparamgraph)
if (!this->GetNextParagraph(pfile, aktparamgraph)) if (!this->GetNextParagraph(pfile, aktparamgraph))
return false; return false;
printf("aktparamgraph: %s\n", aktparamgraph.c_str());
/*
if ((aktparamgraph.compare("[Digits]") != 0) && (aktparamgraph.compare(";[Digits]") != 0)) // Paragraph passt nich zu MakeImage if ((aktparamgraph.compare("[Digits]") != 0) && (aktparamgraph.compare(";[Digits]") != 0)) // Paragraph passt nich zu MakeImage
return false; return false;
*/
if ((aktparamgraph.compare(0, 7, "[Digits") != 0) && (aktparamgraph.compare(0, 8, ";[Digits") != 0)) // Paragraph passt nich zu MakeImage
return false;
int _pospkt = aktparamgraph.find_first_of(".");
int _posklammerzu = aktparamgraph.find_first_of("]");
// printf("Pos: %d, %d\n", _pospkt, _posklammerzu);
if (_pospkt > -1)
NameDigit = aktparamgraph.substr(_pospkt+1, _posklammerzu - _pospkt-1);
else
NameDigit = "";
printf("Name Digit: %s\n", NameDigit.c_str());
if (aktparamgraph[0] == ';') if (aktparamgraph[0] == ';')
{ {

View File

@@ -21,6 +21,10 @@ protected:
string cnnmodelfile; string cnnmodelfile;
int modelxsize, modelysize; int modelxsize, modelysize;
bool SaveAllFiles; bool SaveAllFiles;
string NameDigit;
int DecimalShift;
bool DecimalShiftEnabled;
ClassFlowAlignment* flowpostalignment; ClassFlowAlignment* flowpostalignment;

View File

@@ -26,6 +26,7 @@ void ClassFlowMakeImage::takePictureWithFlash(int flashdauer)
rawImage->width = image_width; rawImage->width = image_width;
rawImage->height = image_height; rawImage->height = image_height;
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
printf("Flashdauer: %d\n", flashdauer);
Camera.CaptureToBasisImage(rawImage, flashdauer); Camera.CaptureToBasisImage(rawImage, flashdauer);
time(&TimeImageTaken); time(&TimeImageTaken);
localtime(&TimeImageTaken); localtime(&TimeImageTaken);
@@ -93,6 +94,12 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
SaveAllFiles = true; SaveAllFiles = true;
} }
if ((toUpper(zerlegt[0]) == "WAITBEFORETAKINGPICTURE") && (zerlegt.size() > 1))
{
waitbeforepicture = stoi(zerlegt[1]);
}
if ((toUpper(zerlegt[0]) == "BRIGHTNESS") && (zerlegt.size() > 1)) if ((toUpper(zerlegt[0]) == "BRIGHTNESS") && (zerlegt.size() > 1))
{ {
_brightness = stoi(zerlegt[1]); _brightness = stoi(zerlegt[1]);
@@ -124,9 +131,9 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
rawImage->CreateEmptyImage(image_width, image_height, 3); rawImage->CreateEmptyImage(image_width, image_height, 3);
waitbeforepicture_store = waitbeforepicture; waitbeforepicture_store = waitbeforepicture;
if (FixedExposure) if (FixedExposure && (waitbeforepicture > 0))
{ {
printf("Fixed Exposure enabled!\n"); // printf("Fixed Exposure enabled!\n");
int flashdauer = (int) (waitbeforepicture * 1000); int flashdauer = (int) (waitbeforepicture * 1000);
Camera.EnableAutoExposure(flashdauer); Camera.EnableAutoExposure(flashdauer);
waitbeforepicture = 0.2; waitbeforepicture = 0.2;

View File

@@ -434,6 +434,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
if (ErrorMessageText.length() == 0) if (ErrorMessageText.length() == 0)
{ {
PreValue = Value; PreValue = Value;
ErrorMessageText = "no error";
SavePreValue(Value, zwtime); SavePreValue(Value, zwtime);
} }
return true; return true;

View File

@@ -176,7 +176,11 @@ void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostna
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg)); ESP_ERROR_CHECK(esp_wifi_init(&cfg));
if (_dns != NULL) { if ((_ipadr != NULL) && (_gw != NULL) && (_netmask != NULL))
{
if (_dns == NULL)
_dns = _gw;
ESP_LOGI(TAG, "set DNS manual"); ESP_LOGI(TAG, "set DNS manual");
esp_netif_dns_info_t dns_info; esp_netif_dns_info_t dns_info;
ip4_addr_t ip; ip4_addr_t ip;

2
code/dependencies.lock Normal file
View File

@@ -0,0 +1,2 @@
manifest_hash: 45994dbfed009907994c31f6d279c5861a1eacbf219ce8b58e74e39b3393816a
version: 1.0.0

View File

@@ -31,7 +31,7 @@
#define __SD_USE_ONE_LINE_MODE__ #define __SD_USE_ONE_LINE_MODE__
#ifdef __SD_USE_ONE_LINE_MODE__ #ifdef __SD_USE_ONE_LINE_MODE__
// #include "server_GPIO.h" #include "server_GPIO.h"
#endif #endif
@@ -200,7 +200,7 @@ extern "C" void app_main(void)
register_server_ota_sdcard_uri(server); register_server_ota_sdcard_uri(server);
#ifdef __SD_USE_ONE_LINE_MODE__ #ifdef __SD_USE_ONE_LINE_MODE__
// register_server_GPIO_uri(server); register_server_GPIO_uri(server);
#endif #endif
printf("vor reg server main\n"); printf("vor reg server main\n");

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="8a26b81"; const char* GIT_REV="026bac1";
const char* GIT_TAG=""; const char* GIT_TAG="";
const char* GIT_BRANCH="rolling"; const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2021-05-22 11:34"; const char* BUILD_TIME="2021-05-27 19:10";

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="8a26b81"; const char* GIT_REV="026bac1";
const char* GIT_TAG=""; const char* GIT_TAG="";
const char* GIT_BRANCH="rolling"; const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2021-05-22 11:34"; const char* BUILD_TIME="2021-05-27 19:10";

Binary file not shown.

Binary file not shown.