Commit Graph

197 Commits

Author SHA1 Message Date
Will Tatam
4cddd3face refactor bootloader update to pattern used by main ota update 2025-11-09 10:29:16 +00:00
Will Tatam
5250a0fe2c move verifyBootloaderImage to ota_update 2025-11-09 10:21:39 +00:00
Will Tatam
95611f19c0 Improve error handling 2025-11-09 10:14:17 +00:00
Will Tatam
b98ee3e7b6 remove duplicate updatebootloader handler 2025-11-09 09:53:05 +00:00
Will Tatam
90d4dd79de remove duplicate call for validation - isValidBootloader 2025-11-09 09:52:50 +00:00
Will Tatam
00904d8862 Merge branch 'copilot/fix-d4f5fc55-f916-458a-9155-deb9bbff6662' of https://github.com/wled/WLED into copilot/fix-d4f5fc55-f916-458a-9155-deb9bbff6662 2025-11-09 09:18:00 +00:00
copilot-swe-agent[bot]
520f1f884b Enhance bootloader validation to match esp_image_verify() checks comprehensively
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-09 09:17:06 +00:00
copilot-swe-agent[bot]
8fc33fd7b1 Add ESP-IDF bootloader image validation before flash operations
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-09 09:17:06 +00:00
copilot-swe-agent[bot]
9e0f7ec4e9 Refactor bootloader upload to buffer entire file in RAM before flash operations
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-09 09:17:06 +00:00
copilot-swe-agent[bot]
c91a39f55c Fix: Cast min() arguments to size_t for ESP32-C3 compatibility
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-09 09:15:36 +00:00
copilot-swe-agent[bot]
ffc7b66c20 Fix: Remove static keyword from getBootloaderSHA256Hex() to match declaration
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-09 09:15:36 +00:00
copilot-swe-agent[bot]
94bea4405a Improve bootloader flash implementation with proper erase and write operations
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-09 09:15:36 +00:00
copilot-swe-agent[bot]
2963c1b761 Add esp_flash.h include for ESP32 bootloader flash operations
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-09 09:15:36 +00:00
Will Tatam
013ecfb189 Add ESP32 bootloader upgrade functionality with JSON API support
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-09 09:15:23 +00:00
Damian Schneider
f0f12e77ad New file editor (#4956)
- no mendatory external JS dependency, works in offline mode
- optional external dependency is used for highlighting JSON, plain text edit is used if not available
- WLED styling (dark mode only)
- JSON files are displayed "prettyfied" and saved "minified"
- JSON color highlighting (if available)
- JSON verification during edit and on saving both in online and offline mode
- special treatment for ledmap files: displayed in aligned columns (2D) or as lines (1D), saved as minified json: no more white-space problems
- displays file size and total flash usage
2025-11-09 08:32:45 +01:00
copilot-swe-agent[bot]
da1d53c3b0 Enhance bootloader validation to match esp_image_verify() checks comprehensively
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-08 18:56:31 +00:00
copilot-swe-agent[bot]
f4b98c43de Add ESP-IDF bootloader image validation before flash operations
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-08 18:31:20 +00:00
copilot-swe-agent[bot]
62c78fc5ac Refactor bootloader upload to buffer entire file in RAM before flash operations
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-11-08 18:00:24 +00:00
copilot-swe-agent[bot]
a073bf32e4 Implement OTA release compatibility checking system
Implement a comprehensive solution for validating a firmware before an
OTA updated is committed.  WLED metadata such as version and release
is moved to a data structure located at near the start of the firmware
binary, where it can be identified and validated.

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-10-06 21:50:23 -04:00
copilot-swe-agent[bot]
f5f3fc338f Fix: Cast min() arguments to size_t for ESP32-C3 compatibility
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-10-05 15:12:46 +00:00
copilot-swe-agent[bot]
042ed39464 Fix: Remove static keyword from getBootloaderSHA256Hex() to match declaration
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-10-05 14:57:24 +00:00
copilot-swe-agent[bot]
c3e18905c1 Improve bootloader flash implementation with proper erase and write operations
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-10-05 14:24:29 +00:00
copilot-swe-agent[bot]
a18a661c73 Add esp_flash.h include for ESP32 bootloader flash operations
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-10-05 14:20:14 +00:00
copilot-swe-agent[bot]
93908e758f Add ESP32 bootloader upgrade functionality with JSON API support
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-10-05 14:17:51 +00:00
Damian Schneider
529edfc39b "unrestricted" number of custom palettes (#4932)
- allow more than 10 custom palettes
- move palettes into CPP file
- Fix for minimizing cpal.htm (saves 2k of flash)
- shortened names in cpal, saves about 400 bytes of Flash after packing
- removed async from common.js loading to prevent errors on page loads if the file is not cached
- restricted nubmer of user palettes on ESP8266 to 10
- unrestricted number of user palettes on all other platforms (total max palettes: 256)
- added a warning when adding more than 10 palettes to let the user decide to risk it
- Bugfixes in palette enumeration, fixed AR palette adding
- AR palettes are now also added if there are more than 10 custom palettes

Co-authored-by: Blaž Kristan <blaz@kristan-sp.si>
2025-09-22 20:09:54 +02:00
Blaž Kristan
b375c718b0 Merge pull request #4771 from wled/fix-4643
Fix for #4643 - Missing MQTT updates
2025-09-17 12:20:41 +02:00
Damian Schneider
76cb2e9988 Improvements to heap-memory and PSRAM handling (#4791)
* Improved heap and PSRAM handling

- Segment `allocateData()` uses more elaborate DRAM checking to reduce fragmentation and allow for larger setups to run on low heap
- Segment data allocation fails if minimum contiguous block size runs low to keep the UI working
- Increased `MAX_SEGMENT_DATA` to account for better segment data handling
- Memory allocation functions try to keep enough DRAM for segment data
- Added constant `PSRAM_THRESHOLD` to improve PSARM usage
- Increase MIN_HEAP_SIZE to reduce risk of breaking UI due to low memory for JSON response
- ESP32 makes use of IRAM (no 8bit access) for pixeluffers, freeing up to 50kB of RAM
- Fix to properly get available heap on all platforms: added function `getFreeHeapSize()`
- Bugfix for effects that divide by SEGLEN: don't run FX in service() if segment is not active
-Syntax fix in AR: calloc() uses (numelements, size) as arguments

* Added new functions for allocation and heap checking

- added `allocate_buffer()` function that can be used to allocate large buffers: takes parameters to set preferred ram location, including 32bit accessible RAM on ESP32. Returns null if heap runs low or switches to PSRAM
- getFreeHeapSize() and getContiguousFreeHeap() helper functions for all platforms to correctly report free useable heap
- updated some constants
- updated segment data allocation to free the data if it is large

- replaced "psramsafe" variable with it's #ifdef: BOARD_HAS_PSRAM and made accomodating changes
- added some compile-time checks to handle invalid env. definitions
- updated all allocation functions and some of the logic behind them
- added use of fast RTC-Memory where available
- increased MIN_HEAP_SIZE for all systems (improved stability in tests)
- updated memory calculation in web-UI to account for required segment buffer
- added UI alerts if buffer allocation fails
- made getUsedSegmentData() non-private (used in buffer alloc function)
- changed MAX_SEGMENT_DATA
- added more detailed memory log to DEBUG output
- added debug output to buffer alloc function
2025-09-16 19:46:16 +02:00
Damian Schneider
c9c442a933 Bootloop detection & recovery (#4793)
* added boot loop detection and config backup
* automatic OTA rollback if loading backup does not fix it
* added new file handling functions
* adding verification of json files, added config restore at bootup if broken
* added function to compare contents of two files for future use (currently not used)
2025-08-15 20:43:04 +02:00
Blaž Kristan
5c74f0fa21 Fix wled#4643 2025-07-12 18:49:03 +02:00
Blaz Kristan
796494e925 Tweaks in OTA UI
- added OTA section toggle
- added ignore upload
- fix for missing "NoXXX" ID
- rely on 404 for /dmxmap
2025-06-26 11:41:03 +02:00
Blaz Kristan
7973fd84f1 Revert disable OTA & optional Arduino OTA
- new compile flag WLED_ENABLE_AOTA
- modify WLED_CONNECTED macro
- bugfix in Network isConnected() when static IP is set
2025-06-25 11:23:13 +02:00
Blaz Kristan
a041fd1266 Fix #4747 2025-06-24 11:00:04 +02:00
Blaž Kristan
0f00c95aba Merge pull request #4700 from wled/secure-ota
Securing OTA update
2025-06-20 20:05:11 +02:00
Blaž Kristan
23a51e0982 Merge pull request #4658 from wled/layers
Segment layers and better effect transitions (blending)
2025-06-01 12:28:11 +02:00
Blaž Kristan
a147f4120c Compile fix 2025-05-26 18:19:54 +02:00
Blaž Kristan
dcd3e07273 Securing OTA update
- prevent settings change if not using private IP address or same subnet
- prevent OTA from differnet subnet if PIN is not set
- ability to revert firmware
2025-05-26 18:00:45 +02:00
Blaž Kristan
0f321bfb38 Compilation fixes 2025-04-23 18:38:34 +02:00
Blaž Kristan
ca7d7d9369 Only disable Arduino OTA when using -D WLED_DISABLE_OTA
- since Update object is accessible even with ArduinoOTA disabled it should possible to use HTTP OTA regardless
- this saves about 12kB while still allowing OTA updates
- HTTP OTA updates can be blocked using PIN or OTA lock
2025-04-20 11:01:19 +02:00
Will Miles
9c8f8c645e Rename 'doSerializeConfig' to 'configNeedsWrite'
Clarify the name and usage of this flag, as the function name has
changed out from underneath it.
2025-03-23 15:16:52 -04:00
Blaž Kristan
b908384ba2 Merge pull request #4307 from blazoncek/compile-pin
Compile time lock PIN definition
2025-03-08 12:44:10 +01:00
Will Miles
bec7e54f7f Defer web requests if JSON lock contended
Use the web server's queuing mechanism to call us back later.
2025-01-23 19:10:43 -05:00
Frank
b6f74287d0 implement recommendations from reviewers
* simplified transition bugfix
* removed cast same type
* isIp parameter changed to pass-by-reference, to avoid copy constructor
2025-01-19 07:35:46 +01:00
Frank
013684b5ca making some parameters const, plus minor improvements
* changed some parameters to "pointer to const", so compiler can better optimize code size and performance -  because data behind a const pointer will never be modified by the called function.
* made setPixelColor `const`

* fixed a few potentially uninitialized local vars (the may have random values if not initialized)

* avoid shadowing "state" in handleSerial()
* plus a few very minor improvements
2025-01-19 07:35:46 +01:00
Frank
90c2955a71 avoid using keywords for variables: module, final
these are reserved names and future compilers may reject them.
2025-01-19 07:35:46 +01:00
Blaž Kristan
2c583c3071 Allow editing WiFi settings 2024-11-25 22:56:22 +01:00
Will Miles
b3b326738c Fix incorrect SET_F calls
Replace with F() or PSTR() as appropriate.
2024-10-23 21:26:40 -04:00
Blaz Kristan
3f3c986932 Merge branch '0_15' into end_oappend_v2 2024-09-24 21:43:47 +02:00
Blaz Kristan
b50e6e0d90 Static PinManager & UsermodManager
- saves a few bytes of flash
2024-09-19 21:44:11 +02:00
Will Miles
32f9616b6e Remove oappend
Remove the large stack buffer as we're just going to copy it in to a
heap buffer anyways.  Later we can refine the length estimation or use a
rope-style dynamic data structure like DynamicBufferList.
2024-09-18 23:18:51 -04:00
Blaz Kristan
ceed494cf7 Introduce common.js in settings pages 2024-09-17 16:26:11 +02:00