Add firmware update support: gRPC check, OSS download, GAIA BT delivery (VR-N76 tested)#25
Open
repins267 wants to merge 15 commits into
Open
Add firmware update support: gRPC check, OSS download, GAIA BT delivery (VR-N76 tested)#25repins267 wants to merge 15 commits into
repins267 wants to merge 15 commits into
Conversation
- firmware.py: gRPC check_update (rpc.benshikj.com:800, benshikj.APP/CheckUpdate) - firmware.py: download_firmware (OSS patch + base zip, bsdiff4 assembly) - firmware.py: FirmwareBundle with md5_tail for UPDATE_SYNC_REQ - scripts/test_firmware.py: dry-run test, verified against captured v0.9.3-7 patch md5: 878b35b8e06d3465484ea0ace669de62 base md5: 74b6d097d8d2d9d2d9fac88133198a08 firmware md5: 0c0d095da50bebe664822adcb244834a md5_tail: b244834a OSS URLs (v147): patch: .../firmware/v147/patch_base_to_vr_n76.bin base: .../upgrade_base_v1.bin.zip Closes layers 1+2. Layer 3 (GAIA BT delivery via VM RFCOMM UUID 00001107-D102-11E1-9B23-00025B00A5A5) is next.
Implements the VM_CONTROL state machine for flashing assembled firmware over the existing RFCOMM command connection: Phase 1 (transfer): VM_CONNECT -> UPDATE_SYNC_REQ -> UPDATE_START_REQ -> UPDATE_DATA_START_REQ -> [device-driven chunk loop via UPDATE_DATA_BYTES_REQ] -> UPDATE_IS_VALIDATION_DONE_REQ -> UPDATE_TRANSFER_COMPLETE_RES (radio reboots) Phase 2 (confirm, after reconnect): VM_CONNECT -> UPDATE_SYNC_REQ -> UPDATE_START_REQ (GOTO_NEXT_STATE) -> UPDATE_IN_PROGRESS_RES -> UPDATE_COMPLETE_IND -> VM_DISCONNECT Key design notes: - Works over the existing RFCOMM command channel (no separate socket) - VMU_PACKET replies arrive as BT_EVENT_NOTIFICATION (ExtendedCommand 16387) - Chunk size is device-driven via n_bytes_requested; n_bytes_skip supports resume - Best-effort UPDATE_ABORT_REQ sent on error - Tested with VR-N76 V0.9.3-7 firmware (md5_tail: b244834a) Companion to firmware.py (layers 1+2: gRPC check + OSS download + bsdiff4 assemble) Refs: benlink issue khusmann#10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements firmware update across three layers for the VR-N76 (and likely other Benshi radios):
firmware.py— Layer 1 (gRPC check viabenshikj.APP/CheckUpdate) + Layer 2 (OSS download + bsdiff4 assembly). Standalone-importable without bleak.firmware_updater.py— Layer 3:FirmwareUpdaterstate machine for GAIA BT delivery over the existing RFCOMM command connection.scripts/test_firmware.py— dry-run test (--local,--check,--fullmodes)Layers 1+2 verified against V0.9.3-7 firmware (all MD5s match).
Layer 3 structurally complete; live radio test pending.
Refs: #10