Updated shit
All checks were successful
Test compiling project / test (push) Successful in 2m21s

This commit is contained in:
2025-02-17 00:12:50 +01:00
parent 7c4dd280c2
commit 3b1ab2e9e9
9 changed files with 123 additions and 32 deletions

View File

@@ -37,30 +37,16 @@ extern "C" int rom_phy_get_vdd33();
AsyncWebServer server(80);
#define FORMAT_LITTLEFS_IF_FAILED true
void update_started() {
Log.verbose("OTA Update started");
}
void update_finished() {
Log.verbose("OTA Update finished");
}
void update_progress(int cur, int total) {
Log.verbose("OTA Update progress: %d/%d", cur, total);
}
void update_error(int err) {
Log.error("OTA Update error: %d", err);
}
void run_ota(void* parameter) {
OTA ota("https://iot.tobiasmaier.me/firmware/waterlevel", "1.1.1", "INA233");
Firmware fw = ota.getLatestVersionOnServer();
Log.verbose("we are done");
Serial.printf("Firmware Info: Valid: %d, Version: %d.%d.%d, URL: %s\n", fw.valid, fw.version.major, fw.version.minor, fw.version.patch, fw.url.c_str());
Log.verbose("Error message: %s", fw.error.c_str());
ota.run_ota_update(fw.url, update_started, update_finished, update_progress, update_error);
// OTA ota("https://iot.tobiasmaier.me/firmware/waterlevel", "1.1.1", "INA233");
// Firmware fw = ota.getLatestVersionOnServer();
// Log.verbose("we are done");
// Serial.printf("Firmware Info: Valid: %d, Version: %d.%d.%d, URL: %s\n", fw.valid, fw.version.major, fw.version.minor, fw.version.patch, fw.url.c_str());
// Log.verbose("Error message: %s", fw.error.c_str());
// ota.run_ota_update(fw.url, update_started, update_finished, update_progress, update_error);
vTaskDelete(NULL);
}
@@ -234,6 +220,7 @@ void setup()
xTaskCreate(display_task, "DisplayTask", 10000, NULL, 1, NULL);
xTaskCreate(read_sensor_task, "ReadSensorTask", 2048, NULL, 1, NULL);
xTaskCreate(collect_internal_telemetry_task, "InternalTelemetryTask", 2048, NULL, 1, NULL);
xTaskCreate(check_update_task, "CheckUpdateTask", 1024 * 8, NULL, 1, NULL);
}
void loop()