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

DIV-33 Update firmware via websocket command #127

Merged
merged 45 commits into from
Apr 23, 2024

Commits on Apr 4, 2024

  1. Configuration menu
    Copy the full SHA
    aabb427 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    333ac8d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c3e331d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ccd94c9 View commit details
    Browse the repository at this point in the history
  5. Use libp2p/zeroconf

    This is a fork of grandcat/zeroconf. It is better maintained and running the
    discovery command seems more robust with this version.
    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    71b4137 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c3f027f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fb1a472 View commit details
    Browse the repository at this point in the history
  8. Add more messages

    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    262aadd View commit details
    Browse the repository at this point in the history
  9. Wait 10 seconds for tcp connection teardown

    Otherwise SendDFU might fail, as cancelling the connection doesn't take
    effect immediately.
    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    94b819a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0e9025a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    85bc280 View commit details
    Browse the repository at this point in the history
  12. Allow Discovery and GetStatus commands while updating firmware

    The do not interfere with the firmware update, but can be relevant for
    the client.
    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    a23e6c3 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    4201904 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    03b962d View commit details
    Browse the repository at this point in the history
  15. Do not abort discovery when device serials don't match

    The discovery function gave up immediately when it encountered a
    serial that didn't match the expected one, instead of continuing
    to look. This is problematic if there are multiple Sensos on the network.
    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    bd1fa13 View commit details
    Browse the repository at this point in the history
  16. Refactor discovery code

    This helps simplify update logic, makes it easier to determine what mode
    the discovered Sensos are in, and simplifies including Sensos both in
    normal and bootloader mode in the discovery results sent to the client.
    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    c7608d7 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    8e57f6b View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    38c2516 View commit details
    Browse the repository at this point in the history
  19. Simplify code

    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    340ba57 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    66d2bb8 View commit details
    Browse the repository at this point in the history
  21. Reduce timeouts

    Stress testing after the refactor indicates that this is sufficient.
    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    b7338d8 View commit details
    Browse the repository at this point in the history
  22. Fix build

    Switching to libp2p/zeroconf introduced a transitive dependency not compatible with older go versions.
    krksgbr committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    6da5b8b View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. Configuration menu
    Copy the full SHA
    0aac1a1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7252777 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c66c09c View commit details
    Browse the repository at this point in the history
  4. Encapsulate state management in firmware module

    Ensures privacy of state internals.
    krksgbr committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    22f6e33 View commit details
    Browse the repository at this point in the history
  5. Update changelog

    krksgbr committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    28fe54e View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2024

  1. Improve clarity of firmware update message

    Co-authored-by: Johannes Emerich <[email protected]>
    krksgbr and knuton authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    ccb18c5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b806116 View commit details
    Browse the repository at this point in the history
  3. Allow 60 seconds for mDNS discovery

    Devices try waiting for an IP via DHCP for ~30 seconds before
    assigning themselves a link-local address, so in our typical
    setup they are only going to announce services around 30 seconds
    after the physical link is established. 60 seconds should be
    more than enough.
    krksgbr committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    8097df3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a59e24e View commit details
    Browse the repository at this point in the history
  5. Fix TFTP send fail message

    It should report the delay time for `attempt`, rather than `attempt+1`.
    `attempt` is still being reported as `attempt+1` for user-friendliness.
    krksgbr committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    5bb2e6d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7349c61 View commit details
    Browse the repository at this point in the history
  7. Remove unused nix files

    This were deleted in dividat#129, but were resurrected when merging main into
    this branch.
    krksgbr committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    5f03ddf View commit details
    Browse the repository at this point in the history
  8. Format file

    krksgbr committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    b335212 View commit details
    Browse the repository at this point in the history
  9. Increase wait time before attempting TFTP transfer

    This seems to improve robustness.
    
    Background:
    
    After rebooting to bootloader mode, the Senso needs some time
    to start the TFTP service. Experimentation has shown that a
    premature a TFTP write request to the Senso can potentially cause it
    to enter a non-responsive state. The Senso can only be recovered from
    this state via power-cycling. Sometimes even re-flashing the firmware
    via USB may be necessary.
    
    The previous 5 second wait already mitigated the risk quite well, but
    during a stress test of performing back-to-back updates, the TFTP transfer
    failed during the ~50th run. With a 10 second timeout, over 200 back-to-back
    updates were performed successfully before shutting down the test script.
    krksgbr committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    ffa7b58 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. Configuration menu
    Copy the full SHA
    1233e05 View commit details
    Browse the repository at this point in the history
  2. Remove firmware update by fixed address

    Make mDNS a requirement to run firmware updates. Reasoning:
    
    - mDNS is used by 99% of installations
    - The robustness of the update mechanism hinges on the insight into
      peer state provided by the mDNS records
    - We can focus our resources on making this one mechanism work well
    krksgbr committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    8743fda View commit details
    Browse the repository at this point in the history
  3. Communicate power cycling suggestion only when updating via CLI

    Leave it up to applications on how to communicate failure.
    krksgbr committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    cb649fc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0121d02 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    80dfde6 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Configuration menu
    Copy the full SHA
    81d9acd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ad56fd2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8e0e4a7 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Refine vocabulary and punctuation of firmware update messages

    Co-authored-by: Johannes Emerich <[email protected]>
    krksgbr and knuton authored Apr 22, 2024
    Configuration menu
    Copy the full SHA
    57b821c View commit details
    Browse the repository at this point in the history