diff --git a/lib/fetchOTA/fetchOTA.cpp b/lib/fetchOTA/fetchOTA.cpp index 8b08b54..5f14f99 100644 --- a/lib/fetchOTA/fetchOTA.cpp +++ b/lib/fetchOTA/fetchOTA.cpp @@ -5,6 +5,7 @@ #include "Arduino.h" #include #include +#include #include #include #include diff --git a/platformio.ini b/platformio.ini index 9902378..ef31b24 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,42 +11,39 @@ [platformio] default_envs = ESP32_INA233, ESP32_INA226 -[env:ESP32_INA233] +[env] platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.32/platform-espressif32.zip board = esp32dev framework = arduino monitor_speed = 115200 ; monitor_filters = esp32_exception_decoder -lib_deps = - esp32async/AsyncTCP @ ~3.4.9 - esp32async/ESPAsyncWebServer @ ~3.8.1 - robtillaart/INA226@ ~0.6.4 - bblanchon/ArduinoJson@^6.21.3 - x385832/Elog@~2.0.10 - INA233 - fetchOTA board_build.partitions = min_spiffs.csv +build_flags = -Wall -Wextra -DUSE_INA226 -fexceptions + +[common_esp32_libs] +lib_deps = + esp32async/AsyncTCP @ ~3.4.9 + esp32async/ESPAsyncWebServer @ ~3.8.1 + robtillaart/INA226@ ~0.6.4 + bblanchon/ArduinoJson@^6.21.3 + x385832/Elog@~2.0.10 + fetchOTA + +[env:ESP32_INA233] +extends = common_esp32_libs +lib_deps = + ${common_esp32_libs.lib_deps} + INA233 upload_protocol = espota upload_port = 192.168.5.205 -build_flags = -Wall -Wextra -DLOGGING_SPIFFS_DISABLE -DLOGGING_SD_DISABLE -DELOG_SYSLOG_ENABLE -fexceptions [env:ESP32_INA226] -platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.32/platform-espressif32.zip -board = esp32dev -framework = arduino -monitor_speed = 115200 -; monitor_filters = esp32_exception_decoder +extends = common_esp32_libs lib_deps = - esp32async/AsyncTCP @ ~3.4.9 - esp32async/ESPAsyncWebServer @ ~3.8.1 + ${common_esp32_libs.lib_deps} robtillaart/INA226@ ~0.6.4 - bblanchon/ArduinoJson@^6.21.3 - x385832/Elog@~2.0.10 - fetchOTA -board_build.partitions = min_spiffs.csv upload_protocol = espota upload_port = 192.168.6.45 -build_flags = -Wall -Wextra -DUSE_INA226 -DLOGGING_SPIFFS_DISABLE -DLOGGING_SD_DISABLE -DELOG_SYSLOG_ENABLE -fexceptions [env:native] platform = native diff --git a/src/global_data/defines.h b/src/global_data/defines.h index 4401756..308030c 100644 --- a/src/global_data/defines.h +++ b/src/global_data/defines.h @@ -7,7 +7,7 @@ #define water_level_min_key "water_level_min" #define water_level_max_key "water_level_max" #define water_volume_key "water_volume" -#define current_software_version Version{1, 3, 0} +#define current_software_version Version{2, 0, 0} #define REQUIRED_SPIFFS_VERSION Version{8, 0, 0} #define RESISTOR_VALUE 4 \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 0fcad25..ffa18e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -203,10 +203,6 @@ void setup() xTaskCreate(ethernet_task, "EthernetTask", 4096, NULL, 1, NULL); xTaskCreate(wifi_task, "WiFiTask", 10000, NULL, 1, NULL); - esp_netif_t* eth = esp_netif_get_handle_from_ifkey("ETH_DEF"); - esp_netif_t* wifi = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"); - - if (ETH.linkUp()){ LOG(ELOG_LEVEL_DEBUG, "Ethernet connected, starting update checker"); xTaskCreate(check_update_task, "CheckUpdateTask", 1024 * 8, NULL, 1, NULL); diff --git a/src/tools/tools.cpp b/src/tools/tools.cpp index cf021c0..8df1dc5 100644 --- a/src/tools/tools.cpp +++ b/src/tools/tools.cpp @@ -65,9 +65,9 @@ void check_update_task(void* parameter) { ota_status.current_version = current_software_version; ota_status.update_progress = -1; #ifdef USE_INA226 - OTA ota("https://iot.tobiasmaier.me/firmware/waterlevel", current_software_version, "INA226"); + OTA ota("https://iot.tobiasmaier.me/firmware/waterlevel", current_software_version, "INA226REV2"); #else - OTA ota("https://iot.tobiasmaier.me/firmware/waterlevel", current_software_version, "INA233"); + OTA ota("https://iot.tobiasmaier.me/firmware/waterlevel", current_software_version, "INA233REV2"); #endif OTA spiffs_fs("https://iot.tobiasmaier.me/filesystem/waterlevel", REQUIRED_SPIFFS_VERSION, "generic");