Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.
This repository was archived by the owner on Aug 14, 2026. It is now read-only.

Better software update mechanism #9

Open

Description

@TheGuyDanish

At the moment, deploying the software relies on copying over files via USB which isn't really ideal. In an ideal world, we'd have an option to replace the files on the board without using USB, either by uploading a package to it or by having it fetch the newer version from the internet.

Unfortunately, doing this is quite difficult as the Pico has no means of unarchiving, such as tar or zip, but does have the ability to decompress gzip or zlib-compressed files.

Activity

  1. TheGuyDanish commented on Oct 15, 2024

    @TheGuyDanish
    ContributorAuthor

    This has now been partially implemented. The new CI builds the OpenJBOD Software into a MicroPython image that can be flashed (as a uf2 file) onto the RP2040-based board. This removes the step of uploading files to the board manually.

    The software is extracted at runtime thanks to a change in the _boot.py file that imports the frozen_openjbod package after mounting the filesystem. The aforementioned package is a freezefs archive of the files required to run the software, it unpacks and overwrites existing flash content (excluding config.json) on every boot. This does slightly complicate development as changes made would be overwritten on reset. This can be worked around though.

    While this change simplifies deploying the software package in the first place, it can also be used to introduce remote OTA updates. The frozen_openjbod package is subject to the same hierarchy of precedence as other Python packages. Which is to say, if a frozen_openjbod.py file is placed in the flash root, when the import frozen_openjbod command runs, the file in the flash root is the one to be executed, not the one frozen into the firmware.

    This means OTA software updates could be introduced by:

    1. Allowing the user to upload a software package
    2. Resetting the microcontroller
    3. Letting the uploaded package self extract
    4. Mission accomplished!

    If a malformed software package is uploaded, at best, it would fail to execute, and at worst, it would require the board to be plugged into USB to reflash a valid package. That said, the freezefs extraction process only overwrites existing files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions