Conversation
Add HMAC + AES bootstrap so Q7 (roborock.vacuum.sc05, B01) devices can
onboard against the local server. The firmware signs /b/region and /b/nc
with its per-device secret and expects an AES-encrypted response, so the
server must hold that secret to reply in a form the firmware accepts.
- b01_bootstrap: request-signature verification, AES region/NC responses,
and MQTT credential derivation, from the firmware contract
- b01_import: import a device's secret/DUID into state/b01_devices.json
- server: route /b/region and /b/nc to the B01 handler
- runtime_credentials: resolve rr/d/i/{duid}/... topics by DUID (not DID)
so B01 MQTT frames decode with the correct localkey
- tests + docs
Validated end to end on a Q7 M5+: onboarding, region/NC, MQTT connect,
and inbound B01 frame decode via python-roborock. Outbound command/map
handling is the next step; the RSA-4096 (v2) request branch is out of scope
and returns 501.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Lash-L
force-pushed
the
feat/q7-b01-local-bootstrap
branch
from
September 23, 2026 17:45
ae53821 to
f47d062
Compare
Lash-L
marked this pull request as draft
September 26, 2026 00:47
Lash-L
commented
Sep 26, 2026
| @@ -0,0 +1,64 @@ | |||
| # Q7 (sc05 / B01) local bootstrap | |||
This branch has not been deployed
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.
What
Adds local-server support for the Roborock Q7 family that speaks the B01
bootstrap protocol (
roborock.vacuum.sc05).Unlike the V1 flow, the Q7 authenticates its bootstrap requests with an HMAC over
the device's per-device
secretand expects an AES-encrypted response, so theserver must know that secret to answer in a form the firmware accepts.
Changes
b01_bootstrap.py— request-signature verification, AES/b/regionand/b/ncresponses, and MQTT credential derivation, all from the firmware contract.b01_import.py— import a device'ssecret/DUID intostate/b01_devices.json(refuses to overwrite a different secret for an existing DID;
data/stays git-ignored).server.py— route/b/regionand/b/ncto the B01 handler.runtime_credentials.py— resolverr/d/i/{duid}/…topics by DUID ratherthan DID, so B01 MQTT frames decode with the correct localkey. (One-line fix; the
old code matched a DUID string against the DID field and returned the wrong key.)
test_b01_bootstrap.py,test_b01_import.py) anddocs/q7_b01.md.Validation
Verified end to end on a real Q7 M5+: onboarding →
/b/region+/b/nc(AES) → MQTT TLS connect → inbound B01 frames decode via python-roborock
(
create_mqtt_decoder, e.g. OTA version and consumable status).tests/test_b01_bootstrap.py tests/test_b01_import.py— 25 passed.Scope / follow-ups
this PR; the inbound decode path is wired, outbound encoding is the next step.
v: v2) request branch is out of scope and returns 501.🤖 Generated with Claude Code