Skip to content

Feature/ota server#75

Merged
brainstorm merged 4 commits into
brainstorm:mainfrom
jubeormk1:feature/ota-server
Mar 6, 2026
Merged

Feature/ota server#75
brainstorm merged 4 commits into
brainstorm:mainfrom
jubeormk1:feature/ota-server

Conversation

@jubeormk1

Copy link
Copy Markdown
Collaborator

Completing Firmware update via SFTP feature

This is about #24 mostly, but also touches testing (#37). This PR fills the gaps in the placeholders created previously in PR57 PR58 and PR59. The code comes from the too detailed and closed PR55.

What it does?

On builds with the feature sftp-ota, it will populate an sftp server that accept binaries bundled with some metadata by ota-packer. After that saves the application binary into the next ota slot and at the same time computes a checksum and restart, load and validate the new application.

As an extra I have included and improved ota/test-hil-e2e-esp32c6.sh which is the first hardware in the loop end to end test in SSH-Stamp that now also checks the offset of the running application after applying the OTA.

More information can be found in /ota/README.md and in the rustdocs in the new package.

- Related to issue brainstorm#24 Firmware update via SFTP

**Warning:** Using unmerged sunset-ota package. This is not a sunset feature until it is approved.

Reusing code from the previously closed PR55 Task: Firmware update via SFTP. It fills the gaps that previous PR had prepared:
- Feature/workspaces (PR57),
- Feature/ota placeholder (PR58),
- New feature: ota TLV and ota-packer utility (PR59)
- Related to issue brainstorm#24 Firmware update via SFTP

**Warning:** Using unmerged sunset-ota package. This is not a sunset feature until it is approved.

Adding ota readme and hil test. these files have been obtained from the closed PR55 Task: Firmware update via SFTP
Related to Testing brainstorm#37:
- Checking the running partition offset once the ota has been applied
- Function refactoring
- Avoiding temp files for expect script and instead exporting ENV_VARS
- Adding TODO: Repace this heavy scripts with rexpect from crates.io?

Documentation in /ota/README.md updated and including a section on testing
@jubeormk1

Copy link
Copy Markdown
Collaborator Author

The CI does not pass. I have done it again: Apologies.

I will fix the warnings next to get the CI passing. This has to do with the feature flag sftp-ota and unused variables.

When sftp-ota is not included:
- serve.rs::SessionType::Sftp()  variant is not defined
- serve.rs::connection_loop(): events matching subsystem sftp will send to the client a fail
- serve.rs::handle_ssh_client() won't have a matching case for sftp-ota

I believe that commenting out all this code is the most efficient way to act in absence of sftp-ota and causes no more trouble with warnings.

@brainstorm brainstorm left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

🚀

@brainstorm brainstorm merged commit 4f355ad into brainstorm:main Mar 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants