-bool debugdetailtflite = false;
+// #define DEBUG_DETAIL_ON
float CTfLiteClass::GetOutputValue(int nr)
{
@@ -19,19 +17,14 @@ float CTfLiteClass::GetOutputValue(int nr)
return output2->data.f[nr];
}
-
-int CTfLiteClass::GetClassFromImage(std::string _fn)
+int CTfLiteClass::GetClassFromImageBasis(CImageBasis *rs)
{
-// printf("Before Load image %s\n", _fn.c_str());
- if (!LoadInputImage(_fn))
+ if (!LoadInputImageBasis(rs))
return -1000;
-// printf("After Load image %s\n", _fn.c_str());
Invoke();
- printf("After Invoke %s\n", _fn.c_str());
return GetOutClassification();
-// return 0;
}
int CTfLiteClass::GetOutClassification()
@@ -55,7 +48,6 @@ int CTfLiteClass::GetOutClassification()
zw_class = i;
}
}
-// printf("Result Ziffer: %d\n", zw_class);
return zw_class;
}
@@ -107,21 +99,17 @@ void CTfLiteClass::GetOutPut()
void CTfLiteClass::Invoke()
{
interpreter->Invoke();
-// printf("Invoke Done.\n");
}
-bool CTfLiteClass::LoadInputImage(std::string _fn)
+
+bool CTfLiteClass::LoadInputImageBasis(CImageBasis *rs)
{
- std::string zw = "ClassFlowAnalog::doNeuralNetwork nach Load Image: " + _fn;
-// LogFile.WriteToFile(zw);
- bitmap_image image(_fn);
- if (debugdetailtflite) LogFile.WriteToFile(zw);
+ std::string zw = "ClassFlowAnalog::doNeuralNetwork nach LoadInputResizeImage: ";
- unsigned int w = image.width();
- unsigned int h = image.height();
+ unsigned int w = rs->width;
+ unsigned int h = rs->height;
unsigned char red, green, blue;
-
// printf("Image: %s size: %d x %d\n", _fn.c_str(), w, h);
input_i = 0;
@@ -130,21 +118,20 @@ bool CTfLiteClass::LoadInputImage(std::string _fn)
for (int y = 0; y < h; ++y)
for (int x = 0; x < w; ++x)
{
- red = image.red_channel(x, y);
- green = image.green_channel(x, y);
- blue = image.blue_channel(x, y);
+ red = rs->GetPixelColor(x, y, 0);
+ green = rs->GetPixelColor(x, y, 1);
+ blue = rs->GetPixelColor(x, y, 2);
*(input_data_ptr) = (float) red;
input_data_ptr++;
*(input_data_ptr) = (float) green;
input_data_ptr++;
*(input_data_ptr) = (float) blue;
input_data_ptr++;
-
-// printf("BMP: %f %f %f\n", (float) red, (float) green, (float) blue);
-
}
-
- if (debugdetailtflite) LogFile.WriteToFile("Nach dem Laden in input");
+
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteToFile("Nach dem Laden in input");
+#endif
return true;
}
@@ -152,7 +139,6 @@ bool CTfLiteClass::LoadInputImage(std::string _fn)
void CTfLiteClass::MakeAllocate()
{
-// static tflite::ops::micro::AllOpsResolver resolver;
static tflite::AllOpsResolver resolver;
this->interpreter = new tflite::MicroInterpreter(this->model, resolver, this->tensor_arena, this->kTensorArenaSize, this->error_reporter);
@@ -162,16 +148,15 @@ void CTfLiteClass::MakeAllocate()
this->GetInputDimension();
return;
}
-
// printf("Allocate Done.\n");
}
void CTfLiteClass::GetInputTensorSize(){
float *zw = this->input;
int test = sizeof(zw);
+#ifdef DEBUG_DETAIL_ON
printf("Input Tensor Dimension: %d\n", test);
-
- printf("Input Tensor Dimension: %d\n", test);
+#endif
}
long CTfLiteClass::GetFileSize(std::string filename)
@@ -186,24 +171,34 @@ unsigned char* CTfLiteClass::ReadFileToCharArray(std::string _fn)
{
long size;
- size = this->GetFileSize(_fn);
+ size = GetFileSize(_fn);
if (size == -1)
{
- printf("\nFile existiert nicht.\n");
- return NULL;
+ printf("\nFile existiert nicht.\n");
+ return NULL;
}
-
unsigned char *result = (unsigned char*) malloc(size);
+ int anz = 1;
+ TickType_t xDelay;
+ while (!result && (anz < 6)) // maximal 5x versuchen (= 5s)
+ {
+#ifdef DEBUG_DETAIL_ON
+ printf("Speicher ist voll - Versuche es erneut: %d.\n", anz);
+#endif
+ xDelay = 1000 / portTICK_PERIOD_MS;
+ result = (unsigned char*) malloc(size);
+ anz++;
+ }
+
- if(result != NULL) {
-// printf("\nSpeicher ist reserviert\n");
- FILE* f = fopen(_fn.c_str(), "rb"); // vorher nur "r"
+ if(result != NULL) {
+ FILE* f = OpenFileAndWait(_fn.c_str(), "rb"); // vorher nur "r"
fread(result, 1, size, f);
fclose(f);
- }else {
- printf("\nKein freier Speicher vorhanden.\n");
+ }else {
+ printf("\nKein freier Speicher vorhanden.\n");
}
@@ -219,14 +214,11 @@ void CTfLiteClass::LoadModel(std::string _fn){
#endif
unsigned char *rd;
- rd = this->ReadFileToCharArray(_fn.c_str());
-// printf("loadedfile: %d", (int) rd);
+ rd = ReadFileToCharArray(_fn.c_str());
this->model = tflite::GetModel(rd);
free(rd);
TFLITE_MINIMAL_CHECK(model != nullptr);
-// printf("tfile Loaded.\n");
-
}
@@ -237,7 +229,7 @@ CTfLiteClass::CTfLiteClass()
this->interpreter = nullptr;
this->input = nullptr;
this->output = nullptr;
- this->kTensorArenaSize = 600 * 1024;
+ this->kTensorArenaSize = 150 * 1024; /// laut testfile: 108000 - bisher 600
this->tensor_arena = new uint8_t[kTensorArenaSize];
}
@@ -255,6 +247,6 @@ namespace tflite {
return 0;
}
-} // namespace tflite
+}
diff --git a/code/components/jomjol_tfliteclass/CTfLiteClass.h b/code/components/jomjol_tfliteclass/CTfLiteClass.h
index 1350a86a..c4bd057e 100644
--- a/code/components/jomjol_tfliteclass/CTfLiteClass.h
+++ b/code/components/jomjol_tfliteclass/CTfLiteClass.h
@@ -14,6 +14,8 @@
#include "esp_err.h"
#include "esp_log.h"
+#include "CImageBasis.h"
+
#define SUPRESS_TFLITE_ERRORS // use, to avoid error messages from TFLITE
@@ -39,7 +41,6 @@ class CTfLiteClass
const tflite::Model* model;
tflite::MicroInterpreter* interpreter;
TfLiteTensor* output = nullptr;
-// static tflite::ops::micro::AllOpsResolver *resolver;
static tflite::AllOpsResolver resolver;
int kTensorArenaSize;
@@ -58,11 +59,11 @@ class CTfLiteClass
void LoadModel(std::string _fn);
void MakeAllocate();
void GetInputTensorSize();
- bool LoadInputImage(std::string _fn);
+ bool LoadInputImageBasis(CImageBasis *rs);
void Invoke();
void GetOutPut();
int GetOutClassification();
- int GetClassFromImage(std::string _fn);
+ int GetClassFromImageBasis(CImageBasis *rs);
float GetOutputValue(int nr);
void GetInputDimension(bool silent);
diff --git a/code/components/jomjol_tfliteclass/server_tflite.cpp b/code/components/jomjol_tfliteclass/server_tflite.cpp
index efe6ab21..963fa9b5 100644
--- a/code/components/jomjol_tfliteclass/server_tflite.cpp
+++ b/code/components/jomjol_tfliteclass/server_tflite.cpp
@@ -18,17 +18,41 @@
#include "ClassLogFile.h"
+//#define DEBUG_DETAIL_ON
+
+
ClassFlowControll tfliteflow;
TaskHandle_t xHandleblink_task_doFlow = NULL;
TaskHandle_t xHandletask_autodoFlow = NULL;
+
+
bool flowisrunning = false;
long auto_intervall = 0;
bool auto_isrunning = false;
+
+int countRounds = 0;
+
+int getCountFlowRounds() {
+ return countRounds;
+}
+
+
+
+esp_err_t GetJPG(std::string _filename, httpd_req_t *req)
+{
+ return tfliteflow.GetJPGStream(_filename, req);
+}
+
+esp_err_t GetRawJPG(httpd_req_t *req)
+{
+ return tfliteflow.SendRawJPG(req);
+}
+
bool isSetupModusActive() {
return tfliteflow.getStatusSetupModus();
return false;
@@ -37,28 +61,40 @@ bool isSetupModusActive() {
void KillTFliteTasks()
{
- printf("Handle: xHandleblink_task_doFlow: %ld\n", (long) xHandleblink_task_doFlow);
+#ifdef DEBUG_DETAIL_ON
+ printf("Handle: xHandleblink_task_doFlow: %ld\n", (long) xHandleblink_task_doFlow);
+#endif
if (xHandleblink_task_doFlow)
{
vTaskDelete(xHandleblink_task_doFlow);
+#ifdef DEBUG_DETAIL_ON
printf("Killed: xHandleblink_task_doFlow\n");
+#endif
}
+#ifdef DEBUG_DETAIL_ON
printf("Handle: xHandletask_autodoFlow: %ld\n", (long) xHandletask_autodoFlow);
+#endif
if (xHandletask_autodoFlow)
{
vTaskDelete(xHandletask_autodoFlow);
+#ifdef DEBUG_DETAIL_ON
printf("Killed: xHandletask_autodoFlow\n");
+#endif
}
}
void doInit(void)
{
- string config = "/sdcard/config/config.ini";
+ string config = "/sdcard/config/config.ini";
+#ifdef DEBUG_DETAIL_ON
printf("Start tfliteflow.InitFlow(config);\n");
+#endif
tfliteflow.InitFlow(config);
+#ifdef DEBUG_DETAIL_ON
printf("Finished tfliteflow.InitFlow(config);\n");
+#endif
}
@@ -71,13 +107,17 @@ bool doflow(void)
tfliteflow.doFlow(zw_time);
flowisrunning = false;
+#ifdef DEBUG_DETAIL_ON
printf("doflow - end %s\n", zw_time.c_str());
+#endif
return true;
}
void blink_task_doFlow(void *pvParameter)
{
+#ifdef DEBUG_DETAIL_ON
printf("blink_task_doFlow\n");
+#endif
if (!flowisrunning)
{
flowisrunning = true;
@@ -91,8 +131,10 @@ void blink_task_doFlow(void *pvParameter)
esp_err_t handler_init(httpd_req_t *req)
{
- LogFile.WriteToFile("handler_init");
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_init - Start");
printf("handler_doinit uri:\n"); printf(req->uri); printf("\n");
+#endif
char* resp_str = "Init started ";
httpd_resp_send(req, resp_str, strlen(resp_str));
@@ -104,12 +146,19 @@ esp_err_t handler_init(httpd_req_t *req)
/* Respond with an empty chunk to signal HTTP response completion */
httpd_resp_send_chunk(req, NULL, 0);
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_init - Done");
+#endif
+
return ESP_OK;
};
esp_err_t handler_doflow(httpd_req_t *req)
{
- LogFile.WriteToFile("handler_doflow");
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_doflow - Start");
+#endif
+
char* resp_str;
printf("handler_doFlow uri: "); printf(req->uri); printf("\n");
@@ -127,7 +176,12 @@ esp_err_t handler_doflow(httpd_req_t *req)
resp_str = "doFlow gestartet - dauert ca. 60 Sekunden";
httpd_resp_send(req, resp_str, strlen(resp_str));
/* Respond with an empty chunk to signal HTTP response completion */
- httpd_resp_send_chunk(req, NULL, 0);
+ httpd_resp_send_chunk(req, NULL, 0);
+
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_doflow - Done");
+#endif
+
return ESP_OK;
};
@@ -136,7 +190,10 @@ esp_err_t handler_doflow(httpd_req_t *req)
esp_err_t handler_wasserzaehler(httpd_req_t *req)
{
- LogFile.WriteToFile("handler_wasserzaehler");
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_wasserzaehler - Start");
+#endif
+
bool _rawValue = false;
bool _noerror = false;
string zw;
@@ -151,12 +208,16 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
// printf("Query: "); printf(_query); printf("\n");
if (httpd_query_key_value(_query, "rawvalue", _size, 10) == ESP_OK)
{
+#ifdef DEBUG_DETAIL_ON
printf("rawvalue is found"); printf(_size); printf("\n");
+#endif
_rawValue = true;
}
if (httpd_query_key_value(_query, "noerror", _size, 10) == ESP_OK)
{
+#ifdef DEBUG_DETAIL_ON
printf("noerror is found"); printf(_size); printf("\n");
+#endif
_noerror = true;
}
}
@@ -171,7 +232,7 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
{
string txt, zw;
- txt = "Aligned Image:
\n";
+ txt = "
Aligned Image:
\n";
txt = txt + "Digital Counter:
";
httpd_resp_sendstr_chunk(req, txt.c_str());
@@ -205,7 +266,7 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
httpd_resp_sendstr_chunk(req, txt.c_str());
delete htmlinfo[i];
}
- htmlinfo.clear();
+ htmlinfo.clear();
}
@@ -217,13 +278,18 @@ esp_err_t handler_wasserzaehler(httpd_req_t *req)
/* Respond with an empty chunk to signal HTTP response completion */
httpd_resp_sendstr_chunk(req, NULL);
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_wasserzaehler - Done");
+#endif
return ESP_OK;
};
esp_err_t handler_editflow(httpd_req_t *req)
{
- LogFile.WriteToFile("handler_editflow");
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_editflow - Start");
+#endif
printf("handler_editflow uri: "); printf(req->uri); printf("\n");
@@ -235,7 +301,9 @@ esp_err_t handler_editflow(httpd_req_t *req)
{
if (httpd_query_key_value(_query, "task", _valuechar, 30) == ESP_OK)
{
+#ifdef DEBUG_DETAIL_ON
printf("task is found: %s\n", _valuechar);
+#endif
_task = string(_valuechar);
}
}
@@ -246,11 +314,13 @@ esp_err_t handler_editflow(httpd_req_t *req)
httpd_query_key_value(_query, "in", _valuechar, 30);
in = string(_valuechar);
- printf("in: "); printf(in.c_str()); printf("\n");
-
httpd_query_key_value(_query, "out", _valuechar, 30);
out = string(_valuechar);
+
+#ifdef DEBUG_DETAIL_ON
+ printf("in: "); printf(in.c_str()); printf("\n");
printf("out: "); printf(out.c_str()); printf("\n");
+#endif
in = "/sdcard" + in;
out = "/sdcard" + out;
@@ -269,31 +339,34 @@ esp_err_t handler_editflow(httpd_req_t *req)
httpd_query_key_value(_query, "in", _valuechar, 30);
in = string(_valuechar);
- printf("in: "); printf(in.c_str()); printf("\n");
httpd_query_key_value(_query, "out", _valuechar, 30);
out = string(_valuechar);
- printf("out: "); printf(out.c_str()); printf("\n");
httpd_query_key_value(_query, "x", _valuechar, 30);
zw = string(_valuechar);
x = stoi(zw);
- printf("x: "); printf(zw.c_str()); printf("\n");
httpd_query_key_value(_query, "y", _valuechar, 30);
zw = string(_valuechar);
y = stoi(zw);
- printf("y: "); printf(zw.c_str()); printf("\n");
httpd_query_key_value(_query, "dx", _valuechar, 30);
zw = string(_valuechar);
dx = stoi(zw);
- printf("dx: "); printf(zw.c_str()); printf("\n");
httpd_query_key_value(_query, "dy", _valuechar, 30);
zw = string(_valuechar);
dy = stoi(zw);
+
+#ifdef DEBUG_DETAIL_ON
+ printf("in: "); printf(in.c_str()); printf("\n");
+ printf("out: "); printf(out.c_str()); printf("\n");
+ printf("x: "); printf(zw.c_str()); printf("\n");
+ printf("y: "); printf(zw.c_str()); printf("\n");
+ printf("dx: "); printf(zw.c_str()); printf("\n");
printf("dy: "); printf(zw.c_str()); printf("\n");
+#endif
if (httpd_query_key_value(_query, "enhance", _valuechar, 10) == ESP_OK)
{
@@ -324,6 +397,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
zw = "CutImage Done";
httpd_resp_sendstr_chunk(req, zw.c_str());
+
}
if (_task.compare("test_take") == 0)
@@ -379,13 +453,20 @@ esp_err_t handler_editflow(httpd_req_t *req)
/* Respond with an empty chunk to signal HTTP response completion */
httpd_resp_sendstr_chunk(req, NULL);
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_editflow - Done");
+#endif
+
return ESP_OK;
};
esp_err_t handler_prevalue(httpd_req_t *req)
{
- LogFile.WriteToFile("handler_prevalue");
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_prevalue - Start");
+#endif
+
const char* resp_str;
string zw;
@@ -399,7 +480,9 @@ esp_err_t handler_prevalue(httpd_req_t *req)
// printf("Query: "); printf(_query); printf("\n");
if (httpd_query_key_value(_query, "value", _size, 10) == ESP_OK)
{
+#ifdef DEBUG_DETAIL_ON
printf("Value: "); printf(_size); printf("\n");
+#endif
}
}
@@ -414,6 +497,10 @@ esp_err_t handler_prevalue(httpd_req_t *req)
/* Respond with an empty chunk to signal HTTP response completion */
httpd_resp_send_chunk(req, NULL, 0);
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("handler_prevalue - Start");
+#endif
+
return ESP_OK;
};
@@ -434,20 +521,27 @@ void task_autodoFlow(void *pvParameter)
while (auto_isrunning)
{
- LogFile.WriteToFile("task_autodoFlow - next round");
+ std::string _zw = "task_autodoFlow - next round - Round #" + std::to_string(++countRounds);
+ LogFile.WriteToFile(_zw);
printf("Autoflow: start\n");
fr_start = esp_timer_get_time();
if (flowisrunning)
{
+#ifdef DEBUG_DETAIL_ON
printf("Autoflow: doFLow laeuft bereits!\n");
+#endif
}
else
{
+#ifdef DEBUG_DETAIL_ON
printf("Autoflow: doFLow wird gestartet\n");
+#endif
flowisrunning = true;
doflow();
+#ifdef DEBUG_DETAIL_ON
printf("Remove older log files\n");
+#endif
LogFile.RemoveOld();
}
@@ -507,5 +601,4 @@ void register_server_tflite_uri(httpd_handle_t server)
camuri.handler = handler_wasserzaehler;
camuri.user_ctx = (void*) "Wasserzaehler";
httpd_register_uri_handler(server, &camuri);
-
}
diff --git a/code/components/jomjol_tfliteclass/server_tflite.h b/code/components/jomjol_tfliteclass/server_tflite.h
index 68fc1dbc..148be20e 100644
--- a/code/components/jomjol_tfliteclass/server_tflite.h
+++ b/code/components/jomjol_tfliteclass/server_tflite.h
@@ -1,6 +1,7 @@
#include
#include
+#include "CImageBasis.h"
//#include "ClassControllCamera.h"
@@ -12,4 +13,8 @@ void KillTFliteTasks();
void TFliteDoAutoStart();
-bool isSetupModusActive();
\ No newline at end of file
+bool isSetupModusActive();
+
+esp_err_t GetJPG(std::string _filename, httpd_req_t *req);
+
+esp_err_t GetRawJPG(httpd_req_t *req);
diff --git a/code/components/jomjol_time_sntp/time_sntp.cpp b/code/components/jomjol_time_sntp/time_sntp.cpp
index da746ebd..4be9b8f2 100644
--- a/code/components/jomjol_time_sntp/time_sntp.cpp
+++ b/code/components/jomjol_time_sntp/time_sntp.cpp
@@ -1,11 +1,5 @@
#include "time_sntp.h"
-/* LwIP SNTP example
- This example code is in the Public Domain (or CC0 licensed, at your option.)
- Unless required by applicable law or agreed to in writing, this
- software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied.
-*/
#include
#include
#include
@@ -17,25 +11,19 @@
#include "esp_log.h"
#include "esp_attr.h"
#include "esp_sleep.h"
-// #include "nvs_flash.h"
-// #include "protocol_examples_common.h"
#include "esp_sntp.h"
#include "ClassLogFile.h"
static const char *TAG = "sntp";
-RTC_DATA_ATTR int boot_count = 0;
-
bool setTimeAlwaysOnReboot = true;
static void obtain_time(void);
static void initialize_sntp(void);
-
void time_sync_notification_cb(struct timeval *tv)
{
-// LogFile.WriteToFile("Notification of a time synchronization event");
ESP_LOGI(TAG, "Notification of a time synchronization event");
}
@@ -54,9 +42,6 @@ std::string gettimestring(const char * frm)
void setup_time()
{
- ++boot_count;
- ESP_LOGI(TAG, "Boot count: %d", boot_count);
-
time_t now;
struct tm timeinfo;
time(&now);
@@ -72,8 +57,6 @@ void setup_time()
char strftime_buf[64];
setTimeZone("CET-1CEST,M3.5.0,M10.5.0/3");
-// setTimeZone("Europe/Berlin");
-// setTimeZone("Asia/Tokyo");
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
@@ -97,9 +80,6 @@ void setTimeZone(std::string _tzstring)
static void obtain_time(void)
{
-// initialize_sntp();
-
- // wait for time to be set
time_t now = 0;
struct tm timeinfo = {};
int retry = 0;
@@ -110,18 +90,23 @@ static void obtain_time(void)
ESP_LOGI(TAG, "Waiting for system time to be set... (%d/%d)", retry, retry_count);
vTaskDelay(2000 / portTICK_PERIOD_MS);
}
- if (retry == retry_count) {
-// LogFile.WriteToFile("Time Synchzronisation nicht erfolgreich ...");
- }
- else
- {
-// LogFile.WriteToFile("Time erfolgreich ...");
- }
time(&now);
localtime_r(&now, &timeinfo);
}
+void reset_servername(std::string _servername)
+{
+ printf("Set SNTP-Server: %s\n", _servername.c_str());
+ sntp_stop();
+ sntp_setoperatingmode(SNTP_OPMODE_POLL);
+ sntp_setservername(0, _servername.c_str());
+ sntp_init();
+ obtain_time();
+ std::string zw = gettimestring("%Y%m%d-%H%M%S");
+ printf("Time ist %s\n", zw.c_str());
+}
+
static void initialize_sntp(void)
{
ESP_LOGI(TAG, "Initializing SNTP");
diff --git a/code/components/jomjol_time_sntp/time_sntp.h b/code/components/jomjol_time_sntp/time_sntp.h
index 3238e68a..930bfa35 100644
--- a/code/components/jomjol_time_sntp/time_sntp.h
+++ b/code/components/jomjol_time_sntp/time_sntp.h
@@ -15,4 +15,5 @@
void setup_time(void);
std::string gettimestring(const char * frm);
-void setTimeZone(std::string _tzstring);
\ No newline at end of file
+void setTimeZone(std::string _tzstring);
+void reset_servername(std::string _servername);
\ No newline at end of file
diff --git a/code/main/main.cpp b/code/main/main.cpp
index 11b26e79..0970180e 100644
--- a/code/main/main.cpp
+++ b/code/main/main.cpp
@@ -25,7 +25,7 @@
#include "ClassControllCamera.h"
#include "server_main.h"
#include "server_camera.h"
-
+#include "server_GPIO.h"
static const char *TAGMAIN = "connect_wlan_main";
#define FLASH_GPIO GPIO_NUM_4
@@ -44,10 +44,15 @@ void Init_NVS_SDCard()
// sdmmc_host_t host = SDMMC_HOST_SLOT_1();
// host.flags = SDMMC_HOST_FLAG_1BIT;
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
+ slot_config.width = 1; // 1 line SD mode
+
esp_vfs_fat_sdmmc_mount_config_t mount_config = { };
mount_config.format_if_mount_failed = false;
mount_config.max_files = 5;
+ gpio_set_pull_mode((gpio_num_t) 15, GPIO_PULLUP_ONLY); // CMD, needed in 4- and 1- line modes
+ gpio_set_pull_mode((gpio_num_t) 2, GPIO_PULLUP_ONLY); // D0, needed in 4- and 1-line modes
+
sdmmc_card_t* card;
ret = esp_vfs_fat_sdmmc_mount("/sdcard", &host, &slot_config, &mount_config, &card);
if (ret != ESP_OK) {
@@ -88,11 +93,12 @@ extern "C" void app_main(void)
// LoadWlanFromFile("/sdcard/wlan.ini", ssid, password, hostname, ip, gw, netmask, dns);
LoadWlanFromFile("/sdcard/wlan.ini", ssid, password, hostname);
+ LoadNetConfigFromFile("/sdcard/wlan.ini", ip, gw, netmask, dns);
// LogFile.WriteToFile("Startsequence 04");
printf("To use WLan: %s, %s\n", ssid.c_str(), password.c_str());
printf("To set Hostename: %s\n", hostname.c_str());
- printf("Fixed IP: %s, Gateway %s, Netmask %s\n", ip.c_str(), gw.c_str(), netmask.c_str());
+ printf("Fixed IP: %s, Gateway %s, Netmask %s, DNS %s\n", ip.c_str(), gw.c_str(), netmask.c_str(), dns.c_str());
if (ip.length() == 0 || gw.length() == 0 || netmask.length() == 0)
{
@@ -115,7 +121,9 @@ extern "C" void app_main(void)
vTaskDelay( xDelay );
// LogFile.WriteToFile("Startsequence 07");
setup_time();
- LogFile.WriteToFile("============================== Main Started =======================================");
+ LogFile.WriteToFile("=============================================================================================");
+ LogFile.WriteToFile("=================================== Main Started ============================================");
+ LogFile.WriteToFile("=============================================================================================");
LogFile.SwitchOnOff(false);
std::string zw = gettimestring("%Y%m%d-%H%M%S");
diff --git a/code/main/server_main.cpp b/code/main/server_main.cpp
index 084dca5d..37802ebf 100644
--- a/code/main/server_main.cpp
+++ b/code/main/server_main.cpp
@@ -15,16 +15,22 @@
#include "server_tflite.h"
+//#define DEBUG_DETAIL_ON
+
+
httpd_handle_t server = NULL;
-
std::string starttime = "";
/* An HTTP GET handler */
esp_err_t info_get_handler(httpd_req_t *req)
{
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("info_get_handler - Start");
+#endif
+
LogFile.WriteToFile("info_get_handler");
char _query[200];
char _valuechar[30];
@@ -125,25 +131,40 @@ esp_err_t info_get_handler(httpd_req_t *req)
return ESP_OK;
}
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("info_get_handler - Done");
+#endif
return ESP_OK;
}
esp_err_t starttime_get_handler(httpd_req_t *req)
{
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("starttime_get_handler - Start");
+#endif
+
httpd_resp_send(req, starttime.c_str(), strlen(starttime.c_str()));
/* Respond with an empty chunk to signal HTTP response completion */
- httpd_resp_send_chunk(req, NULL, 0);
+ httpd_resp_send_chunk(req, NULL, 0);
+
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("starttime_get_handler - Done");
+#endif
return ESP_OK;
}
esp_err_t hello_main_handler(httpd_req_t *req)
{
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("hello_main_handler - Start");
+#endif
+
char filepath[50];
- struct stat file_stat;
printf("uri: %s\n", req->uri);
int _pos;
+ esp_err_t res;
char *base_path = (char*) req->user_ctx;
std::string filetosend(base_path);
@@ -182,60 +203,37 @@ esp_err_t hello_main_handler(httpd_req_t *req)
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Filename too long");
return ESP_FAIL;
}
- if (stat(filetosend.c_str(), &file_stat) == -1) {
- /* If file not present on SPIFFS check if URI
- * corresponds to one of the hardcoded paths */
- ESP_LOGE(TAG, "Failed to stat file : %s", filetosend.c_str());
- /* Respond with 404 Not Found */
- httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File does not exist");
- return ESP_FAIL;
- }
- esp_err_t res;
- res = httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
- if (res != ESP_OK)
- return res;
- res = send_file(req, filetosend, &file_stat);
+ res = send_file(req, filetosend);
if (res != ESP_OK)
return res;
/* Respond with an empty chunk to signal HTTP response completion */
httpd_resp_send_chunk(req, NULL, 0);
+
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("hello_main_handler - Stop");
+#endif
+
return ESP_OK;
}
esp_err_t img_tmp_handler(httpd_req_t *req)
{
char filepath[50];
- struct stat file_stat;
printf("uri: %s\n", req->uri);
char *base_path = (char*) req->user_ctx;
std::string filetosend(base_path);
const char *filename = get_path_from_uri(filepath, base_path,
- req->uri + sizeof("/img_tmp") - 1, sizeof(filepath));
+ req->uri + sizeof("/img_tmp/") - 1, sizeof(filepath));
printf("1 uri: %s, filename: %s, filepath: %s\n", req->uri, filename, filepath);
filetosend = filetosend + "/img_tmp/" + std::string(filename);
printf("File to upload: %s\n", filetosend.c_str());
- if (!filename) {
- ESP_LOGE(TAG, "Filename is too long");
- /* Respond with 500 Internal Server Error */
- httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Filename too long");
- return ESP_FAIL;
- }
- if (stat(filetosend.c_str(), &file_stat) == -1) {
- /* If file not present on SPIFFS check if URI
- * corresponds to one of the hardcoded paths */
- ESP_LOGE(TAG, "Failed to stat file : %s", filetosend.c_str());
- /* Respond with 404 Not Found */
- httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File does not exist");
- return ESP_FAIL;
- }
-
- esp_err_t res = send_file(req, filetosend, &file_stat);
+ esp_err_t res = send_file(req, filetosend);
if (res != ESP_OK)
return res;
@@ -244,8 +242,54 @@ esp_err_t img_tmp_handler(httpd_req_t *req)
return ESP_OK;
}
+esp_err_t img_tmp_virtual_handler(httpd_req_t *req)
+{
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("img_tmp_virtual_handler - Start");
+#endif
+
+ char filepath[50];
+
+ printf("uri: %s\n", req->uri);
+
+ char *base_path = (char*) req->user_ctx;
+ std::string filetosend(base_path);
+
+ const char *filename = get_path_from_uri(filepath, base_path,
+ req->uri + sizeof("/img_tmp/") - 1, sizeof(filepath));
+ printf("1 uri: %s, filename: %s, filepath: %s\n", req->uri, filename, filepath);
+
+ filetosend = std::string(filename);
+ printf("File to upload: %s\n", filetosend.c_str());
+
+ if (filetosend == "raw.jpg")
+ {
+ return GetRawJPG(req);
+ }
+
+ esp_err_t zw = GetJPG(filetosend, req);
+
+ if (zw == ESP_OK)
+ return ESP_OK;
+
+ // File wird nicht intern bereit gestellt --> klassischer weg:
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("img_tmp_virtual_handler - Done");
+#endif
+
+ return img_tmp_handler(req);
+}
+
+
+
+
+
esp_err_t sysinfo_handler(httpd_req_t *req)
{
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("sysinfo_handler - Start");
+#endif
+
const char* resp_str;
std::string zw;
std::string cputemp = std::to_string(temperatureRead());
@@ -279,7 +323,11 @@ esp_err_t sysinfo_handler(httpd_req_t *req)
httpd_resp_set_type(req, "application/json");
httpd_resp_send(req, resp_str, strlen(resp_str));
/* Respond with an empty chunk to signal HTTP response completion */
- httpd_resp_send_chunk(req, NULL, 0);
+ httpd_resp_send_chunk(req, NULL, 0);
+
+#ifdef DEBUG_DETAIL_ON
+ LogFile.WriteHeapInfo("sysinfo_handler - Done");
+#endif
return ESP_OK;
}
@@ -314,7 +362,7 @@ void register_server_main_uri(httpd_handle_t server, const char *base_path)
httpd_uri_t img_tmp_handle = {
.uri = "/img_tmp/*", // Match all URIs of type /path/to/file
.method = HTTP_GET,
- .handler = img_tmp_handler,
+ .handler = img_tmp_virtual_handler,
.user_ctx = (void*) base_path // Pass server data as context
};
httpd_register_uri_handler(server, &img_tmp_handle);
diff --git a/code/main/server_main.h b/code/main/server_main.h
index 16a851ed..e4f75b4c 100644
--- a/code/main/server_main.h
+++ b/code/main/server_main.h
@@ -22,9 +22,4 @@ httpd_handle_t start_webserver(void);
void register_server_main_uri(httpd_handle_t server, const char *base_path);
-
-//void disconnect_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data);
-//void connect_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data);
-
-
#endif
diff --git a/code/main/version.cpp b/code/main/version.cpp
index 20df4b18..b1155d92 100644
--- a/code/main/version.cpp
+++ b/code/main/version.cpp
@@ -1,4 +1,4 @@
-const char* GIT_REV="bcdd0c6";
+const char* GIT_REV="0e36010";
const char* GIT_TAG="";
-const char* GIT_BRANCH="master";
-const char* BUILD_TIME="2020-12-06 19:32";
\ No newline at end of file
+const char* GIT_BRANCH="rolling";
+const char* BUILD_TIME="2021-01-02 08:39";
\ No newline at end of file
diff --git a/code/platformio.ini b/code/platformio.ini
index 43ce1528..9aa203f6 100644
--- a/code/platformio.ini
+++ b/code/platformio.ini
@@ -39,6 +39,7 @@ lib_deps =
jomjol_time_sntp
jomjol_logfile
jomjol_mqtt
+ jomjol_controlGPIO
monitor_speed = 115200
diff --git a/code/sdkconfig b/code/sdkconfig
index dd11c44e..30ad0482 100644
--- a/code/sdkconfig
+++ b/code/sdkconfig
@@ -173,7 +173,95 @@ CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1
CONFIG_BT_RESERVE_DRAM=0
# end of Bluetooth
-# CONFIG_BLE_MESH is not set
+CONFIG_BLE_MESH=y
+CONFIG_BLE_MESH_HCI_5_0=y
+# CONFIG_BLE_MESH_ALLOC_FROM_PSRAM_FIRST is not set
+# CONFIG_BLE_MESH_FAST_PROV is not set
+# CONFIG_BLE_MESH_NODE is not set
+# CONFIG_BLE_MESH_PROVISIONER is not set
+CONFIG_BLE_MESH_PROV=y
+CONFIG_BLE_MESH_PB_ADV=y
+# CONFIG_BLE_MESH_PB_GATT is not set
+CONFIG_BLE_MESH_PROXY=y
+# CONFIG_BLE_MESH_GATT_PROXY_CLIENT is not set
+CONFIG_BLE_MESH_NET_BUF_POOL_USAGE=y
+# CONFIG_BLE_MESH_SETTINGS is not set
+CONFIG_BLE_MESH_SUBNET_COUNT=3
+CONFIG_BLE_MESH_APP_KEY_COUNT=3
+CONFIG_BLE_MESH_MODEL_KEY_COUNT=3
+CONFIG_BLE_MESH_MODEL_GROUP_COUNT=3
+CONFIG_BLE_MESH_LABEL_COUNT=3
+CONFIG_BLE_MESH_CRPL=10
+CONFIG_BLE_MESH_MSG_CACHE_SIZE=10
+CONFIG_BLE_MESH_ADV_BUF_COUNT=60
+# CONFIG_BLE_MESH_SUPPORT_BLE_ADV is not set
+CONFIG_BLE_MESH_IVU_DIVIDER=4
+CONFIG_BLE_MESH_TX_SEG_MSG_COUNT=1
+CONFIG_BLE_MESH_RX_SEG_MSG_COUNT=1
+CONFIG_BLE_MESH_RX_SDU_MAX=384
+CONFIG_BLE_MESH_TX_SEG_MAX=32
+# CONFIG_BLE_MESH_FRIEND is not set
+# CONFIG_BLE_MESH_NO_LOG is not set
+
+#
+# BLE Mesh STACK DEBUG LOG LEVEL
+#
+# CONFIG_BLE_MESH_TRACE_LEVEL_NONE is not set
+# CONFIG_BLE_MESH_TRACE_LEVEL_ERROR is not set
+CONFIG_BLE_MESH_TRACE_LEVEL_WARNING=y
+# CONFIG_BLE_MESH_TRACE_LEVEL_INFO is not set
+# CONFIG_BLE_MESH_TRACE_LEVEL_DEBUG is not set
+# CONFIG_BLE_MESH_TRACE_LEVEL_VERBOSE is not set
+CONFIG_BLE_MESH_STACK_TRACE_LEVEL=2
+# end of BLE Mesh STACK DEBUG LOG LEVEL
+
+#
+# BLE Mesh NET BUF DEBUG LOG LEVEL
+#
+# CONFIG_BLE_MESH_NET_BUF_TRACE_LEVEL_NONE is not set
+# CONFIG_BLE_MESH_NET_BUF_TRACE_LEVEL_ERROR is not set
+CONFIG_BLE_MESH_NET_BUF_TRACE_LEVEL_WARNING=y
+# CONFIG_BLE_MESH_NET_BUF_TRACE_LEVEL_INFO is not set
+# CONFIG_BLE_MESH_NET_BUF_TRACE_LEVEL_DEBUG is not set
+# CONFIG_BLE_MESH_NET_BUF_TRACE_LEVEL_VERBOSE is not set
+CONFIG_BLE_MESH_NET_BUF_TRACE_LEVEL=2
+# end of BLE Mesh NET BUF DEBUG LOG LEVEL
+
+CONFIG_BLE_MESH_CLIENT_MSG_TIMEOUT=4000
+
+#
+# Support for BLE Mesh Client Models
+#
+# CONFIG_BLE_MESH_CFG_CLI is not set
+# CONFIG_BLE_MESH_HEALTH_CLI is not set
+# CONFIG_BLE_MESH_GENERIC_ONOFF_CLI is not set
+# CONFIG_BLE_MESH_GENERIC_LEVEL_CLI is not set
+# CONFIG_BLE_MESH_GENERIC_DEF_TRANS_TIME_CLI is not set
+# CONFIG_BLE_MESH_GENERIC_POWER_ONOFF_CLI is not set
+# CONFIG_BLE_MESH_GENERIC_POWER_LEVEL_CLI is not set
+# CONFIG_BLE_MESH_GENERIC_BATTERY_CLI is not set
+# CONFIG_BLE_MESH_GENERIC_LOCATION_CLI is not set
+# CONFIG_BLE_MESH_GENERIC_PROPERTY_CLI is not set
+# CONFIG_BLE_MESH_SENSOR_CLI is not set
+# CONFIG_BLE_MESH_TIME_CLI is not set
+# CONFIG_BLE_MESH_SCENE_CLI is not set
+# CONFIG_BLE_MESH_SCHEDULER_CLI is not set
+# CONFIG_BLE_MESH_LIGHT_LIGHTNESS_CLI is not set
+# CONFIG_BLE_MESH_LIGHT_CTL_CLI is not set
+# CONFIG_BLE_MESH_LIGHT_HSL_CLI is not set
+# CONFIG_BLE_MESH_LIGHT_XYL_CLI is not set
+# CONFIG_BLE_MESH_LIGHT_LC_CLI is not set
+# end of Support for BLE Mesh Client Models
+
+# CONFIG_BLE_MESH_IV_UPDATE_TEST is not set
+
+#
+# BLE Mesh specific test option
+#
+# CONFIG_BLE_MESH_SELF_TEST is not set
+# CONFIG_BLE_MESH_SHELL is not set
+# CONFIG_BLE_MESH_DEBUG is not set
+# end of BLE Mesh specific test option
#
# CoAP Configuration
@@ -537,8 +625,8 @@ CONFIG_FATFS_MAX_LFN=255
CONFIG_FATFS_API_ENCODING_ANSI_OEM=y
# CONFIG_FATFS_API_ENCODING_UTF_16 is not set
# CONFIG_FATFS_API_ENCODING_UTF_8 is not set
-CONFIG_FATFS_FS_LOCK=5
-CONFIG_FATFS_TIMEOUT_MS=10000
+CONFIG_FATFS_FS_LOCK=10
+CONFIG_FATFS_TIMEOUT_MS=5000
CONFIG_FATFS_PER_FILE_CACHE=y
CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y
# end of FAT Filesystem support
@@ -965,7 +1053,7 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
#
# Virtual file system
#
-CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
+# CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT is not set
CONFIG_VFS_SUPPORT_TERMIOS=y
#
@@ -1166,6 +1254,6 @@ CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set
-CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
+# CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT is not set
CONFIG_SUPPORT_TERMIOS=y
# End of deprecated options
diff --git a/code/sdkconfig.old b/code/sdkconfig.old
index 88827b07..f8a0f2c5 100644
--- a/code/sdkconfig.old
+++ b/code/sdkconfig.old
@@ -83,11 +83,11 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
-CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
-# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
+# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
+CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
-CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
+CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
CONFIG_ESPTOOLPY_BEFORE_RESET=y
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
@@ -315,8 +315,8 @@ CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y
CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4
# CONFIG_ESP32_ULP_COPROC_ENABLED is not set
CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
-# CONFIG_ESP32_PANIC_PRINT_HALT is not set
-CONFIG_ESP32_PANIC_PRINT_REBOOT=y
+CONFIG_ESP32_PANIC_PRINT_HALT=y
+# CONFIG_ESP32_PANIC_PRINT_REBOOT is not set
# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set
# CONFIG_ESP32_PANIC_GDBSTUB is not set
CONFIG_ESP32_DEBUG_OCDAWARE=y
@@ -537,8 +537,8 @@ CONFIG_FATFS_MAX_LFN=255
CONFIG_FATFS_API_ENCODING_ANSI_OEM=y
# CONFIG_FATFS_API_ENCODING_UTF_16 is not set
# CONFIG_FATFS_API_ENCODING_UTF_8 is not set
-CONFIG_FATFS_FS_LOCK=5
-CONFIG_FATFS_TIMEOUT_MS=10000
+CONFIG_FATFS_FS_LOCK=10
+CONFIG_FATFS_TIMEOUT_MS=5000
CONFIG_FATFS_PER_FILE_CACHE=y
CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y
# end of FAT Filesystem support
@@ -965,7 +965,7 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
#
# Virtual file system
#
-CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
+# CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT is not set
CONFIG_VFS_SUPPORT_TERMIOS=y
#
@@ -1166,6 +1166,6 @@ CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set
-CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
+# CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT is not set
CONFIG_SUPPORT_TERMIOS=y
# End of deprecated options
diff --git a/code/version.cpp b/code/version.cpp
index 20df4b18..b1155d92 100644
--- a/code/version.cpp
+++ b/code/version.cpp
@@ -1,4 +1,4 @@
-const char* GIT_REV="bcdd0c6";
+const char* GIT_REV="0e36010";
const char* GIT_TAG="";
-const char* GIT_BRANCH="master";
-const char* BUILD_TIME="2020-12-06 19:32";
\ No newline at end of file
+const char* GIT_BRANCH="rolling";
+const char* BUILD_TIME="2021-01-02 08:39";
\ No newline at end of file
diff --git a/firmware/bootloader.bin b/firmware/bootloader.bin
index ce3a6d8f..df78ead7 100644
Binary files a/firmware/bootloader.bin and b/firmware/bootloader.bin differ
diff --git a/firmware/firmware.bin b/firmware/firmware.bin
index 8a751444..2dc60cb9 100644
Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ
diff --git a/firmware/html.zip b/firmware/html.zip
index 9d1ae20c..70151534 100644
Binary files a/firmware/html.zip and b/firmware/html.zip differ
diff --git a/sd-card/config/config.ini b/sd-card/config/config.ini
index a7e80a44..b4c1c631 100644
--- a/sd-card/config/config.ini
+++ b/sd-card/config/config.ini
@@ -14,7 +14,7 @@ SearchFieldY = 20
[Digits]
-Model = /config/dig0720s1.tflite
+Model = /config/dig0721s1.tflite
;LogImageLocation = /log/digit
;LogfileRetentionInDays = 3
ModelInputSize = 20 32
@@ -39,13 +39,13 @@ PreValueAgeStartup = 720
AllowNegativeRates = false
MaxRateValue = 0.1
ErrorMessage = true
-CheckDigitIncreaseConsistency = true
+CheckDigitIncreaseConsistency = false
[MQTT]
-Uri = mqtt://IP-ADRESS:1883
-Topic = wasserzaehler/zaehlerstand
-TopicError = wasserzaehler/error
-ClientID = wasser
+;Uri = mqtt://IP-ADRESS:1883
+;Topic = wasserzaehler/zaehlerstand
+;TopicError = wasserzaehler/error
+;ClientID = wasser
;user = USERNAME
;password = PASSWORD
@@ -59,6 +59,7 @@ LogfileRetentionInDays = 3
[System]
TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
+;TimeServer = fritz.box
SetupMode = true
[Ende]
\ No newline at end of file
diff --git a/sd-card/config/dig0710s3.tflite b/sd-card/config/dig0710s3.tflite
deleted file mode 100644
index db7aaf1c..00000000
Binary files a/sd-card/config/dig0710s3.tflite and /dev/null differ
diff --git a/sd-card/config/dig0720s1.tflite b/sd-card/config/dig0720s1.tflite
deleted file mode 100644
index e0325e91..00000000
Binary files a/sd-card/config/dig0720s1.tflite and /dev/null differ
diff --git a/sd-card/config/dig0721s1.tflite b/sd-card/config/dig0721s1.tflite
new file mode 100644
index 00000000..f535bfb9
Binary files /dev/null and b/sd-card/config/dig0721s1.tflite differ
diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html
index 1b995808..437cc01a 100644
--- a/sd-card/html/edit_config_param.html
+++ b/sd-card/html/edit_config_param.html
@@ -61,7 +61,7 @@ textarea {
-
+
LogImageLocation
@@ -75,7 +75,7 @@ textarea {
-
+
LogfileRetentionInDays
@@ -123,7 +123,7 @@ textarea {
VGA
- SVGA
+ QVGA
@@ -538,7 +538,7 @@ textarea {
-
+
LogfileRetentionInDays
@@ -556,7 +556,7 @@ textarea {
-
+
TimeZone
@@ -570,16 +570,16 @@ textarea {
-
-
-
- TimeUpdateIntervall
+
-
+ TimeServer
+
+
+
- Intervall for synchronizing the time with the time server (in hours)
+ Time server to synchronize system time (default: "pool.ntp.org" - used if nothing is specified)
@@ -717,7 +717,7 @@ function UpdateInput() {
WriteParameter(param, "Debug", "LogfileRetentionInDays", true);
WriteParameter(param, "System", "TimeZone", true);
- WriteParameter(param, "System", "TimeUpdateIntervall", true);
+ WriteParameter(param, "System", "TimeServer", true);
}
function WriteConfig(){
@@ -731,13 +731,13 @@ function WriteConfig(){
ReadParameter(param, "Alignment", "SearchFieldY", false);
ReadParameter(param, "Digits", "Model", false);
- ReadParameter(param, "Digits", "LogImageLocation", false);
- ReadParameter(param, "Digits", "LogfileRetentionInDays", false);
+ ReadParameter(param, "Digits", "LogImageLocation", true);
+ ReadParameter(param, "Digits", "LogfileRetentionInDays", true);
ReadParameter(param, "Digits", "ModelInputSize", false, false, 2);
ReadParameter(param, "Analog", "Model", false);
- ReadParameter(param, "Analog", "LogImageLocation", false);
- ReadParameter(param, "Analog", "LogfileRetentionInDays", false);
+ ReadParameter(param, "Analog", "LogImageLocation", true);
+ ReadParameter(param, "Analog", "LogfileRetentionInDays", true);
ReadParameter(param, "Analog", "ModelInputSize", false, false, 2);
ReadParameter(param, "PostProcessing", "DecimalShift", true);
@@ -762,7 +762,7 @@ function WriteConfig(){
ReadParameter(param, "Debug", "LogfileRetentionInDays", true);
ReadParameter(param, "System", "TimeZone", true);
- ReadParameter(param, "System", "TimeUpdateIntervall", true);
+ ReadParameter(param, "System", "TimeServer", true);
FormatDecimalValue(param, "PostProcessing", "MaxRateValue");
diff --git a/sd-card/html/edit_reference.html b/sd-card/html/edit_reference.html
index 34e02678..0ea705dd 100644
--- a/sd-card/html/edit_reference.html
+++ b/sd-card/html/edit_reference.html
@@ -87,7 +87,7 @@ table {
}
function loadRawImage(){
- url = basepath + "/fileserver/img_tmp/raw.jpg" + "?session=" + Math.floor((Math.random() * 1000000) + 1);
+ url = basepath + "/img_tmp/raw.jpg" + "?session=" + Math.floor((Math.random() * 1000000) + 1);
document.getElementById("finerotate").value = 0;
document.getElementById("prerotateangle").value = getPreRotate();
document.getElementById("mirror").checked = getMirror();
diff --git a/sd-card/html/gethost.js b/sd-card/html/gethost.js
index 90d993d7..80ae6d85 100644
--- a/sd-card/html/gethost.js
+++ b/sd-card/html/gethost.js
@@ -7,9 +7,11 @@ function getbasepath(){
var host = window.location.hostname;
if ((host == "127.0.0.1") || (host == "localhost"))
{
- host = "http://192.168.178.26"; // jomjol interner test
+ host = "http://192.168.2.118"; // jomjol interner test
+// host = "http://192.168.178.26"; // jomjol interner test
// host = "http://192.168.178.22"; // jomjol interner Real
// host = "."; // jomjol interner localhost
+
}
else
{
diff --git a/sd-card/html/readconfig.js b/sd-card/html/readconfig.js
index e1164b02..3db248ba 100644
--- a/sd-card/html/readconfig.js
+++ b/sd-card/html/readconfig.js
@@ -350,7 +350,7 @@ function GetReferenceSize(name){
function ZerlegeZeile(input)
{
var Output = Array(0);
- delimiter = " =,";
+ delimiter = " =,\r";
input = trim(input, delimiter);
var pos = findDelimiterPos(input, delimiter);
diff --git a/sd-card/html/readconfigparam.js b/sd-card/html/readconfigparam.js
index ddd5903e..9c31994d 100644
--- a/sd-card/html/readconfigparam.js
+++ b/sd-card/html/readconfigparam.js
@@ -72,9 +72,9 @@ function ParseConfig() {
var catname = "System";
param[catname] = new Object();
ParamAddValue(param, catname, "TimeZone");
+ ParamAddValue(param, catname, "TimeServer");
ParamAddValue(param, catname, "AutoAdjustSummertime");
- ParamAddValue(param, catname, "TimeUpdateIntervall");
- ParamAddValue(param, catname, "SetupMode");
+ ParamAddValue(param, catname, "SetupMode");
while (aktline < config_split.length){
if (config_split[aktline].trim().toUpperCase() == "[MAKEIMAGE]") {
@@ -149,6 +149,7 @@ function ParseConfigParamSystem(_aktline){
var linesplit = ZerlegeZeile(input, " =");
ParamExtractValue(param, linesplit, catname, "TimeZone", _aktline, isCom);
+ ParamExtractValue(param, linesplit, catname, "TimeServer", _aktline, isCom);
ParamExtractValue(param, linesplit, catname, "AutoAdjustSummertime", _aktline, isCom);
ParamExtractValue(param, linesplit, catname, "TimeUpdateIntervall", _aktline, isCom);
ParamExtractValue(param, linesplit, catname, "SetupMode", _aktline, isCom);
diff --git a/sd-card/html/version.txt b/sd-card/html/version.txt
index 4a36342f..4d54dadd 100644
--- a/sd-card/html/version.txt
+++ b/sd-card/html/version.txt
@@ -1 +1 @@
-3.0.0
+4.0.2
diff --git a/sd-card/log/digit/10/leer.txt b/sd-card/log/digit/10/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/2/leer.txt b/sd-card/log/digit/2/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/3/leer.txt b/sd-card/log/digit/3/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/4/leer.txt b/sd-card/log/digit/4/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/5/leer.txt b/sd-card/log/digit/5/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/6/leer.txt b/sd-card/log/digit/6/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/7/leer.txt b/sd-card/log/digit/7/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/8/leer.txt b/sd-card/log/digit/8/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/9/leer.txt b/sd-card/log/digit/9/leer.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/sd-card/log/digit/0/leer.txt b/sd-card/log/digit/leer.txt
similarity index 100%
rename from sd-card/log/digit/0/leer.txt
rename to sd-card/log/digit/leer.txt
diff --git a/sd-card/log/digit/1/leer.txt b/sd-card/log/message/leer.txt
similarity index 100%
rename from sd-card/log/digit/1/leer.txt
rename to sd-card/log/message/leer.txt
diff --git a/sd-card/wlan.ini b/sd-card/wlan.ini
index fac2d609..60073814 100644
--- a/sd-card/wlan.ini
+++ b/sd-card/wlan.ini
@@ -1,4 +1,12 @@
ssid = "SSID"
password = "PASSWORD"
hostname = "watermeter"
-;hostname is optional
\ No newline at end of file
+;hostname is optional
+
+;if you want to use a fixed IP you need to specify the following 3 parameters (ip, gateway, netmask) with IP4-Addresses "123.456.789.012"
+;ip = "IP4-ADDRESS"
+;gateway = "IP4-ADDRESS"
+;netmask = "255.255.255.0"
+
+;in some cases you want to specify the DNS server as well (especially, if it is not identical to the gateway - this is optional for a fixed IP
+;dns = "IP4-ADDRESS"
\ No newline at end of file