Add ESP32 bootloader upgrade capability to OTA update page with JSON API support and ESP-IDF validation - #4984
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThis PR adds ESP32 bootloader OTA update support to WLED. It introduces a bootloader update form in the UI, extends the JSON info endpoint to report the current bootloader SHA256 hash, and implements complete bootloader verification, buffering, and flash programming logic with integrity checks. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
Comment |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
…perations Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
|
@copilot you failed to actually run |
…laration Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Fixed in commit c3e1890. Both ESP32 ( |
|
@copilot esp32c3dev environment fails to compile |
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
|
@copilot - it appears the injection of |
…V() injection removal Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
Fixed in commit f5f3fc3. The bootloader JavaScript code is now in a separate |
|
This is going to conflict terribly with #4960, which rewrote the state management of |
|
@coderabbitai please confirm the issues you raised have been resolved in the commits referenced in the reply to your comments |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 122940 @netmindz, yes! I can confirm that all three critical issues I raised have been successfully resolved in the commits you referenced. Here's the summary: ✅ All Issues Resolved1. Truncated bootloader verification (Fixed in 88466c7)
2. Error handling during upload (Fixed in a36638e)
3. Authentication before initialization (Fixed in af8c851)
All three critical security and stability issues have been properly addressed. Great work on the quick fixes! 🎉 |
…55-deb9bbff6662
Add ESP32 bootloader upgrade capability to OTA update page with JSON API support and ESP-IDF validation
Cleanup bootloader SHA256 calculation from #4984
Cleanup bootloader SHA256 calculation from #4984
…-9155-deb9bbff6662 Add ESP32 bootloader upgrade capability to OTA update page with JSON API support and ESP-IDF validation
Cleanup bootloader SHA256 calculation from wled#4984
Cleanup bootloader SHA256 calculation from wled#4984

ESP32 Bootloader Update Feature ✨
This PR implements the ability to upgrade ESP32 bootloader directly from the WLED OTA update page, with JSON API support and comprehensive ESP-IDF-equivalent validation.
📋 Requirements Implemented
✅ Manual OTA Update Page Enhancement
/updatepage✅ Comprehensive Bootloader Validation
✅ Bootloader Flash Implementation
esp_flash_write()andesp_flash_erase_region()✅ JSON API Enhancement
bootloaderSHA256field to/json/infoendpoint📁 Files Modified (4 files, ~350 lines)
wled00/wled_server.cpp/updatebootloaderendpoint, comprehensive validation)wled00/data/update.htmwled00/json.cppbootloaderSHA256field)wled00/fcn_declare.h🧪 Build Verification
✅ ESP32 Build (esp32dev):
✅ ESP32-C3 Build (esp32c3dev):
✅ ESP8266 Build (nodemcuv2):
✅ Tests:
🔍 Validation Evidence: Matches esp_image_verify()
The implementation performs 7 out of 9 validation checks from ESP-IDF's
esp_image_verify():Note: Checksum and SHA256 validations are not implemented because:
🎨 UI Screenshots
Update Page - Initial State (ESP8266 or before ESP32 detection):

Update Page - ESP32 with Bootloader Section:

🔧 Technical Implementation
ESP32 Image Header Structure:
Flash Operations (Safe Approach)
Safety Features
Known Limitations
Recommendations for Users
Fixes #4983
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
Summary by CodeRabbit
Release Notes