Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(update): Allow updating any type of file system#11856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
me-no-dev merged 3 commits intomasterfromfeature/fs_update
Sep 24, 2025

Conversation

@me-no-dev
Copy link
Member

This pull request adds support for updating multiple file system types via OTA (Over-The-Air) updates, refactors the update logic to generalize file system handling, and introduces new update methods for various file systems. The changes improve flexibility and maintainability by replacing the previous SPIFFS-only logic with support for SPIFFS, FATFS, LittleFS, and a generic file system mode. Additionally, several code cleanups and refactorings are included.

File System OTA Update Support:

  • Added new constants (U_FLASHFS,U_FATFS,U_LITTLEFS) toUpdate.h to represent different file system OTA update modes, and refactored code to use these instead of onlyU_SPIFFS.
  • Updated theUpdateClass::begin method and OTA partition selection logic to support SPIFFS, FATFS, LittleFS, and a generic file system mode (U_FLASHFS), including fallback logic for partition selection.
  • Refactored thehandleUpdate method inHTTPUpdate.cpp to accept a file system type parameter instead of a boolean, and to set appropriate HTTP headers and select the correct partition for each file system type.[1][2][3][4][5]

API Additions and Refactoring:

  • Added new update methods for file systems (updateFs,updateFatfs,updateLittlefs) to bothHTTPUpdate.h andHTTPUpdate.cpp, for bothNetworkClient andHTTPClient usage.[1][2]
  • Updated function signatures and internal logic to use the new file system type constants, replacing previous boolean flags and simplifying the API.[1][2]

Code Cleanup and Documentation:

  • Removed the unused_paroffset member fromUpdateClass and related logic, simplifying partition offset handling.[1][2]
  • Updated documentation and comments to clarify that OTA file system updates now support multiple types, not just SPIFFS.[1][2]
  • Updated example code and server logic to use the new generic file system mode (U_FLASHFS) instead of SPIFFS.[1][2]

Backward Compatibility and Generalization:

  • Generalized header verification and completion logic inUpdater.cpp to work for all file system types, not just SPIFFS.[1][2]
  • Updated OTA command parsing and handling to support the new file system modes, ensuring correct update behavior for all supported types.

These changes collectively make the OTA update process more robust and extensible for different file system types on ESP32 platforms.

Fixes:#9347

@me-no-devme-no-dev requested a review froma team as acode ownerSeptember 18, 2025 10:34
@github-actions
Copy link
Contributor

github-actionsbot commentedSep 18, 2025
edited
Loading

Messages
📖🎉 Good Job! All checks are passing!

👋Hello me-no-dev, we appreciate your contribution to this project!


📘 Please review the project'sContributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you haveread and signed theContributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by thePR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with eachpush event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger isnot a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manuallyretry these Danger checks, please navigate to theActions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫dangerJS against74d4428

@me-no-devme-no-dev added the Status: Review neededIssue or PR is awaiting review labelSep 18, 2025
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This pull request adds support for updating multiple file system types via OTA (Over-The-Air) updates, expanding beyond the previous SPIFFS-only capability to include FATFS, LittleFS, and a generic file system mode. The changes refactor the update logic to use specific constants for each file system type and introduce new API methods for targeted file system updates.

Key changes include:

  • Added new constants (U_FLASHFS,U_FATFS,U_LITTLEFS) and refactored existingU_SPIFFS constant
  • Introduced new update methods for each file system type in HTTPUpdate API
  • Enhanced partition selection logic with fallback mechanisms for generic file system updates

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
libraries/Update/src/Update.hAdds new file system type constants and removes unused_paroffset member
libraries/Update/src/Updater.cppImplements multi-file system partition selection logic and removes offset handling
libraries/HTTPUpdate/src/HTTPUpdate.hDeclares new file system-specific update methods
libraries/HTTPUpdate/src/HTTPUpdate.cppImplements file system-specific update methods and refactors internal handling
libraries/HTTPUpdateServer/src/HTTPUpdateServer.hUpdates example to use generic file system mode
libraries/Update/examples/HTTP_Server_AES_OTA_Update/HTTP_Server_AES_OTA_Update.inoUpdates example and documentation to use generic file system mode
libraries/ArduinoOTA/src/ArduinoOTA.cppUpdates OTA command validation to accept generic file system mode
Comments suppressed due to low confidence (1)

libraries/Update/src/Updater.cpp:313

  • [nitpick] Missing whitespace after the closing brace. There should be a blank line before the next statement for better code readability and consistency with the surrounding code structure.
        }

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

@github-actions
Copy link
Contributor

github-actionsbot commentedSep 18, 2025
edited
Loading

Test Results

 76 files   76 suites   13m 11s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit74d4428.

♻️ This comment has been updated with latest results.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actionsbot commentedSep 18, 2025
edited
Loading

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32C5💚 -9K⚠️ +374💚 -0.85⚠️ +0.03💚 -320💚 -0.060.00
ESP32P4💚 -9K⚠️ +378💚 -1.02⚠️ +0.04💚 -320💚 -0.100.00
ESP32S3💚 -6K⚠️ +552💚 -0.67⚠️ +0.05💚 -320💚 -0.070.00
ESP32S2💚 -7K⚠️ +584💚 -0.71⚠️ +0.06💚 -320💚 -0.070.00
ESP32C3💚 -9K⚠️ +374💚 -0.90⚠️ +0.03💚 -320💚 -0.080.00
ESP32C6💚 -9K⚠️ +382💚 -0.89⚠️ +0.03💚 -240💚 -0.110.00
ESP32H20⚠️ +240.00⚠️ +0.01000.000.00
ESP32💚 -6K⚠️ +568💚 -0.65⚠️ +0.05💚 -320💚 -0.070.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32P4ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/ArduinoOTA/examples/BasicOTA⚠️ +240⚠️ +24💚 -16⚠️ +480⚠️ +400⚠️ +280⚠️ +240--⚠️ +480
libraries/HTTPUpdate/examples/httpUpdate⚠️ +3280⚠️ +328💚 -16⚠️ +5160⚠️ +5400⚠️ +3280⚠️ +3360--⚠️ +5400
libraries/HTTPUpdate/examples/httpUpdateSPIFFS⚠️ +3300⚠️ +330💚 -16⚠️ +5280⚠️ +5280⚠️ +3340⚠️ +3380--⚠️ +5280
libraries/HTTPUpdate/examples/httpUpdateSecure⚠️ +3740⚠️ +378💚 -16⚠️ +5520⚠️ +5840⚠️ +3740⚠️ +3820--⚠️ +5680
libraries/HTTPUpdateServer/examples/WebUpdater⚠️ +280⚠️ +28💚 -16⚠️ +320⚠️ +360⚠️ +240⚠️ +280--⚠️ +440
libraries/Update/examples/AWS_S3_OTA_Update⚠️ +18💚 -16⚠️ +180⚠️ +240⚠️ +280⚠️ +22💚 -16⚠️ +180--⚠️ +400
libraries/Update/examples/HTTP_Client_AES_OTA_Update⚠️ +220⚠️ +220⚠️ +240⚠️ +360⚠️ +220⚠️ +220--⚠️ +360
libraries/Update/examples/HTTP_Server_AES_OTA_Update💚 -9K💚 -32💚 -9K💚 -32💚 -6K💚 -32💚 -7K💚 -32💚 -9K💚 -32💚 -9K💚 -24--💚 -6K💚 -32
libraries/Update/examples/OTAWebUpdater⚠️ +28💚 -16⚠️ +280⚠️ +240⚠️ +360⚠️ +28💚 -16⚠️ +280--⚠️ +440
libraries/Update/examples/SD_Update⚠️ +240⚠️ +240⚠️ +280⚠️ +280⚠️ +240⚠️ +24💚 -16⚠️ +240⚠️ +400
libraries/WebServer/examples/HttpAdvancedAuth⚠️ +280⚠️ +280⚠️ +320⚠️ +360⚠️ +280⚠️ +28💚 -16--⚠️ +440
libraries/WebServer/examples/HttpAuthCallback⚠️ +280⚠️ +280⚠️ +320⚠️ +360⚠️ +280⚠️ +28💚 -16--⚠️ +440
libraries/WebServer/examples/HttpAuthCallbackInline⚠️ +280⚠️ +280⚠️ +320⚠️ +400⚠️ +280⚠️ +28💚 -16--⚠️ +440
libraries/WebServer/examples/HttpBasicAuth⚠️ +280⚠️ +280⚠️ +320⚠️ +400⚠️ +280⚠️ +28💚 -16--⚠️ +440
libraries/WebServer/examples/HttpBasicAuthSHA1⚠️ +240⚠️ +240⚠️ +320⚠️ +440⚠️ +280⚠️ +24💚 -16--00
libraries/WebServer/examples/HttpBasicAuthSHA1orBearerToken⚠️ +240⚠️ +24💚 -16⚠️ +320⚠️ +400⚠️ +280⚠️ +240--⚠️ +480
libraries/WebServer/examples/WebUpdate⚠️ +280⚠️ +280⚠️ +320⚠️ +360⚠️ +280⚠️ +280--⚠️ +480

@me-no-devme-no-dev added Status: Pending MergePull Request is ready to be merged and removed Status: Review neededIssue or PR is awaiting review labelsSep 24, 2025
@me-no-devme-no-dev merged commitef453a5 intomasterSep 24, 2025
54 checks passed
@me-no-devme-no-dev deleted the feature/fs_update branchSeptember 24, 2025 12:22
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@lucasssvazlucasssvazlucasssvaz approved these changes

@P-R-O-C-H-YP-R-O-C-H-YP-R-O-C-H-Y approved these changes

Assignees

No one assigned

Labels

Status: Pending MergePull Request is ready to be merged

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add LittleFS support to HTTPUpdate and HTTPUpdateServer

3 participants

@me-no-dev@lucasssvaz@P-R-O-C-H-Y

[8]ページ先頭

©2009-2025 Movatter.jp