diff --git a/code/components/jomjol_fileserver_ota/server_help.cpp b/code/components/jomjol_fileserver_ota/server_help.cpp index 21648aa4..25ffbcc4 100644 --- a/code/components/jomjol_fileserver_ota/server_help.cpp +++ b/code/components/jomjol_fileserver_ota/server_help.cpp @@ -111,6 +111,8 @@ esp_err_t set_content_type_from_file(httpd_req_t *req, const char *filename) return httpd_resp_set_type(req, "image/jpeg"); } else if (IS_FILE_EXT(filename, ".ico")) { return httpd_resp_set_type(req, "image/x-icon"); + } else if (IS_FILE_EXT(filename, ".js")) { + return httpd_resp_set_type(req, "text/javascript"); } /* This is a limited set only */ /* For any other type always set as plain text */ diff --git a/code/components/jomjol_helper/Helper.cpp b/code/components/jomjol_helper/Helper.cpp index 07f7e7e0..d5479c31 100644 --- a/code/components/jomjol_helper/Helper.cpp +++ b/code/components/jomjol_helper/Helper.cpp @@ -83,17 +83,20 @@ FILE* OpenFileAndWait(const char* nm, const char* _mode, int _waitsec) printf("open config file %s in mode %s\n", nm, _mode); FILE *pfile = fopen(nm, _mode); +/* if (pfile == NULL) { TickType_t xDelay; xDelay = _waitsec * 1000 / portTICK_PERIOD_MS; - std::string zw = "File is locked: " + std::string(nm) + " - wait for " + std::to_string(_waitsec); + std::string zw = "File is locked: " + std::string(nm) + " - wait for " + std::to_string(_waitsec) + " seconds"; printf(zw.c_str()); printf("\n"); LogFile.WriteToFile(zw); vTaskDelay( xDelay ); pfile = fopen(nm, _mode); } +*/ + return pfile; } diff --git a/code/components/jomjol_wlan/connect_wlan.cpp b/code/components/jomjol_wlan/connect_wlan.cpp index 38cf3a3c..13d6f227 100644 --- a/code/components/jomjol_wlan/connect_wlan.cpp +++ b/code/components/jomjol_wlan/connect_wlan.cpp @@ -50,14 +50,14 @@ std::string std_hostname = "watermeter"; std::string ipadress = ""; std::string ssid = ""; -std::string getIPAddress() +std::string* getIPAddress() { - return ipadress; + return &ipadress; } -std::string getSSID() +std::string* getSSID() { - return ssid; + return &ssid; } diff --git a/code/components/jomjol_wlan/connect_wlan.h b/code/components/jomjol_wlan/connect_wlan.h index 29f9889a..7dc1b609 100644 --- a/code/components/jomjol_wlan/connect_wlan.h +++ b/code/components/jomjol_wlan/connect_wlan.h @@ -7,8 +7,8 @@ void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostna void wifi_init_sta(const char *_ssid, const char *_password, const char *_hostname); void wifi_init_sta(const char *_ssid, const char *_password); -std::string getIPAddress(); -std::string getSSID(); +std::string* getIPAddress(); +std::string* getSSID(); extern std::string hostname; extern std::string std_hostname; diff --git a/code/main/main.cpp b/code/main/main.cpp index 6353087c..9b2947fa 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -216,26 +216,5 @@ extern "C" void app_main(void) printf("vor dotautostart\n"); TFliteDoAutoStart(); - -////////////////////////// Test SmartLED Liberary ////////////////////////////////////////////// -/* - xDelay = 5000 / portTICK_PERIOD_MS; - printf("main: sleep for : %ldms\n", (long) xDelay); -// LogFile.WriteToFile("Startsequence 06"); - vTaskDelay( xDelay ); - - SmartLed leds( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer ); - - - leds[ 0 ] = Rgb{ 255, 0, 0 }; - leds[ 1 ] = Rgb{ 255, 255, 255 }; - leds.show(); - - vTaskDelay( xDelay ); - - leds[ 0 ] = Rgb{ 0, 0, 0 }; - leds[ 1 ] = Rgb{ 0, 0, 0 }; - leds.show(); -*/ } diff --git a/code/main/server_main.cpp b/code/main/server_main.cpp index e1150e1b..a180aa03 100644 --- a/code/main/server_main.cpp +++ b/code/main/server_main.cpp @@ -51,9 +51,7 @@ esp_err_t info_get_handler(httpd_req_t *req) if (_task.compare("GitBranch") == 0) { - std::string zw; - zw = std::string(libfive_git_branch()); - httpd_resp_sendstr_chunk(req, zw.c_str()); + httpd_resp_sendstr_chunk(req, libfive_git_branch()); httpd_resp_sendstr_chunk(req, NULL); return ESP_OK; } @@ -61,9 +59,7 @@ esp_err_t info_get_handler(httpd_req_t *req) if (_task.compare("GitTag") == 0) { - std::string zw; - zw = std::string(libfive_git_version()); - httpd_resp_sendstr_chunk(req, zw.c_str()); + httpd_resp_sendstr_chunk(req, libfive_git_version()); httpd_resp_sendstr_chunk(req, NULL); return ESP_OK; } @@ -72,36 +68,30 @@ esp_err_t info_get_handler(httpd_req_t *req) if (_task.compare("GitRevision") == 0) { - std::string zw; - zw = std::string(libfive_git_revision()); - httpd_resp_sendstr_chunk(req, zw.c_str()); + httpd_resp_sendstr_chunk(req, libfive_git_revision()); httpd_resp_sendstr_chunk(req, NULL); return ESP_OK; } if (_task.compare("BuildTime") == 0) { - std::string zw; - zw = std::string(build_time()); - httpd_resp_sendstr_chunk(req, zw.c_str()); + httpd_resp_sendstr_chunk(req, build_time()); httpd_resp_sendstr_chunk(req, NULL); return ESP_OK; } if (_task.compare("GitBaseBranch") == 0) { - std::string zw; - zw = std::string(git_base_branch()); - httpd_resp_sendstr_chunk(req, zw.c_str()); + httpd_resp_sendstr_chunk(req, git_base_branch()); httpd_resp_sendstr_chunk(req, NULL); return ESP_OK; } if (_task.compare("HTMLVersion") == 0) { - std::string zw; - zw = std::string(getHTMLversion()); - httpd_resp_sendstr_chunk(req, zw.c_str()); +// std::string zw; +// zw = std::string(getHTMLversion()); + httpd_resp_sendstr_chunk(req, getHTMLversion()); httpd_resp_sendstr_chunk(req, NULL); return ESP_OK; } @@ -117,18 +107,18 @@ esp_err_t info_get_handler(httpd_req_t *req) if (_task.compare("IP") == 0) { - std::string zw; - zw = std::string(getIPAddress()); - httpd_resp_sendstr_chunk(req, zw.c_str()); + std::string *zw; + zw = getIPAddress(); + httpd_resp_sendstr_chunk(req, zw->c_str()); httpd_resp_sendstr_chunk(req, NULL); return ESP_OK; } if (_task.compare("SSID") == 0) { - std::string zw; - zw = std::string(getSSID()); - httpd_resp_sendstr_chunk(req, zw.c_str()); + std::string *zw; + zw = getSSID(); + httpd_resp_sendstr_chunk(req, zw->c_str()); httpd_resp_sendstr_chunk(req, NULL); return ESP_OK; } @@ -142,28 +132,15 @@ 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); -#ifdef DEBUG_DETAIL_ON - LogFile.WriteHeapInfo("starttime_get_handler - Done"); -#endif - return ESP_OK; } @@ -217,12 +194,15 @@ esp_err_t hello_main_handler(httpd_req_t *req) } res = send_file(req, filetosend); + /* Respond with an empty chunk to signal HTTP response completion */ + httpd_resp_send_chunk(req, NULL, 0); + if (res != ESP_OK) return res; /* Respond with an empty chunk to signal HTTP response completion */ // httpd_resp_sendstr(req, ""); - httpd_resp_send_chunk(req, NULL, 0); +// httpd_resp_send_chunk(req, NULL, 0); #ifdef DEBUG_DETAIL_ON LogFile.WriteHeapInfo("hello_main_handler - Stop"); @@ -299,10 +279,6 @@ esp_err_t img_tmp_virtual_handler(httpd_req_t *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()); @@ -333,7 +309,6 @@ esp_err_t sysinfo_handler(httpd_req_t *req) }\ ]"; - resp_str = zw.c_str(); httpd_resp_set_type(req, "application/json"); @@ -341,10 +316,6 @@ esp_err_t sysinfo_handler(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("sysinfo_handler - Done"); -#endif - return ESP_OK; } @@ -401,7 +372,7 @@ httpd_handle_t start_webserver(void) httpd_handle_t server = NULL; httpd_config_t config = { }; - config.task_priority = tskIDLE_PRIORITY+5; + config.task_priority = tskIDLE_PRIORITY+1; // 20210924 --> vorher +5 config.stack_size = 32768; //20210921 --> vorher 32768 // bei 32k stürzt das Programm beim Bilderaufnehmen ab config.core_id = tskNO_AFFINITY; config.server_port = 80; @@ -411,15 +382,14 @@ httpd_handle_t start_webserver(void) config.max_resp_headers = 8; config.backlog_conn = 5; config.lru_purge_enable = true; // dadurch werden alte Verbindungen gekappt, falls neue benögt werden. - config.recv_wait_timeout = 30; // default: 5 - config.send_wait_timeout = 30; // default: 5 + config.recv_wait_timeout = 5; // default: 5 20210924 --> vorher 30 + config.send_wait_timeout = 5; // default: 5 20210924 --> vorher 30 config.global_user_ctx = NULL; config.global_user_ctx_free_fn = NULL; config.global_transport_ctx = NULL; config.global_transport_ctx_free_fn = NULL; config.open_fn = NULL; config.close_fn = NULL; - config.lru_purge_enable = true; // neu, um schlechte Serverbindung zu verhindern // config.uri_match_fn = NULL; config.uri_match_fn = httpd_uri_match_wildcard; diff --git a/code/main/version.cpp b/code/main/version.cpp index 0cef43b5..55c22f5e 100644 --- a/code/main/version.cpp +++ b/code/main/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="e2a4034"; +const char* GIT_REV="f15e5f0"; const char* GIT_TAG=""; const char* GIT_BRANCH="rolling"; -const char* BUILD_TIME="2021-09-23 18:31"; \ No newline at end of file +const char* BUILD_TIME="2021-09-24 19:25"; \ No newline at end of file diff --git a/code/main/version.h b/code/main/version.h index d066327f..498acfd6 100644 --- a/code/main/version.h +++ b/code/main/version.h @@ -42,21 +42,19 @@ const char* libfive_git_branch(void) return GIT_BRANCH; } -std::string getHTMLversion(void){ - - string line = ""; - + +char _char_getHTMLversion[20]="NaN\0"; + +const char* getHTMLversion(void){ FILE* pFile; string fn = FormatFileName("/sdcard/html/version.txt"); pFile = fopen(fn.c_str(), "r"); if (pFile == NULL) - return std::string("NAN"); + return _char_getHTMLversion; - char zw[1024]; - fgets(zw, 1024, pFile); - line = std::string(trim(zw)); + fgets(_char_getHTMLversion, 20, pFile); fclose(pFile); - return line; + return _char_getHTMLversion; } \ No newline at end of file diff --git a/code/version.cpp b/code/version.cpp index 81170a8c..55c22f5e 100644 --- a/code/version.cpp +++ b/code/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="e2a4034"; +const char* GIT_REV="f15e5f0"; const char* GIT_TAG=""; const char* GIT_BRANCH="rolling"; -const char* BUILD_TIME="2021-09-23 18:30"; \ No newline at end of file +const char* BUILD_TIME="2021-09-24 19:25"; \ No newline at end of file diff --git a/firmware/bootloader.bin b/firmware/bootloader.bin index eb309711..cd54c830 100644 Binary files a/firmware/bootloader.bin and b/firmware/bootloader.bin differ diff --git a/firmware/firmware.bin b/firmware/firmware.bin index 57d674de..32f791a8 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/firmware/html.zip b/firmware/html.zip index 35657b00..60a5860d 100644 Binary files a/firmware/html.zip and b/firmware/html.zip differ diff --git a/sd-card/html/edit_alignment.html b/sd-card/html/edit_alignment.html index ccee3ccd..0c286929 100644 --- a/sd-card/html/edit_alignment.html +++ b/sd-card/html/edit_alignment.html @@ -1,6 +1,7 @@ + Make Alignment diff --git a/sd-card/html/edit_analog.html b/sd-card/html/edit_analog.html index c2d63897..563f4c62 100644 --- a/sd-card/html/edit_analog.html +++ b/sd-card/html/edit_analog.html @@ -1,6 +1,7 @@ + Make Analog Alignment diff --git a/sd-card/html/edit_check.html b/sd-card/html/edit_check.html index 499ce6c5..46e52e71 100644 --- a/sd-card/html/edit_check.html +++ b/sd-card/html/edit_check.html @@ -1,6 +1,7 @@ + Check diff --git a/sd-card/html/edit_config.html b/sd-card/html/edit_config.html index b3cf9ec2..64330985 100644 --- a/sd-card/html/edit_config.html +++ b/sd-card/html/edit_config.html @@ -1,6 +1,7 @@ + Edit Config diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index a6bfe056..6af9aeb2 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -1,6 +1,7 @@ + Edit Config diff --git a/sd-card/html/edit_digits.html b/sd-card/html/edit_digits.html index e01b4a9e..01123482 100644 --- a/sd-card/html/edit_digits.html +++ b/sd-card/html/edit_digits.html @@ -1,6 +1,7 @@ + Make Digital Alignment diff --git a/sd-card/html/edit_explain_0.html b/sd-card/html/edit_explain_0.html index e1023a55..c1ee7248 100644 --- a/sd-card/html/edit_explain_0.html +++ b/sd-card/html/edit_explain_0.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/edit_explain_6.html b/sd-card/html/edit_explain_6.html index 7e67df4f..2a465bad 100644 --- a/sd-card/html/edit_explain_6.html +++ b/sd-card/html/edit_explain_6.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/edit_reference.html b/sd-card/html/edit_reference.html index 91a53dda..4cbbddc4 100644 --- a/sd-card/html/edit_reference.html +++ b/sd-card/html/edit_reference.html @@ -1,6 +1,7 @@ + Make Reference diff --git a/sd-card/html/explain_0.html b/sd-card/html/explain_0.html index 75f66304..d8bcdd81 100644 --- a/sd-card/html/explain_0.html +++ b/sd-card/html/explain_0.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/explain_1.html b/sd-card/html/explain_1.html index 6653c2aa..cebebd8d 100644 --- a/sd-card/html/explain_1.html +++ b/sd-card/html/explain_1.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/explain_2.html b/sd-card/html/explain_2.html index 976738ed..43f2f1a9 100644 --- a/sd-card/html/explain_2.html +++ b/sd-card/html/explain_2.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/explain_3.html b/sd-card/html/explain_3.html index ff1ae887..09a18c2d 100644 --- a/sd-card/html/explain_3.html +++ b/sd-card/html/explain_3.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/explain_4.html b/sd-card/html/explain_4.html index 862bfaf9..7a2a288e 100644 --- a/sd-card/html/explain_4.html +++ b/sd-card/html/explain_4.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/explain_5.html b/sd-card/html/explain_5.html index 8ae3bae0..e4e0782e 100644 --- a/sd-card/html/explain_5.html +++ b/sd-card/html/explain_5.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/explain_6.html b/sd-card/html/explain_6.html index a617db25..29e6e6bc 100644 --- a/sd-card/html/explain_6.html +++ b/sd-card/html/explain_6.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/index.html b/sd-card/html/index.html index acf38a3c..8064c51f 100644 --- a/sd-card/html/index.html +++ b/sd-card/html/index.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/index_configure.html b/sd-card/html/index_configure.html index 70187bef..090cae08 100644 --- a/sd-card/html/index_configure.html +++ b/sd-card/html/index_configure.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/ota_page.html b/sd-card/html/ota_page.html index c166d4ba..0a8abeab 100644 --- a/sd-card/html/ota_page.html +++ b/sd-card/html/ota_page.html @@ -1,6 +1,7 @@ + OTA Update diff --git a/sd-card/html/ota_page_v2.html b/sd-card/html/ota_page_v2.html index ce83a030..df65e95d 100644 --- a/sd-card/html/ota_page_v2.html +++ b/sd-card/html/ota_page_v2.html @@ -1,4 +1,6 @@ - + + + jomjol - AI on the edge diff --git a/sd-card/html/prevalue_set.html b/sd-card/html/prevalue_set.html index fa599f3b..ed83dc26 100644 --- a/sd-card/html/prevalue_set.html +++ b/sd-card/html/prevalue_set.html @@ -1,6 +1,7 @@ + Set PreValue diff --git a/sd-card/html/readconfigparam.js b/sd-card/html/readconfigparam.js index 0732cd26..14c17fa9 100644 --- a/sd-card/html/readconfigparam.js +++ b/sd-card/html/readconfigparam.js @@ -680,4 +680,4 @@ function CreateROI(_number, _type, _pos, _roinew, _x, _y, _dx, _dy){ NUMBERS[_indexnumber][_type].splice(_pos+1, 0, _ret); return ""; -} \ No newline at end of file +} diff --git a/sd-card/html/reboot_page.html b/sd-card/html/reboot_page.html index 3b924f2c..bc503c66 100644 --- a/sd-card/html/reboot_page.html +++ b/sd-card/html/reboot_page.html @@ -1,6 +1,7 @@ + Reboot diff --git a/sd-card/html/setup.html b/sd-card/html/setup.html index 0b9f67bf..5d207d07 100644 --- a/sd-card/html/setup.html +++ b/sd-card/html/setup.html @@ -1,6 +1,7 @@ + jomjol - AI on the edge diff --git a/sd-card/html/test.html b/sd-card/html/test.html index 5cd12021..560ed1cf 100644 --- a/sd-card/html/test.html +++ b/sd-card/html/test.html @@ -1,6 +1,7 @@ + diff --git a/sd-card/html/wasserzaehler_roi.html b/sd-card/html/wasserzaehler_roi.html index 61e6cd80..5a82b21f 100644 --- a/sd-card/html/wasserzaehler_roi.html +++ b/sd-card/html/wasserzaehler_roi.html @@ -1,6 +1,7 @@ + Overview