Rolling 20210520

This commit is contained in:
jomjol
2021-05-20 21:58:37 +02:00
parent 9b791bb7a7
commit 528a4435a9
10 changed files with 35 additions and 5 deletions

View File

@@ -44,9 +44,12 @@ 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!
##### Rolling - (2021-05-20)
* Bug fix: mqtt retain message flag
Rolling - (2021-05-20)
* Bug fix: WLan reconnect after connection lost
Rolling - (2021-05-17)
* Update wlan handling to esp-idf 4.1
* Set mqtt error message with retain flag

View File

@@ -14,6 +14,9 @@ static const char* TAG = "flow_make_image";
esp_err_t ClassFlowMakeImage::camera_capture(){
string nm = namerawimage;
Camera.CaptureToFile(nm);
time(&TimeImageTaken);
localtime(&TimeImageTaken);
return ESP_OK;
}
@@ -24,6 +27,9 @@ void ClassFlowMakeImage::takePictureWithFlash(int flashdauer)
rawImage->height = image_height;
/////////////////////////////////////////////////////////////////////////////////////
Camera.CaptureToBasisImage(rawImage, flashdauer);
time(&TimeImageTaken);
localtime(&TimeImageTaken);
if (SaveAllFiles) rawImage->SaveToFile(namerawimage);
}
@@ -169,6 +175,9 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
esp_err_t ClassFlowMakeImage::SendRawJPG(httpd_req_t *req)
{
int flashdauer = (int) (waitbeforepicture * 1000);
time(&TimeImageTaken);
localtime(&TimeImageTaken);
return Camera.CaptureToHTTP(req, flashdauer);
}
@@ -179,6 +188,9 @@ ImageData* ClassFlowMakeImage::SendRawImage()
ImageData *id;
int flashdauer = (int) (waitbeforepicture * 1000);
Camera.CaptureToBasisImage(zw, flashdauer);
time(&TimeImageTaken);
localtime(&TimeImageTaken);
id = zw->writeToMemoryAsJPG();
delete zw;
return id;

View File

@@ -392,6 +392,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
time_t currenttime;
time(&currenttime);
localtime(&currenttime);
// currenttime =
double difference = difftime(currenttime, lastvalue); // in Sekunden
difference /= 60; // in Minuten
FlowRateAct = (Value - PreValue) / difference;

View File

@@ -74,6 +74,7 @@ void MQTTInit(std::string _mqttURI, std::string _clientid, std::string _user, st
.client_id = _clientid.c_str(),
.lwt_topic = _LWTContext.c_str(),
.lwt_msg = _zwmessage.c_str(),
.lwt_retain = 1,
.lwt_msg_len = _lzw,
.keepalive = _keepalive
};
@@ -88,5 +89,5 @@ void MQTTInit(std::string _mqttURI, std::string _clientid, std::string _user, st
esp_mqtt_client_register_event(client, esp_mmqtt_ID, mqtt_event_handler, client);
esp_mqtt_client_start(client);
MQTTPublish(_LWTContext, "");
MQTTPublish(_LWTContext, "", 1);
}

View File

@@ -27,6 +27,17 @@ void time_sync_notification_cb(struct timeval *tv)
ESP_LOGI(TAG, "Notification of a time synchronization event");
}
std::string ConvertTimeToString(time_t _time, const char * frm)
{
struct tm timeinfo;
char strftime_buf[64];
localtime_r(&_time, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), frm, &timeinfo);
std::string result(strftime_buf);
return result;
}
std::string gettimestring(const char * frm)
{
time_t now;

View File

@@ -15,5 +15,7 @@
void setup_time(void);
std::string gettimestring(const char * frm);
std::string ConvertTimeToString(time_t _time, const char * frm);
void setTimeZone(std::string _tzstring);
void reset_servername(std::string _servername);

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="58eb0b1";
const char* GIT_REV="9b791bb";
const char* GIT_TAG="";
const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2021-05-20 06:55";
const char* BUILD_TIME="2021-05-20 21:43";

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="58eb0b1";
const char* GIT_REV="9b791bb";
const char* GIT_TAG="";
const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2021-05-20 06:55";
const char* BUILD_TIME="2021-05-20 21:43";

Binary file not shown.

Binary file not shown.