Cleanup + Bugfix
All checks were successful
Test project compilation / test (push) Successful in 3m43s
All checks were successful
Test project compilation / test (push) Successful in 3m43s
This commit is contained in:
@@ -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{2, 2, 0}
|
||||
#define REQUIRED_SPIFFS_VERSION Version{9, 0, 0}
|
||||
#define current_software_version Version{2, 5, 0}
|
||||
#define REQUIRED_SPIFFS_VERSION Version{10, 0, 0}
|
||||
|
||||
#define RESISTOR_VALUE 4
|
||||
@@ -51,7 +51,7 @@ void setup_api_endpoints(){
|
||||
request->send(200, "application/json", output);
|
||||
});
|
||||
|
||||
server.on("/ota_udpate_status", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
server.on("/ota_update_status", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
String output;
|
||||
serializeJson(build_ota_json(ota_status), output);
|
||||
request->send(200, "application/json", output);
|
||||
|
||||
@@ -33,6 +33,8 @@ void init_sensor(){
|
||||
ina_sensor.setBusVoltageConversionTime(7);
|
||||
ina_sensor.setShuntVoltageConversionTime(7);
|
||||
ina_sensor.setAverage(4);
|
||||
// 111 - Shunt + Bus continous
|
||||
ina_sensor.setMode(7);
|
||||
#else
|
||||
ina_sensor.begin(33, 32);
|
||||
ina_sensor.reset();
|
||||
@@ -52,7 +54,6 @@ void read_sensor_task(void* parameter)
|
||||
String chip_id = ina_sensor.get_device_model();
|
||||
LOG(ELOG_LEVEL_DEBUG, "Chip Model: %s", chip_id.c_str());
|
||||
#endif
|
||||
|
||||
float bus_voltage = ina_sensor.getBusVoltage();
|
||||
float shunt_voltage = ina_sensor.getShuntVoltage_mV() - zero_value;
|
||||
|
||||
|
||||
@@ -49,9 +49,11 @@ void update_started() {
|
||||
}
|
||||
|
||||
void update_finished() {
|
||||
LOG(ELOG_LEVEL_DEBUG, "OTA Update finished");
|
||||
LOG(ELOG_LEVEL_DEBUG, "OTA Update finished, rebooting after 2 seconds");
|
||||
ota_status.update_progress = -1;
|
||||
webSocket.textAll(String(-1).c_str());
|
||||
delay(2000);
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
void update_progress(int cur, int total) {
|
||||
@@ -102,7 +104,6 @@ void check_and_update_littleFS(OTA littlefs) {
|
||||
if (isVersionNewer(current_spiffs_version, REQUIRED_SPIFFS_VERSION) && isVersionNewer(current_spiffs_version, latest_fs_version.version)) {
|
||||
LOG(ELOG_LEVEL_DEBUG, "New SPIFFS version, running update now");
|
||||
run_ota_spiffs_update(latest_fs_version.url, update_started, update_finished, update_progress, update_error);
|
||||
ESP.restart();
|
||||
|
||||
// If we do not need a new version but one is available on the server
|
||||
} else if (isVersionNewer(REQUIRED_SPIFFS_VERSION, latest_fs_version.version)) {
|
||||
|
||||
Reference in New Issue
Block a user