Compare commits

..

74 Commits

Author SHA1 Message Date
8e3dfc93f7 docs: update changelog and header for version v1.3.71
Some checks failed
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 2m37s
2025-02-23 11:09:57 +01:00
5016285dce docs: update webpages for version v1.3.71 2025-02-23 11:09:57 +01:00
9b1a232fde feat: add FTP upload step for firmware in Gitea release workflow 2025-02-23 11:09:49 +01:00
37e79b7a49 docs: update changelog and header for version v1.3.70
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m41s
2025-02-23 09:58:18 +01:00
6bd23f31c1 docs: update webpages for version v1.3.70 2025-02-23 09:58:17 +01:00
3099e9ded9 docs: update changelog and header for version v1.3.69
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m37s
2025-02-23 09:54:00 +01:00
4952ad3150 docs: update webpages for version v1.3.69 2025-02-23 09:54:00 +01:00
2055da9962 fix: update release note generation to use the second latest tag 2025-02-23 09:53:55 +01:00
459a31cad3 docs: update changelog and header for version v1.3.68
All checks were successful
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m3s
2025-02-23 09:48:22 +01:00
4b1930209b docs: update webpages for version v1.3.68 2025-02-23 09:48:21 +01:00
7dde07b5ab fix: update release note generation to include commit hash and author 2025-02-23 09:48:15 +01:00
33a5406248 fix: remove commented test line from platformio.ini 2025-02-23 09:47:18 +01:00
b016a31ff0 docs: update changelog and header for version v1.3.67
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m37s
2025-02-23 09:18:57 +01:00
19bc4927e4 docs: update webpages for version v1.3.67 2025-02-23 09:18:57 +01:00
cd55cb86ba ci: update release note generation to use the latest tag 2025-02-23 09:18:52 +01:00
8ab16b351b docs: update changelog and header for version v1.3.66
All checks were successful
Release Workflow / detect-provider (push) Successful in 6s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m52s
2025-02-23 09:02:44 +01:00
400a37d3ac docs: update webpages for version v1.3.66 2025-02-23 09:02:44 +01:00
eb4f809435 ci: remove redundant git fetch for tags in release note generation 2025-02-23 09:02:40 +01:00
1148947b8e docs: update changelog and header for version v1.3.65
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m18s
2025-02-22 20:49:15 +01:00
3b01336999 docs: update webpages for version v1.3.65 2025-02-22 20:49:15 +01:00
44614b58dc ci: improve release note generation by fetching tags and sorting unique commits 2025-02-22 20:49:10 +01:00
ed8d618272 docs: update changelog and header for version v1.3.64
All checks were successful
Release Workflow / detect-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m6s
2025-02-22 20:37:49 +01:00
cd2ac54e98 docs: update webpages for version v1.3.64 2025-02-22 20:37:49 +01:00
92f675b24c style: remove unnecessary closing tags from header.html 2025-02-22 20:37:46 +01:00
c342877558 docs: update changelog and header for version v1.3.63
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m40s
2025-02-22 20:33:55 +01:00
f5743cbd7b docs: update webpages for version v1.3.63 2025-02-22 20:33:55 +01:00
8a62597705 style: update release note generation for initial release handling 2025-02-22 20:33:51 +01:00
374721d1e5 style: update update-form background and add glass border effect 2025-02-22 20:30:30 +01:00
ea6f708c6e docs: update changelog and header for version v1.3.62
Some checks failed
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 2m37s
2025-02-22 20:25:08 +01:00
78169dfdb1 docs: update webpages for version v1.3.62 2025-02-22 20:25:08 +01:00
074bfb658d style: update background colors and improve layout for update sections 2025-02-22 20:25:00 +01:00
989076e794 docs: update changelog and header for version v1.3.61
Some checks failed
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 2m47s
2025-02-22 20:14:35 +01:00
aa0d056d10 docs: update webpages for version v1.3.61 2025-02-22 20:14:35 +01:00
cd619b8f2a feat: update release notes generation to use previous tag for changes 2025-02-22 20:13:15 +01:00
6d8358cbb9 docs: update changelog and header for version v1.3.60
All checks were successful
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m48s
2025-02-22 20:06:25 +01:00
1f3a67634f docs: update webpages for version v1.3.60 2025-02-22 20:06:25 +01:00
09969b644e feat: remove automatic git push from changelog update script 2025-02-22 20:06:20 +01:00
deb7abd102 feat: implement release notes generation with categorized changes since last tag 2025-02-22 20:00:42 +01:00
1b059c35f1 docs: update changelog for version 1.3.59
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m37s
2025-02-22 19:57:13 +01:00
e098d71f6f docs: update webpages for version v1.3.59 2025-02-22 19:57:13 +01:00
4b25b72b2e feat: implement enhanced update progress handling and WebSocket notifications 2025-02-22 19:50:12 +01:00
5c59016f94 feat: improve update progress reporting and enhance WebSocket notifications 2025-02-22 18:49:45 +01:00
d2da501b94 feat: enhance update progress handling and add WebSocket closure notification 2025-02-22 18:19:21 +01:00
4135073623 feat: implement WebSocket for update progress and enhance update response handling 2025-02-22 18:12:27 +01:00
fe7b57fe0e docs: update changelog for version 1.3.58
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m25s
2025-02-22 17:59:59 +01:00
c1ae6b7295 docs: update webpages for version v1.3.58 2025-02-22 17:59:59 +01:00
9eee89fac7 feat: implement backup and restore functionality for Bambu credentials and Spoolman URL 2025-02-22 17:58:20 +01:00
8c5e7e26ac docs: update upgrade page message and improve progress display logic 2025-02-22 17:53:51 +01:00
7b52066378 docs: update changelog for version 1.3.57
All checks were successful
Release Workflow / detect-provider (push) Successful in 5s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m59s
2025-02-22 17:36:09 +01:00
d5afa38ded docs: update webpages for version v1.3.57 2025-02-22 17:36:09 +01:00
cf50baba2d docs: update header title to 'Filament Management Tool' in multiple HTML files 2025-02-22 17:36:02 +01:00
aa9e7da94b docs: update changelog for version 1.3.56
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m41s
2025-02-22 17:31:33 +01:00
71cd3ba4fc docs: update webpages for version v1.3.56 2025-02-22 17:31:33 +01:00
73e240e879 docs: update header title and improve SPIFFS update error handling 2025-02-22 17:31:28 +01:00
0d34e1d718 docs: clarify comments in Gitea and GitHub release workflows 2025-02-22 17:18:11 +01:00
84cc8beb9b docs: update changelog for version 1.3.55
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m38s
2025-02-22 17:00:00 +01:00
fd70e3179d docs: update webpages for version v1.3.55 2025-02-22 16:59:59 +01:00
c553640ad8 docs: update component descriptions in README files 2025-02-22 16:59:56 +01:00
807eca3c43 docs: update changelog for version 1.3.54
Some checks failed
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 2m12s
2025-02-22 16:47:52 +01:00
b52730bf67 docs: update webpages for version v1.3.54 2025-02-22 16:47:52 +01:00
9a59b91e88 workflow: update SPIFFS binary creation to exclude header 2025-02-22 16:47:27 +01:00
a5af4013d8 docs: update changelog for version 1.3.53
All checks were successful
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m34s
2025-02-22 16:22:30 +01:00
e54ce58ec4 version: update to version 1.3.53 2025-02-22 16:22:27 +01:00
142eafd232 docs: update changelog for version 1.3.51 2025-02-22 16:22:04 +01:00
63ab9e0993 docs: update changelog for version 1.3.51 2025-02-22 16:21:54 +01:00
aaa5506d40 workflow: update SPIFFS binary magic byte and revert version to 1.3.51 2025-02-22 16:21:51 +01:00
8037adc045 docs: update changelog for version 1.3.52
All checks were successful
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m20s
2025-02-22 16:09:46 +01:00
6e7c728cd8 docs: update webpages for version v1.3.52 2025-02-22 16:09:46 +01:00
3fe8271344 workflow: update SPIFFS binary creation to use correct chip revision (0xEB for Rev 3) 2025-02-22 16:09:41 +01:00
f2bc6eab92 docs: update changelog for version 1.3.51
All checks were successful
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m35s
2025-02-22 15:50:55 +01:00
37df492339 docs: update webpages for version v1.3.51 2025-02-22 15:50:54 +01:00
c4b425403f config: update platformio.ini to specify correct chip revision and remove unused dependencies 2025-02-22 15:50:49 +01:00
73244689dd docs: update changelog for version 1.3.50
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m31s
2025-02-22 15:16:53 +01:00
27296104d2 docs: update webpages for version v1.3.50 2025-02-22 15:16:53 +01:00
16 changed files with 644 additions and 298 deletions

View File

@ -6,12 +6,17 @@ on:
GITEA_TOKEN:
description: 'Token für Gitea API-Zugriff'
required: true
FTP_PASSWORD:
description: 'FTP Password for firmware upload'
required: true
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
@ -40,8 +45,8 @@ jobs:
# Copy firmware binary
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/upgrade_filaman_firmware_v${VERSION}.bin
# Create SPIFFS binary with correct chip revision
( printf '\xe9\x03\x01\x00' && cat .pio/build/esp32dev/spiffs.bin ) > .pio/build/esp32dev/upgrade_filaman_website_v${VERSION}.bin
# Create SPIFFS binary - direct copy without header
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/upgrade_filaman_website_v${VERSION}.bin
# Create full binary
(cd .pio/build/esp32dev &&
@ -66,14 +71,48 @@ jobs:
VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Read CHANGELOG.md
id: changelog
- name: Generate Release Notes
id: release_notes
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
CHANGELOG=$(awk "/## \\[$VERSION\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Get the latest tag
LATEST_TAG=$(git for-each-ref --sort=-creatordate --format '%(refname:short)' refs/tags | sed -n '2p')
if [ -n "$LATEST_TAG" ]; then
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "Changes since ${LATEST_TAG}:" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
# Get all commits since last release with commit hash and author
echo "### Added" >> $GITHUB_OUTPUT
git log ${LATEST_TAG}..HEAD --pretty=format:"%h - %s (%an)" | grep -iE '^[a-f0-9]+ - (feat|add|new)' | sed 's/^[a-f0-9]* - feat: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Fixed" >> $GITHUB_OUTPUT
git log ${LATEST_TAG}..HEAD --pretty=format:"%h - %s (%an)" | grep -iE '^[a-f0-9]+ - fix' | sed 's/^[a-f0-9]* - fix: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Changed" >> $GITHUB_OUTPUT
git log ${LATEST_TAG}..HEAD --pretty=format:"%h - %s (%an)" | grep -ivE '^[a-f0-9]+ - (feat|fix|add|new)' | sed 's/^[a-f0-9]* - /- /' >> $GITHUB_OUTPUT || true
echo "EOF" >> $GITHUB_OUTPUT
else
# First release
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "Initial Release" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
# Add all commits for initial release
echo "### Added" >> $GITHUB_OUTPUT
git log --pretty=format:"%h - %s (%an)" | grep -iE '^[a-f0-9]+ - (feat|add|new)' | sed 's/^[a-f0-9]* - feat: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Fixed" >> $GITHUB_OUTPUT
git log --pretty=format:"%h - %s (%an)" | grep -iE '^[a-f0-9]+ - fix' | sed 's/^[a-f0-9]* - fix: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Changed" >> $GITHUB_OUTPUT
git log --pretty=format:"%h - %s (%an)" | grep -ivE '^[a-f0-9]+ - (feat|fix|add|new)' | sed 's/^[a-f0-9]* - /- /' >> $GITHUB_OUTPUT || true
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Determine Gitea URL
id: gitea_url
@ -122,7 +161,7 @@ jobs:
# Erstelle zuerst den Release ohne Dateien
echo "Debug: Creating release..."
RELEASE_DATA="{\"tag_name\":\"v${VERSION}\",\"name\":\"v${VERSION}\",\"body\":\"${{ steps.changelog.outputs.CHANGES }}\"}"
RELEASE_DATA="{\"tag_name\":\"v${VERSION}\",\"name\":\"v${VERSION}\",\"body\":\"${{ steps.release_notes.outputs.CHANGES }}\"}"
RELEASE_RESPONSE=$(curl -s -w "\n%{http_code}" \
-X POST \
@ -162,4 +201,17 @@ jobs:
echo "Successfully uploaded $file"
fi
fi
done
done
- name: Upload Firmware via FTP
if: success()
uses: sebastianpopp/ftp-action@releases/v2
with:
host: "filaman.app"
port: 21
user: "firmware"
password: ${{ secrets.FTP_PASSWORD }}
forceSsl: true
localDir: ".pio/build/esp32dev"
remoteDir: "/"
options: "--ssl-reqd --include 'filaman_full_*.bin' --rename"

View File

@ -47,8 +47,8 @@ jobs:
# Copy firmware binary
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/upgrade_filaman_firmware_v${VERSION}.bin
# Create SPIFFS binary with correct chip revision
( printf '\xe9\x03\x01\x00' && cat .pio/build/esp32dev/spiffs.bin ) > .pio/build/esp32dev/upgrade_filaman_website_v${VERSION}.bin
# Create SPIFFS binary - direct copy without header
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/upgrade_filaman_website_v${VERSION}.bin
# Create full binary (always)
(cd .pio/build/esp32dev &&
@ -73,14 +73,48 @@ jobs:
VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Read CHANGELOG.md
id: changelog
- name: Generate Release Notes
id: release_notes
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
CHANGELOG=$(awk "/## \\[$VERSION\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Get the latest tag
LATEST_TAG=$(git for-each-ref --sort=-creatordate --format '%(refname:short)' refs/tags | sed -n '2p')
if [ -n "$LATEST_TAG" ]; then
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "Changes since ${LATEST_TAG}:" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
# Get all commits since last release with commit hash and author
echo "### Added" >> $GITHUB_OUTPUT
git log ${LATEST_TAG}..HEAD --pretty=format:"%h - %s (%an)" | grep -iE '^[a-f0-9]+ - (feat|add|new)' | sed 's/^[a-f0-9]* - feat: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Fixed" >> $GITHUB_OUTPUT
git log ${LATEST_TAG}..HEAD --pretty=format:"%h - %s (%an)" | grep -iE '^[a-f0-9]+ - fix' | sed 's/^[a-f0-9]* - fix: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Changed" >> $GITHUB_OUTPUT
git log ${LATEST_TAG}..HEAD --pretty=format:"%h - %s (%an)" | grep -ivE '^[a-f0-9]+ - (feat|fix|add|new)' | sed 's/^[a-f0-9]* - /- /' >> $GITHUB_OUTPUT || true
echo "EOF" >> $GITHUB_OUTPUT
else
# First release
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "Initial Release" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
# Add all commits for initial release
echo "### Added" >> $GITHUB_OUTPUT
git log --pretty=format:"%h - %s (%an)" | grep -iE '^[a-f0-9]+ - (feat|add|new)' | sed 's/^[a-f0-9]* - feat: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Fixed" >> $GITHUB_OUTPUT
git log --pretty=format:"%h - %s (%an)" | grep -iE '^[a-f0-9]+ - fix' | sed 's/^[a-f0-9]* - fix: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Changed" >> $GITHUB_OUTPUT
git log --pretty=format:"%h - %s (%an)" | grep -ivE '^[a-f0-9]+ - (feat|fix|add|new)' | sed 's/^[a-f0-9]* - /- /' >> $GITHUB_OUTPUT || true
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
env:
@ -110,7 +144,7 @@ jobs:
if [ -n "$FILES_TO_UPLOAD" ]; then
gh release create "v${VERSION}" \
--title "Release ${VERSION}" \
--notes "${{ steps.changelog.outputs.CHANGES }}" \
--notes "${{ steps.release_notes.outputs.CHANGES }}" \
$FILES_TO_UPLOAD
else
echo "Error: No files found to upload"

View File

@ -1,5 +1,160 @@
# Changelog
## [1.3.71] - 2025-02-23
### Added
- add FTP upload step for firmware in Gitea release workflow
### Changed
- update webpages for version v1.3.71
## [1.3.70] - 2025-02-23
### Changed
- update webpages for version v1.3.70
## [1.3.69] - 2025-02-23
### Changed
- update webpages for version v1.3.69
### Fixed
- update release note generation to use the second latest tag
## [1.3.68] - 2025-02-23
### Changed
- update webpages for version v1.3.68
### Fixed
- update release note generation to include commit hash and author
- remove commented test line from platformio.ini
## [1.3.67] - 2025-02-23
### Changed
- update webpages for version v1.3.67
- ci: update release note generation to use the latest tag
## [1.3.66] - 2025-02-23
### Changed
- update webpages for version v1.3.66
- ci: remove redundant git fetch for tags in release note generation
## [1.3.65] - 2025-02-22
### Changed
- update webpages for version v1.3.65
- ci: improve release note generation by fetching tags and sorting unique commits
## [1.3.64] - 2025-02-22
### Changed
- update webpages for version v1.3.64
- remove unnecessary closing tags from header.html
## [1.3.63] - 2025-02-22
### Added
- update update-form background and add glass border effect
### Changed
- update webpages for version v1.3.63
- update release note generation for initial release handling
## [1.3.62] - 2025-02-22
### Changed
- update webpages for version v1.3.62
- update background colors and improve layout for update sections
## [1.3.61] - 2025-02-22
### Added
- update release notes generation to use previous tag for changes
### Changed
- update webpages for version v1.3.61
## [1.3.60] - 2025-02-22
### Added
- remove automatic git push from changelog update script
- implement release notes generation with categorized changes since last tag
### Changed
- update webpages for version v1.3.60
## [1.3.59] - 2025-02-22
### Added
- implement enhanced update progress handling and WebSocket notifications
- improve update progress reporting and enhance WebSocket notifications
- enhance update progress handling and add WebSocket closure notification
- implement WebSocket for update progress and enhance update response handling
### Changed
- update webpages for version v1.3.59
## [1.3.58] - 2025-02-22
### Added
- implement backup and restore functionality for Bambu credentials and Spoolman URL
### Changed
- update webpages for version v1.3.58
- update upgrade page message and improve progress display logic
## [1.3.57] - 2025-02-22
### Changed
- update webpages for version v1.3.57
- update header title to 'Filament Management Tool' in multiple HTML files
## [1.3.56] - 2025-02-22
### Changed
- update webpages for version v1.3.56
- update header title and improve SPIFFS update error handling
- clarify comments in Gitea and GitHub release workflows
## [1.3.55] - 2025-02-22
### Changed
- update webpages for version v1.3.55
- update component descriptions in README files
## [1.3.54] - 2025-02-22
### Changed
- update webpages for version v1.3.54
- workflow: update SPIFFS binary creation to exclude header
## [1.3.53] - 2025-02-22
### Changed
- version: update to version 1.3.53
- update changelog for version 1.3.51
- update changelog for version 1.3.51
- workflow: update SPIFFS binary magic byte and revert version to 1.3.51
## [1.3.52] - 2025-02-22
### Changed
- update webpages for version v1.3.52
- workflow: update SPIFFS binary creation to use correct chip revision (0xEB for Rev 3)
## [1.3.51] - 2025-02-22
### Changed
- update changelog for version 1.3.51
- workflow: update SPIFFS binary magic byte and revert version to 1.3.51
## [1.3.50] - 2025-02-22
### Changed
- update webpages for version v1.3.50
## [1.3.49] - 2025-02-22
### Changed
- update webpages for version v1.3.49

View File

@ -53,14 +53,14 @@ Deutsches Erklärvideo: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62zaO
### Komponenten
- **ESP32 Entwicklungsboard:** Jede ESP32-Variante.
[Amazon Link](https://amzn.eu/d/aXThslf)
- **HX711 Wägezellen-Verstärker:** Für Gewichtsmessung.
[Amazon Link](https://amzn.eu/d/1wZ4v0x)
- **OLED Display:** 128x64 SSD1306.
[Amazon Link](https://amzn.eu/d/dozAYDU)
- **PN532 NFC Modul:** Für NFC-Tag-Operationen.
[Amazon Link](https://amzn.eu/d/8205DDh)
- **NFC-Tag:** NTAG215
[Amazon Link](https://amzn.eu/d/fywy4c4)
- **HX711 5kg Wägezellen-Verstärker:** Für Gewichtsmessung.
[Amazon Link](https://amzn.eu/d/06A0DLb)
- **OLED 0.96 Zoll I2C weiß/gelb Display:** 128x64 SSD1306.
[Amazon Link](https://amzn.eu/d/0AuBp2c)
- **PN532 NFC NXP RFID-Modul V3:** Für NFC-Tag-Operationen.
[Amazon Link](https://amzn.eu/d/jfIuQXb)
- **NFC Tags Ntag215:** RFID Tag
[Amazon Link](https://amzn.eu/d/9Z6mXc1)
### Pin-Konfiguration
| Komponente | ESP32 Pin |

View File

@ -56,14 +56,14 @@ german explanatory video: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62z
### Components
- **ESP32 Development Board:** Any ESP32 variant.
[Amazon Link](https://amzn.eu/d/aXThslf)
- **HX711 Load Cell Amplifier:** For weight measurement.
[Amazon Link](https://amzn.eu/d/1wZ4v0x)
- **OLED Display:** 128x64 SSD1306.
[Amazon Link](https://amzn.eu/d/dozAYDU)
- **PN532 NFC Module:** For NFC tag operations.
[Amazon Link](https://amzn.eu/d/8205DDh)
- **NFC-Tag:** NTAG215
[Amazon Link](https://amzn.eu/d/fywy4c4)
- **HX711 5kg Load Cell Amplifier:** For weight measurement.
[Amazon Link](https://amzn.eu/d/06A0DLb)
- **OLED 0.96 Zoll I2C white/yellow Display:** 128x64 SSD1306.
[Amazon Link](https://amzn.eu/d/0AuBp2c)
- **PN532 NFC NXP RFID-Modul V3:** For NFC tag operations.
[Amazon Link](https://amzn.eu/d/jfIuQXb)
- **NFC Tags Ntag215:** RFID Tag
[Amazon Link](https://amzn.eu/d/9Z6mXc1)
### Pin Configuration

View File

@ -24,7 +24,7 @@
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Hollo Lollo Trollo</h4>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
@ -44,6 +44,4 @@
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
</body>
</html>

View File

@ -24,7 +24,7 @@
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Hollo Lollo Trollo</h4>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
@ -44,8 +44,6 @@
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
</body>
</html>
<!-- head -->

View File

@ -24,7 +24,7 @@
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Hollo Lollo Trollo</h4>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
@ -44,8 +44,6 @@
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
</body>
</html>
<!-- head -->

View File

@ -24,7 +24,7 @@
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Hollo Lollo Trollo</h4>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
@ -44,8 +44,6 @@
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
</body>
</html>
<!-- head -->

View File

@ -1051,9 +1051,10 @@ input[type="submit"]:disabled,
}
.update-form {
background: var(--primary-color);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
border: var(--glass-border);
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
margin: 0 auto;
width: 400px;
text-align: center;
@ -1064,7 +1065,7 @@ input[type="submit"]:disabled,
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
background: white;
background-color: #4CAF50;
}
.update-form input[type="submit"] {
background-color: #4CAF50;
@ -1086,10 +1087,66 @@ input[type="submit"]:disabled,
.warning {
background-color: var(--primary-color);
border: 1px solid #ffe0b2;
color: white;
padding: 15px;
margin: 20px auto;
border-radius: 4px;
max-width: 600px;
text-align: center;
color: #e65100;
padding: 15px;
}
.update-options {
display: flex;
gap: 2rem;
margin: 2rem 0;
}
.update-section {
flex: 1;
background: var(--background-green);
padding: 1.5rem;
border-radius: 8px;
}
.update-section h2 {
margin-top: 0;
color: #333;
}
.update-section p {
color: #666;
margin-bottom: 1rem;
}
.progress-container {
margin: 20px 0;
background: #f0f0f0;
border-radius: 4px;
overflow: hidden;
}
.progress-bar {
width: 0;
height: 20px;
background: #4CAF50;
transition: width 0.3s ease-in-out;
text-align: center;
line-height: 20px;
color: white;
}
.status {
margin-top: 20px;
padding: 10px;
border-radius: 4px;
display: none;
}
.status.success {
background: #e8f5e9;
color: #2e7d32;
}
.status.error {
background: #ffebee;
color: #c62828;
}
.warning {
background: #fff3e0;
color: #e65100;
padding: 15px;
border-radius: 4px;
margin-bottom: 20px;
}

View File

@ -24,7 +24,7 @@
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Hollo Lollo Trollo</h4>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
@ -44,8 +44,6 @@
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
</body>
</html>
<!-- head -->
@ -86,64 +84,6 @@
<div class="status"></div>
</div>
<style>
.update-options {
display: flex;
gap: 2rem;
margin: 2rem 0;
}
.update-section {
flex: 1;
background: #f5f5f5;
padding: 1.5rem;
border-radius: 8px;
}
.update-section h2 {
margin-top: 0;
color: #333;
}
.update-section p {
color: #666;
margin-bottom: 1rem;
}
.progress-container {
margin: 20px 0;
background: #f0f0f0;
border-radius: 4px;
overflow: hidden;
}
.progress-bar {
width: 0;
height: 20px;
background: #4CAF50;
transition: width 0.3s ease-in-out;
text-align: center;
line-height: 20px;
color: white;
}
.status {
margin-top: 20px;
padding: 10px;
border-radius: 4px;
display: none;
}
.status.success {
background: #e8f5e9;
color: #2e7d32;
}
.status.error {
background: #ffebee;
color: #c62828;
}
.warning {
background: #fff3e0;
color: #e65100;
padding: 15px;
border-radius: 4px;
margin-bottom: 20px;
}
</style>
<script>
// Hide status indicators during update
const statusContainer = document.querySelector('.status-container');
@ -154,18 +94,108 @@
const progress = document.querySelector('.progress-bar');
const progressContainer = document.querySelector('.progress-container');
const status = document.querySelector('.status');
let updateInProgress = false;
let lastReceivedProgress = 0;
// WebSocket Handling
let ws = null;
let wsReconnectTimer = null;
function connectWebSocket() {
ws = new WebSocket('ws://' + window.location.host + '/ws');
ws.onmessage = function(event) {
try {
const data = JSON.parse(event.data);
if (data.type === "updateProgress" && updateInProgress) {
// Zeige Fortschrittsbalken
progressContainer.style.display = 'block';
// Aktualisiere den Fortschritt nur wenn er größer ist
const newProgress = parseInt(data.progress);
if (!isNaN(newProgress) && newProgress >= lastReceivedProgress) {
progress.style.width = newProgress + '%';
progress.textContent = newProgress + '%';
lastReceivedProgress = newProgress;
}
// Zeige Status-Nachricht
if (data.message || data.status) {
status.textContent = data.message || getStatusMessage(data.status);
status.className = 'status success';
status.style.display = 'block';
// Starte Reload wenn Update erfolgreich
if (data.status === 'success' || lastReceivedProgress >= 98) {
clearTimeout(wsReconnectTimer);
setTimeout(() => {
window.location.href = '/';
}, 30000);
}
}
}
} catch (e) {
console.error('WebSocket message error:', e);
}
};
ws.onclose = function() {
if (updateInProgress) {
// Wenn der Fortschritt hoch genug ist, gehen wir von einem erfolgreichen Update aus
if (lastReceivedProgress >= 85) {
status.textContent = "Update appears successful! Device is restarting... Page will reload in 30 seconds.";
status.className = 'status success';
status.style.display = 'block';
clearTimeout(wsReconnectTimer);
setTimeout(() => {
window.location.href = '/';
}, 30000);
} else {
// Versuche Reconnect bei niedrigem Fortschritt
wsReconnectTimer = setTimeout(connectWebSocket, 1000);
}
}
};
ws.onerror = function(err) {
console.error('WebSocket error:', err);
if (updateInProgress && lastReceivedProgress >= 85) {
status.textContent = "Update appears successful! Device is restarting... Page will reload in 30 seconds.";
status.className = 'status success';
status.style.display = 'block';
setTimeout(() => {
window.location.href = '/';
}, 30000);
}
};
}
// Initial WebSocket connection
connectWebSocket();
function getStatusMessage(status) {
switch(status) {
case 'starting': return 'Starting update...';
case 'uploading': return 'Uploading...';
case 'finalizing': return 'Finalizing update...';
case 'restoring': return 'Restoring configurations...';
case 'preparing': return 'Preparing for restart...';
case 'success': return 'Update successful! Device is restarting... Page will reload in 30 seconds.';
default: return 'Updating...';
}
}
function handleUpdate(e) {
e.preventDefault();
const form = e.target;
const file = form.update.files[0];
const updateType = form.dataset.type;
if (!file) {
alert('Please select a file.');
return;
}
// Validate file name pattern
if (updateType === 'firmware' && !file.name.startsWith('upgrade_filaman_firmware_')) {
alert('Please select a valid firmware file (upgrade_filaman_firmware_*.bin)');
@ -176,62 +206,39 @@
return;
}
// Reset UI
updateInProgress = true;
progressContainer.style.display = 'block';
status.style.display = 'none';
status.className = 'status';
// Reset progress bar
progress.style.width = '0%';
progress.textContent = '0%';
// Disable both forms during update
// Disable submit buttons
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = true);
// Send update
const xhr = new XMLHttpRequest();
xhr.open('POST', '/update', true);
xhr.onload = function() {
try {
let response = this.responseText;
try {
const jsonResponse = JSON.parse(response);
// Zeige finale Nachricht
status.textContent = jsonResponse.message || "Update complete";
status.classList.add(jsonResponse.success ? 'success' : 'error');
status.style.display = 'block';
if (jsonResponse.success) {
progress.style.width = '100%';
progress.textContent = '100%';
// Automatischer Neustart nach erfolgreicher Aktualisierung
status.textContent = "Update successful! Restarting device...";
setTimeout(() => {
window.location.reload();
}, 5000);
} else {
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = false);
}
} catch (e) {
console.error('JSON parse error:', e);
status.textContent = 'Update failed: Invalid response from server';
status.classList.add('error');
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = false);
}
} catch (error) {
status.textContent = 'Error: ' + error.message;
status.classList.add('error');
if (xhr.status !== 200 && !progress.textContent.startsWith('100')) {
status.textContent = "Update failed: " + (xhr.responseText || "Unknown error");
status.className = 'status error';
status.style.display = 'block';
updateInProgress = false;
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = false);
}
};
xhr.onerror = function() {
status.textContent = 'Update failed: Network error';
status.classList.add('error');
status.style.display = 'block';
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = false);
if (!progress.textContent.startsWith('100')) {
status.textContent = "Network error during update";
status.className = 'status error';
status.style.display = 'block';
updateInProgress = false;
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = false);
}
};
const formData = new FormData();

View File

@ -24,7 +24,7 @@
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Hollo Lollo Trollo</h4>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
@ -44,8 +44,6 @@
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
</body>
</html>
<!-- head -->

View File

@ -24,7 +24,7 @@
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Hollo Lollo Trollo</h4>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
@ -44,8 +44,6 @@
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
</body>
</html>
<!-- head -->

View File

@ -9,9 +9,7 @@
; https://docs.platformio.org/page/projectconf.html
[common]
version = "1.3.49"
#test
version = "1.3.71"
[env:esp32dev]
platform = espressif32

View File

@ -64,29 +64,10 @@ def get_changes_from_git():
return changes
def push_changes(version):
"""Push changes to upstream"""
try:
# Stage the CHANGELOG.md
subprocess.run(['git', 'add', 'CHANGELOG.md'], check=True)
# Commit the changelog
commit_msg = f"docs: update changelog for version {version}"
subprocess.run(['git', 'commit', '-m', commit_msg], check=True)
# Push to origin (local)
subprocess.run(['git', 'push', 'origin'], check=True)
print("Successfully pushed to origin")
except subprocess.CalledProcessError as e:
print(f"Error during git operations: {e}")
return False
return True
def update_changelog():
print("Starting changelog update...") # Add this line
print("Starting changelog update...")
version = get_version()
print(f"Current version: {version}") # Add this line
print(f"Current version: {version}")
today = datetime.now().strftime('%Y-%m-%d')
script_dir = os.path.dirname(os.path.abspath(__file__))
@ -111,7 +92,7 @@ def update_changelog():
if not os.path.exists(changelog_path):
with open(changelog_path, 'w') as f:
f.write(f"# Changelog\n\n{changelog_entry}")
push_changes(version)
print(f"Created new changelog file with version {version}")
else:
with open(changelog_path, 'r') as f:
content = f.read()
@ -120,7 +101,7 @@ def update_changelog():
updated_content = content.replace("# Changelog\n", f"# Changelog\n\n{changelog_entry}")
with open(changelog_path, 'w') as f:
f.write(updated_content)
push_changes(version)
print(f"Added new version {version} to changelog")
else:
# Version existiert bereits, aktualisiere die bestehenden Einträge
version_pattern = f"## \\[{version}\\] - \\d{{4}}-\\d{{2}}-\\d{{2}}"
@ -143,7 +124,6 @@ def update_changelog():
with open(changelog_path, 'w') as f:
f.write(updated_content)
push_changes(version)
print(f"Updated entries for version {version}")
if __name__ == "__main__":

View File

@ -7,7 +7,6 @@
#include "nfc.h"
#include "scale.h"
#include "esp_task_wdt.h"
#include "esp_log.h"
#include <Update.h>
#include "display.h"
@ -24,6 +23,49 @@ AsyncWebSocket ws("/ws");
uint8_t lastSuccess = 0;
uint8_t lastHasReadRfidTag = 0;
// Globale Variablen für Config Backups hinzufügen
String bambuCredentialsBackup;
String spoolmanUrlBackup;
// Globale Variable für den Update-Typ
static int currentUpdateCommand = 0;
// Globale Update-Variablen
static size_t updateTotalSize = 0;
static size_t updateWritten = 0;
static bool isSpiffsUpdate = false;
void sendUpdateProgress(int progress, const char* status = nullptr, const char* message = nullptr) {
static int lastSentProgress = -1;
// Verhindere zu häufige Updates
if (progress == lastSentProgress && !status && !message) {
return;
}
String progressMsg = "{\"type\":\"updateProgress\",\"progress\":" + String(progress);
if (status) {
progressMsg += ",\"status\":\"" + String(status) + "\"";
}
if (message) {
progressMsg += ",\"message\":\"" + String(message) + "\"";
}
progressMsg += "}";
// Sende die Nachricht mehrmals mit Verzögerung für wichtige Updates
if (status || abs(progress - lastSentProgress) >= 10 || progress == 100) {
for (int i = 0; i < 2; i++) {
ws.textAll(progressMsg);
delay(100); // Längerer Delay zwischen Nachrichten
}
} else {
ws.textAll(progressMsg);
delay(50);
}
lastSentProgress = progress;
}
void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len) {
if (type == WS_EVT_CONNECT) {
Serial.println("Neuer Client verbunden!");
@ -165,7 +207,109 @@ void sendAmsData(AsyncWebSocketClient *client) {
}
}
void handleUpdate(AsyncWebServer &server) {
AsyncCallbackWebHandler* updateHandler = new AsyncCallbackWebHandler();
updateHandler->setUri("/update");
updateHandler->setMethod(HTTP_POST);
updateHandler->onUpload([](AsyncWebServerRequest *request, String filename,
size_t index, uint8_t *data, size_t len, bool final) {
if (!index) {
updateTotalSize = request->contentLength();
updateWritten = 0;
isSpiffsUpdate = (filename.indexOf("website") > -1);
if (isSpiffsUpdate) {
// Backup vor dem Update
sendUpdateProgress(0, "backup", "Backing up configurations...");
delay(200);
backupJsonConfigs();
delay(200);
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)) {
request->send(400, "application/json", "{\"success\":false,\"message\":\"Update initialization failed\"}");
return;
}
sendUpdateProgress(5, "starting", "Starting SPIFFS update...");
delay(200);
} else {
if (!Update.begin(updateTotalSize)) {
request->send(400, "application/json", "{\"success\":false,\"message\":\"Update initialization failed\"}");
return;
}
sendUpdateProgress(0, "starting", "Starting firmware update...");
delay(200);
}
}
if (len) {
if (Update.write(data, len) != len) {
request->send(400, "application/json", "{\"success\":false,\"message\":\"Write failed\"}");
return;
}
updateWritten += len;
int currentProgress;
// Berechne den Fortschritt basierend auf dem Update-Typ
if (isSpiffsUpdate) {
// SPIFFS: 5-75% für Upload
currentProgress = 5 + (updateWritten * 100) / updateTotalSize;
} else {
// Firmware: 0-100% für Upload
currentProgress = 1 + (updateWritten * 100) / updateTotalSize;
}
static int lastProgress = -1;
if (currentProgress != lastProgress && (currentProgress % 10 == 0 || final)) {
sendUpdateProgress(currentProgress, "uploading");
oledShowMessage("Update: " + String(currentProgress) + "%");
delay(50);
lastProgress = currentProgress;
}
}
if (final) {
if (Update.end(true)) {
if (isSpiffsUpdate) {
restoreJsonConfigs();
}
} else {
request->send(400, "application/json", "{\"success\":false,\"message\":\"Update finalization failed\"}");
}
}
});
updateHandler->onRequest([](AsyncWebServerRequest *request) {
if (Update.hasError()) {
request->send(400, "application/json", "{\"success\":false,\"message\":\"Update failed\"}");
return;
}
// Erste 100% Nachricht
ws.textAll("{\"type\":\"updateProgress\",\"progress\":100,\"status\":\"success\",\"message\":\"Update successful! Restarting device...\"}");
delay(2000); // Längerer Delay für die erste Nachricht
AsyncWebServerResponse *response = request->beginResponse(200, "application/json",
"{\"success\":true,\"message\":\"Update successful! Restarting device...\"}");
response->addHeader("Connection", "close");
request->send(response);
// Zweite 100% Nachricht zur Sicherheit
ws.textAll("{\"type\":\"updateProgress\",\"progress\":100,\"status\":\"success\",\"message\":\"Update successful! Restarting device...\"}");
delay(3000); // Noch längerer Delay vor dem Neustart
ESP.restart();
});
server.addHandler(updateHandler);
}
void setupWebserver(AsyncWebServer &server) {
// Deaktiviere alle Debug-Ausgaben
Serial.setDebugOutput(false);
// WebSocket-Optimierungen
ws.onEvent(onWsEvent);
ws.enable(true);
@ -364,101 +508,8 @@ void setupWebserver(AsyncWebServer &server) {
request->send(response);
});
// Update-Handler mit verbesserter Fehlerbehandlung
server.on("/update", HTTP_POST,
[](AsyncWebServerRequest *request) {
// Nach Update-Abschluss
bool success = !Update.hasError();
String message = success ? "Update successful" : String("Update failed: ") + Update.errorString();
AsyncWebServerResponse *response = request->beginResponse(
success ? 200 : 400,
"application/json",
"{\"success\":" + String(success ? "true" : "false") + ",\"message\":\"" + message + "\"}"
);
response->addHeader("Connection", "close");
request->send(response);
if (success) {
oledShowMessage("Upgrade successful Rebooting");
delay(500);
ESP.restart();
}
else {
oledShowMessage("Upgrade failed");
}
},
[](AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) {
static size_t updateSize = 0;
static int command = 0;
oledShowMessage("Upgrade please wait");
if (!index) {
// Reduziere Debug-Level während des Updates
esp_log_level_set("*", ESP_LOG_ERROR);
updateSize = request->contentLength();
command = (filename.indexOf("spiffs") > -1) ? U_SPIFFS : U_FLASH;
if (command == U_SPIFFS) {
oledShowMessage("SPIFFS Update...");
backupJsonConfigs();
if (!Update.begin(updateSize, command)) {
restoreJsonConfigs();
String errorMsg = String("Update begin failed: ") + Update.errorString();
request->send(400, "application/json", "{\"success\":false,\"message\":\"" + errorMsg + "\"}");
// Stelle Debug-Level wieder her
esp_log_level_set("*", ESP_LOG_INFO);
return;
}
} else {
oledShowMessage("Firmware Update...");
if (!Update.begin(updateSize, command)) {
String errorMsg = String("Update begin failed: ") + Update.errorString();
request->send(400, "application/json", "{\"success\":false,\"message\":\"" + errorMsg + "\"}");
// Stelle Debug-Level wieder her
esp_log_level_set("*", ESP_LOG_INFO);
return;
}
}
}
if (len) {
if (Update.write(data, len) != len) {
if (command == U_SPIFFS) {
restoreJsonConfigs();
}
String errorMsg = String("Write failed: ") + Update.errorString();
request->send(400, "application/json", "{\"success\":false,\"message\":\"" + errorMsg + "\"}");
return;
}
// Update OLED Display alle 25%
static int lastProgress = -1;
int currentProgress = (index + len) * 100 / updateSize;
if (currentProgress % 25 == 0 && currentProgress != lastProgress) {
lastProgress = currentProgress;
oledShowMessage(String(currentProgress) + "% complete");
}
}
if (final) {
if (!Update.end(true)) {
if (command == U_SPIFFS) {
restoreJsonConfigs();
}
String errorMsg = String("Update end failed: ") + Update.errorString();
request->send(400, "application/json", "{\"success\":false,\"message\":\"" + errorMsg + "\"}");
// Stelle Debug-Level wieder her
esp_log_level_set("*", ESP_LOG_INFO);
return;
}
// Stelle Debug-Level wieder her
esp_log_level_set("*", ESP_LOG_INFO);
}
}
);
// Update-Handler registrieren
handleUpdate(server);
server.on("/api/version", HTTP_GET, [](AsyncWebServerRequest *request){
String fm_version = VERSION;
@ -485,23 +536,47 @@ void setupWebserver(AsyncWebServer &server) {
void backupJsonConfigs() {
const char* configs[] = {"/bambu_credentials.json", "/spoolman_url.json"};
for (const char* config : configs) {
if (SPIFFS.exists(config)) {
String backupPath = String(config) + ".bak";
SPIFFS.remove(backupPath);
SPIFFS.rename(config, backupPath);
// Bambu Credentials backup
if (SPIFFS.exists("/bambu_credentials.json")) {
File file = SPIFFS.open("/bambu_credentials.json", "r");
if (file) {
bambuCredentialsBackup = file.readString();
file.close();
Serial.println("Bambu credentials backed up");
}
}
// Spoolman URL backup
if (SPIFFS.exists("/spoolman_url.json")) {
File file = SPIFFS.open("/spoolman_url.json", "r");
if (file) {
spoolmanUrlBackup = file.readString();
file.close();
Serial.println("Spoolman URL backed up");
}
}
}
void restoreJsonConfigs() {
const char* configs[] = {"/bambu_credentials.json", "/spoolman_url.json"};
for (const char* config : configs) {
String backupPath = String(config) + ".bak";
if (SPIFFS.exists(backupPath)) {
SPIFFS.remove(config);
SPIFFS.rename(backupPath, config);
// Restore Bambu credentials
if (bambuCredentialsBackup.length() > 0) {
File file = SPIFFS.open("/bambu_credentials.json", "w");
if (file) {
file.print(bambuCredentialsBackup);
file.close();
Serial.println("Bambu credentials restored");
}
bambuCredentialsBackup = ""; // Clear backup
}
// Restore Spoolman URL
if (spoolmanUrlBackup.length() > 0) {
File file = SPIFFS.open("/spoolman_url.json", "w");
if (file) {
file.print(spoolmanUrlBackup);
file.close();
Serial.println("Spoolman URL restored");
}
spoolmanUrlBackup = ""; // Clear backup
}
}