Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add software update capability #709

Merged
merged 39 commits into from
Jul 15, 2024
Merged

Commits on Jul 11, 2024

  1. Implement Update check using DCL software information

    Check if there is a software update available using DCL software update
    information.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    612b867 View commit details
    Browse the repository at this point in the history
  2. Initial implementation of OTA provider

    The OTA provider downloads the updates and prepares them so Matter
    devices can consume them.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    17f9f54 View commit details
    Browse the repository at this point in the history
  3. Implement update using OTA Provider app

    Use the OTA Provider example app to implement a OTA provider. The
    example app supports a JSON update descriptor file to manage update
    metadata. Tested with the OTA Requestor app.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    2bab7e3 View commit details
    Browse the repository at this point in the history
  4. Setup OTA Provider App automatically when necessary

    Start and commission OTA Provider App when necessary. Use random
    discriminator and passcode. Store the Node ID of the OTA Provider
    App once setup for fast re-use.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    9d7717f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ee82e39 View commit details
    Browse the repository at this point in the history
  6. Check if DCL software updates are indeed applicable

    Verify that the DCL software update is indeed applicable to the
    currently software running on the device. Add test coverage as
    well.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    1cf634b View commit details
    Browse the repository at this point in the history
  7. Introduce hardcoded updates

    Add global check for update where we can insert hardcoded updates or
    updates from other sources in the future.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    f698b51 View commit details
    Browse the repository at this point in the history
  8. Split update WebSocket command into two commands

    Make check_node_update a separate WebSocket command which only
    checks for updates. The update_node command then will download
    and actually apply the update.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    93f3894 View commit details
    Browse the repository at this point in the history
  9. Introduce Update logic specific exceptions

    Add Update specific exceptions and raise them where appropriate.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    09a4469 View commit details
    Browse the repository at this point in the history
  10. Implement OTA checksum verification

    Add capability to verify the checksum of the OTA file while
    downloading it.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    e1a5941 View commit details
    Browse the repository at this point in the history
  11. Add client commands for updates

    Add two new client commands to check for updates and trigger the
    update.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    116077d View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    5b41888 View commit details
    Browse the repository at this point in the history
  13. Improve OTA Provider handling

    Create log files for each OTA Provider run. Improve setup and
    commissioning of the OTA Provider.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    4b0911c View commit details
    Browse the repository at this point in the history
  14. Move almost all update logic into ExternalOtaProvider

    Most update logic is related to the external OTA provider (like
    commissioning and configuring it). This commit moves most of the
    update logic into the ExternalOtaProvider class.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    70e9b60 View commit details
    Browse the repository at this point in the history
  15. Update implementation to work with latest refactoring

    Make use of the new ChipDeviceControllerWrapper to communicate with
    the device directly. This avoids unnecessary node interviewing and
    showing up on the controller side.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    c67c850 View commit details
    Browse the repository at this point in the history
  16. Simplify ExternalOtaProvider

    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    e4bbc47 View commit details
    Browse the repository at this point in the history
  17. Support specific version by string

    Support updating to a specific software version by string. This requires
    fetching all versions one by one, but is much more user friendly. The
    code still checks that all restrictions are met (min/max version, etc).
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    be9ee65 View commit details
    Browse the repository at this point in the history
  18. Use ephemeral OTA Provider instances

    Instead of trying to reuse the same OTA Provider instance for multiple
    OTA requests, create a new instance for each request. This is easier
    to implement and also allows parallel updates.
    
    Because the OTA Provider is now ephemeral, we need to commission it on
    every update. But this is quick and reliable, so not a big deal.
    
    To support multiple updates at once, we need to make sure the OTA
    Providers use a distinct Matter port (hence passing 0) and distinct
    node ids. The current implementation simply uses the target node id
    plus a fixed offset. Since a single node can only run one update at a
    time, this is sufficient.
    
    Furthermore, some updates seem to have a difference in reported
    versionNumberString value in the DCL vs. what is actually in the OTA
    metadata. Specifically Eve updates from the Testnet DCL are such
    updates (e.g. 3.2.0 vs 3.2.6705). When using the OTA Provider with the
    --otaImageList option, this discrepancy is an issue and causes OTA
    Provider to abort.
    
    Using the single OTA update per OTA Provider instance allows us to use
    --filepath, which doesn't check the versionNumberString.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    3c33d5f View commit details
    Browse the repository at this point in the history
  19. Raise update error if the node moves from querying to idle

    When the node's UpdateStateEnum changes from Querying to Idle it
    means the update file did not get processed. This could be due to
    temporary network issues or the update file not being honored by the
    target node.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    07b8254 View commit details
    Browse the repository at this point in the history
  20. Improve logging and use Future to mark completion

    Instead of using an Event use a Future to mark completion of the update.
    This allows to set an Exception in case we see update state transitions
    which are unexpected (specifically kQuerying -> kIdle).
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    02d43d6 View commit details
    Browse the repository at this point in the history
  21. Make sure that only one updates is running at a time

    Running multiple updates on the same node doesn't make sense. This
    should be mostly handled by the client/UX. But we do check on server
    side for the critical path.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    56d5b06 View commit details
    Browse the repository at this point in the history
  22. Use new commissioning API

    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    2f535aa View commit details
    Browse the repository at this point in the history
  23. Ignore when there is no software version info on DCL

    Don't raise an exception when there is no software version info on DCL.
    It is perfectly fine to operate such nodes. An informational message is
    good enough for this case.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    683b33f View commit details
    Browse the repository at this point in the history
  24. Add MatterSoftwareVersion model for check_node_update

    Use a new model MatterSoftwareVersion to store the software version
    information typically fetched from DCL for the Matter nodes.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    76ed950 View commit details
    Browse the repository at this point in the history
  25. Bump Server schema

    We've added new commands, so a schema version bump is needed.
    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    475a1dc View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    23a6e6b View commit details
    Browse the repository at this point in the history
  27. Bump OTA Provider to 2024.7.1

    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    b0dca4b View commit details
    Browse the repository at this point in the history
  28. Use new node logger

    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    87cd0a4 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    7e7537b View commit details
    Browse the repository at this point in the history
  30. Apply suggestions from code review

    Co-authored-by: Marcel van der Veldt <[email protected]>
    agners and marcelveldt authored Jul 11, 2024
    Configuration menu
    Copy the full SHA
    7a30700 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    07e20dd View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    b057eae View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    09c92f7 View commit details
    Browse the repository at this point in the history
  34. Fix trailing whitespace

    agners committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    57fb7d2 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. Fix tests

    agners committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    9ad2348 View commit details
    Browse the repository at this point in the history
  2. ruff format

    agners committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    507a429 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2024

  1. Configuration menu
    Copy the full SHA
    39f025e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    51bec82 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d4162fe View commit details
    Browse the repository at this point in the history