diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 28c1cf4..cf97d4d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -43,11 +43,16 @@ jobs:
--flash_mode dio \
--flash_freq 40m \
--flash_size 4MB \
- -o .pio/build/esp32dev/filaman.bin \
+ -o .pio/build/esp32dev/filaman_full.bin \
0x1000 .pio/build/esp32dev/bootloader.bin \
0x8000 .pio/build/esp32dev/partitions.bin \
0x10000 .pio/build/esp32dev/firmware.bin \
0x290000 .pio/build/esp32dev/spiffs.bin
+
+ - name: Prepare OTA firmware
+ run: |
+ # Use PlatformIO to create a proper OTA image
+ cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
- name: Get version from tag
id: get_version
@@ -71,9 +76,10 @@ jobs:
- name: Create Release with GitHub CLI
env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Changed from GITHUB_TOKEN to GH_TOKEN
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" \
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
--notes "${{ steps.changelog.outputs.CHANGES }}" \
- ".pio/build/esp32dev/filaman.bin#filaman.bin"
\ No newline at end of file
+ ".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
+ ".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
\ No newline at end of file
diff --git a/html/header.html b/html/header.html
index ee61c5a..740b6fd 100644
--- a/html/header.html
+++ b/html/header.html
@@ -21,7 +21,7 @@
Scale
Spoolman/Bambu
About
- Upgrade
+ Upgrade
diff --git a/platformio.ini b/platformio.ini
index 10a9fdc..4b8d1fe 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -29,7 +29,7 @@ lib_deps =
bblanchon/ArduinoJson @ ^7.3.0
knolleary/PubSubClient @ ^2.8
digitaldragon/SSLClient @ ^1.3.2
- jandrassy/ArduinoOTA @ ^1.1.0
+ ipdotsetaf/ESPAsyncHTTPUpdateServer @ ^2.0.0
; Enable SPIFFS upload
board_build.filesystem = spiffs
diff --git a/src/ota.cpp b/src/ota.cpp
new file mode 100644
index 0000000..642c003
--- /dev/null
+++ b/src/ota.cpp
@@ -0,0 +1,11 @@
+#include
+#include "ota.h"
+#include
+#include
+
+ESPAsyncHTTPUpdateServer updateServer;
+
+void setupOTA(AsyncWebServer &server) {
+ updateServer.setup(&server, "/ota", "admin", "admin");
+ //updateServer.setup(&server);
+}
diff --git a/src/ota.h b/src/ota.h
new file mode 100644
index 0000000..ebe6157
--- /dev/null
+++ b/src/ota.h
@@ -0,0 +1,8 @@
+#ifndef OTA_H
+#define OTA_H
+
+#include
+
+void setupOTA(AsyncWebServer &server);
+
+#endif
\ No newline at end of file
diff --git a/src/website.cpp b/src/website.cpp
index 388fd4a..3d20654 100644
--- a/src/website.cpp
+++ b/src/website.cpp
@@ -7,6 +7,7 @@
#include "nfc.h"
#include "scale.h"
#include "esp_task_wdt.h"
+#include "ota.h"
// Cache-Control Header definieren
#define CACHE_CONTROL "max-age=31536000" // Cache für 1 Jahr
@@ -160,6 +161,8 @@ void setupWebserver(AsyncWebServer &server) {
Serial.print("Geladene Spoolman-URL: ");
Serial.println(spoolmanUrl);
+ setupOTA(server);
+
// Route für about
server.on("/about", HTTP_GET, [](AsyncWebServerRequest *request){
Serial.println("Anfrage für /about erhalten");