mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 12:36:52 +03:00
Rolling 20210520
This commit is contained in:
@@ -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!
|
**General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated!
|
||||||
|
|
||||||
##### Rolling - (2021-05-20)
|
##### Rolling - (2021-05-20)
|
||||||
|
* Bug fix: mqtt retain message flag
|
||||||
|
|
||||||
|
Rolling - (2021-05-20)
|
||||||
* Bug fix: WLan reconnect after connection lost
|
* Bug fix: WLan reconnect after connection lost
|
||||||
|
|
||||||
|
|
||||||
Rolling - (2021-05-17)
|
Rolling - (2021-05-17)
|
||||||
* Update wlan handling to esp-idf 4.1
|
* Update wlan handling to esp-idf 4.1
|
||||||
* Set mqtt error message with retain flag
|
* Set mqtt error message with retain flag
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ static const char* TAG = "flow_make_image";
|
|||||||
esp_err_t ClassFlowMakeImage::camera_capture(){
|
esp_err_t ClassFlowMakeImage::camera_capture(){
|
||||||
string nm = namerawimage;
|
string nm = namerawimage;
|
||||||
Camera.CaptureToFile(nm);
|
Camera.CaptureToFile(nm);
|
||||||
|
time(&TimeImageTaken);
|
||||||
|
localtime(&TimeImageTaken);
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,6 +27,9 @@ void ClassFlowMakeImage::takePictureWithFlash(int flashdauer)
|
|||||||
rawImage->height = image_height;
|
rawImage->height = image_height;
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
Camera.CaptureToBasisImage(rawImage, flashdauer);
|
Camera.CaptureToBasisImage(rawImage, flashdauer);
|
||||||
|
time(&TimeImageTaken);
|
||||||
|
localtime(&TimeImageTaken);
|
||||||
|
|
||||||
if (SaveAllFiles) rawImage->SaveToFile(namerawimage);
|
if (SaveAllFiles) rawImage->SaveToFile(namerawimage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,6 +175,9 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
|
|||||||
esp_err_t ClassFlowMakeImage::SendRawJPG(httpd_req_t *req)
|
esp_err_t ClassFlowMakeImage::SendRawJPG(httpd_req_t *req)
|
||||||
{
|
{
|
||||||
int flashdauer = (int) (waitbeforepicture * 1000);
|
int flashdauer = (int) (waitbeforepicture * 1000);
|
||||||
|
time(&TimeImageTaken);
|
||||||
|
localtime(&TimeImageTaken);
|
||||||
|
|
||||||
return Camera.CaptureToHTTP(req, flashdauer);
|
return Camera.CaptureToHTTP(req, flashdauer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,6 +188,9 @@ ImageData* ClassFlowMakeImage::SendRawImage()
|
|||||||
ImageData *id;
|
ImageData *id;
|
||||||
int flashdauer = (int) (waitbeforepicture * 1000);
|
int flashdauer = (int) (waitbeforepicture * 1000);
|
||||||
Camera.CaptureToBasisImage(zw, flashdauer);
|
Camera.CaptureToBasisImage(zw, flashdauer);
|
||||||
|
time(&TimeImageTaken);
|
||||||
|
localtime(&TimeImageTaken);
|
||||||
|
|
||||||
id = zw->writeToMemoryAsJPG();
|
id = zw->writeToMemoryAsJPG();
|
||||||
delete zw;
|
delete zw;
|
||||||
return id;
|
return id;
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
|||||||
time_t currenttime;
|
time_t currenttime;
|
||||||
time(¤ttime);
|
time(¤ttime);
|
||||||
localtime(¤ttime);
|
localtime(¤ttime);
|
||||||
|
// currenttime =
|
||||||
double difference = difftime(currenttime, lastvalue); // in Sekunden
|
double difference = difftime(currenttime, lastvalue); // in Sekunden
|
||||||
difference /= 60; // in Minuten
|
difference /= 60; // in Minuten
|
||||||
FlowRateAct = (Value - PreValue) / difference;
|
FlowRateAct = (Value - PreValue) / difference;
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ void MQTTInit(std::string _mqttURI, std::string _clientid, std::string _user, st
|
|||||||
.client_id = _clientid.c_str(),
|
.client_id = _clientid.c_str(),
|
||||||
.lwt_topic = _LWTContext.c_str(),
|
.lwt_topic = _LWTContext.c_str(),
|
||||||
.lwt_msg = _zwmessage.c_str(),
|
.lwt_msg = _zwmessage.c_str(),
|
||||||
|
.lwt_retain = 1,
|
||||||
.lwt_msg_len = _lzw,
|
.lwt_msg_len = _lzw,
|
||||||
.keepalive = _keepalive
|
.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_register_event(client, esp_mmqtt_ID, mqtt_event_handler, client);
|
||||||
esp_mqtt_client_start(client);
|
esp_mqtt_client_start(client);
|
||||||
|
|
||||||
MQTTPublish(_LWTContext, "");
|
MQTTPublish(_LWTContext, "", 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,17 @@ void time_sync_notification_cb(struct timeval *tv)
|
|||||||
ESP_LOGI(TAG, "Notification of a time synchronization event");
|
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)
|
std::string gettimestring(const char * frm)
|
||||||
{
|
{
|
||||||
time_t now;
|
time_t now;
|
||||||
|
|||||||
@@ -15,5 +15,7 @@
|
|||||||
void setup_time(void);
|
void setup_time(void);
|
||||||
|
|
||||||
std::string gettimestring(const char * frm);
|
std::string gettimestring(const char * frm);
|
||||||
|
std::string ConvertTimeToString(time_t _time, const char * frm);
|
||||||
|
|
||||||
void setTimeZone(std::string _tzstring);
|
void setTimeZone(std::string _tzstring);
|
||||||
void reset_servername(std::string _servername);
|
void reset_servername(std::string _servername);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
const char* GIT_REV="58eb0b1";
|
const char* GIT_REV="9b791bb";
|
||||||
const char* GIT_TAG="";
|
const char* GIT_TAG="";
|
||||||
const char* GIT_BRANCH="rolling";
|
const char* GIT_BRANCH="rolling";
|
||||||
const char* BUILD_TIME="2021-05-20 06:55";
|
const char* BUILD_TIME="2021-05-20 21:43";
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
const char* GIT_REV="58eb0b1";
|
const char* GIT_REV="9b791bb";
|
||||||
const char* GIT_TAG="";
|
const char* GIT_TAG="";
|
||||||
const char* GIT_BRANCH="rolling";
|
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.
Reference in New Issue
Block a user