diff --git a/README.md b/README.md index ee48d4e3..d956ba21 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,23 @@ In other cases you can contact the developer via email: ::iterator it = gpioMap->begin(); it != gpioMap->end(); ++it) { it->second->init(); @@ -289,8 +294,12 @@ bool GpioHandler::readConfig() while ((!configFile.GetNextParagraph(line, disabledLine, eof) || (line.compare("[GPIO]") != 0)) && !disabledLine && !eof) {} if (eof) return false; + + _isEnabled = !disabledLine; + + if (!_isEnabled) + return false; - _isEnabled = true; std::string mainTopicMQTT = ""; bool registerISR = false; while (configFile.getNextLine(&line, disabledLine, eof) && !configFile.isNewParagraph(line)) diff --git a/code/components/jomjol_fileserver_ota/server_ota.cpp b/code/components/jomjol_fileserver_ota/server_ota.cpp index 355aac7c..39f4d7e9 100644 --- a/code/components/jomjol_fileserver_ota/server_ota.cpp +++ b/code/components/jomjol_fileserver_ota/server_ota.cpp @@ -62,14 +62,14 @@ static void infinite_loop(void) -static bool ota_example_task(std::string fn) +static bool ota_update_task(std::string fn) { esp_err_t err; /* update handle : set by esp_ota_begin(), must be freed via esp_ota_end() */ esp_ota_handle_t update_handle = 0 ; const esp_partition_t *update_partition = NULL; - ESP_LOGI(TAGPARTOTA, "Starting OTA example"); + ESP_LOGI(TAGPARTOTA, "Starting OTA update"); const esp_partition_t *configured = esp_ota_get_boot_partition(); const esp_partition_t *running = esp_ota_get_running_partition(); @@ -378,7 +378,7 @@ esp_err_t handler_ota_update(httpd_req_t *req) KillTFliteTasks(); gpio_handler_deinit(); - if (ota_example_task(fn)) + if (ota_update_task(fn)) { resp_str = "Firmware Update Successfull!

You can restart now."; } diff --git a/code/main/main.cpp b/code/main/main.cpp index 23f55c15..145f862f 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -135,17 +135,6 @@ void task_NoSDBlink(void *pvParameter) vTaskDelete(NULL); //Delete this task if it exits from the loop above } -esp_err_t handler_gpio(httpd_req_t *req) -{ - gpio_handler_init(); - - char resp_str [30]; - sprintf(resp_str, "OK. freemem %u", esp_get_free_heap_size()); - httpd_resp_send(req, resp_str, strlen(resp_str)); - - return ESP_OK; -} - extern "C" void app_main(void) { printf("Do Reset Camera\n"); @@ -210,13 +199,6 @@ extern "C" void app_main(void) register_server_file_uri(server, "/sdcard"); register_server_ota_sdcard_uri(server); - httpd_uri_t camuri = { }; - camuri.method = HTTP_GET; - camuri.uri = "/test"; - camuri.handler = handler_gpio; - camuri.user_ctx = (void*)server; - httpd_register_uri_handler(server, &camuri); - gpio_handler_create(server); printf("vor reg server main\n"); diff --git a/firmware/firmware.bin b/firmware/firmware.bin index 1b2e720f..88f6a927 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/firmware/html.zip b/firmware/html.zip index 062a9562..ebedd9a6 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 7cbcc5ec..cad8a749 100644 --- a/sd-card/config/config.ini +++ b/sd-card/config/config.ini @@ -56,7 +56,7 @@ CheckDigitIncreaseConsistency = true ;password = PASSWORD ;[GPIO] -;MainTopicMQTT = watermeter2/GPIO +;MainTopicMQTT = wasserzaehler/GPIO ;IO0 = input disabled 10 false false ;IO1 = input disabled 10 false false ;IO3 = input disabled 10 false false