Compare commits
No commits in common. "9ed3c70c013e4855fee5fe6cbd0ecb94545855f8" and "a450d4bd1adb26d0c9e14d1830ce88d9d6c6332c" have entirely different histories.
9ed3c70c01
...
a450d4bd1a
@ -1,10 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [1.5.1] - 2025-03-30
|
|
||||||
### Changed
|
|
||||||
- update version to 1.5.1 and improve OTA update handling with task management
|
|
||||||
|
|
||||||
|
|
||||||
## [1.4.14] - 2025-03-30
|
## [1.4.14] - 2025-03-30
|
||||||
### Added
|
### Added
|
||||||
- add auto-tare functionality and update scale handling based on touch sensor connection
|
- add auto-tare functionality and update scale handling based on touch sensor connection
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
version = "1.5.1"
|
version = "1.4.14"
|
||||||
to_old_version = "1.5.0"
|
to_old_version = "1.4.0"
|
||||||
|
|
||||||
##
|
##
|
||||||
[env:esp32dev]
|
[env:esp32dev]
|
||||||
|
@ -190,7 +190,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prüfen ob das Gewicht gleich bleibt und dann senden
|
// Prüfen ob das Gewicht gleich bleibt und dann senden
|
||||||
if (abs(weight - lastWeight) <= 2 && weight > 5)
|
if (weight == lastWeight && weight > 5)
|
||||||
{
|
{
|
||||||
weigthCouterToApi++;
|
weigthCouterToApi++;
|
||||||
}
|
}
|
||||||
|
33
src/ota.cpp
33
src/ota.cpp
@ -1,10 +1,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <website.h>
|
#include <website.h>
|
||||||
#include <commonFS.h>
|
#include <commonFS.h>
|
||||||
#include "scale.h"
|
|
||||||
#include "bambu.h"
|
|
||||||
#include "nfc.h"
|
|
||||||
|
|
||||||
|
|
||||||
// Globale Variablen für Config Backups hinzufügen
|
// Globale Variablen für Config Backups hinzufügen
|
||||||
String bambuCredentialsBackup;
|
String bambuCredentialsBackup;
|
||||||
@ -155,25 +151,6 @@ void handleUpdate(AsyncWebServer &server) {
|
|||||||
|
|
||||||
updateHandler->onUpload([](AsyncWebServerRequest *request, String filename,
|
updateHandler->onUpload([](AsyncWebServerRequest *request, String filename,
|
||||||
size_t index, uint8_t *data, size_t len, bool final) {
|
size_t index, uint8_t *data, size_t len, bool final) {
|
||||||
|
|
||||||
// Disable all Tasks
|
|
||||||
if (BambuMqttTask != NULL)
|
|
||||||
{
|
|
||||||
Serial.println("Delete BambuMqttTask");
|
|
||||||
vTaskDelete(BambuMqttTask);
|
|
||||||
BambuMqttTask = NULL;
|
|
||||||
}
|
|
||||||
if (ScaleTask) {
|
|
||||||
Serial.println("Delete ScaleTask");
|
|
||||||
vTaskDelete(ScaleTask);
|
|
||||||
ScaleTask = NULL;
|
|
||||||
}
|
|
||||||
if (RfidReaderTask) {
|
|
||||||
Serial.println("Delete RfidReaderTask");
|
|
||||||
vTaskDelete(RfidReaderTask);
|
|
||||||
RfidReaderTask = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!index) {
|
if (!index) {
|
||||||
updateTotalSize = request->contentLength();
|
updateTotalSize = request->contentLength();
|
||||||
updateWritten = 0;
|
updateWritten = 0;
|
||||||
@ -182,9 +159,9 @@ void handleUpdate(AsyncWebServer &server) {
|
|||||||
if (isSpiffsUpdate) {
|
if (isSpiffsUpdate) {
|
||||||
// Backup vor dem Update
|
// Backup vor dem Update
|
||||||
sendUpdateProgress(0, "backup", "Backing up configurations...");
|
sendUpdateProgress(0, "backup", "Backing up configurations...");
|
||||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
delay(200);
|
||||||
backupJsonConfigs();
|
backupJsonConfigs();
|
||||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
delay(200);
|
||||||
|
|
||||||
const esp_partition_t *partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_SPIFFS, NULL);
|
const esp_partition_t *partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_SPIFFS, NULL);
|
||||||
if (!partition || !Update.begin(partition->size, U_SPIFFS)) {
|
if (!partition || !Update.begin(partition->size, U_SPIFFS)) {
|
||||||
@ -192,14 +169,14 @@ void handleUpdate(AsyncWebServer &server) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sendUpdateProgress(5, "starting", "Starting SPIFFS update...");
|
sendUpdateProgress(5, "starting", "Starting SPIFFS update...");
|
||||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
delay(200);
|
||||||
} else {
|
} else {
|
||||||
if (!Update.begin(updateTotalSize)) {
|
if (!Update.begin(updateTotalSize)) {
|
||||||
request->send(400, "application/json", "{\"success\":false,\"message\":\"Update initialization failed\"}");
|
request->send(400, "application/json", "{\"success\":false,\"message\":\"Update initialization failed\"}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sendUpdateProgress(0, "starting", "Starting firmware update...");
|
sendUpdateProgress(0, "starting", "Starting firmware update...");
|
||||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
delay(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,7 +202,7 @@ void handleUpdate(AsyncWebServer &server) {
|
|||||||
if (currentProgress != lastProgress && (currentProgress % 10 == 0 || final)) {
|
if (currentProgress != lastProgress && (currentProgress % 10 == 0 || final)) {
|
||||||
sendUpdateProgress(currentProgress, "uploading");
|
sendUpdateProgress(currentProgress, "uploading");
|
||||||
oledShowMessage("Update: " + String(currentProgress) + "%");
|
oledShowMessage("Update: " + String(currentProgress) + "%");
|
||||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
delay(50);
|
||||||
lastProgress = currentProgress;
|
lastProgress = currentProgress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user