This commit is contained in:
27
src/main.cpp
27
src/main.cpp
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user