Add V2 region public-key recovery from SHA-384 signatures - #84
Conversation
|
Hello! This is a branch I'm going to use to attempt to get V2 working. I was able to get this (seemingly) working from a board I sent to @dgiese who was able to do a firmware dump for me with his equipment. My board is still with Dennis so I cannot do the real hardware test myself. It may not work on the first go. Rather than waiting, I'm hoping one of you is able to and we can iterate from there. I'm pinging everyone who has offered to help. (Sorry for the mass ping) @Flash1232 @fhaala @Kombustor @ppluciennik @181207 @pieterbos @calebsw83 @manukurusu @IIgorrrrr You can point an agent at this or do it yourself :) Testing steps for this PR (Docker Compose) This is an experimental test of the V2
|
|
Just from a quick initial test: I've updated my stack (deployed on HA, custom fork repo with this branch) and ran the onboarding again (with your exact branch). So far it again seems to only reach /region as was the case before. Multiple rounds, no query samples. Samples don't increase, pubkey not restored. Do I have to clean some state as I can still see 4 header_samples (presumably from the last attempts)? In that case, I will just clean the decompiled jsonc file. Or am I misunderstanding what to look out for? Glad to assist with anything if there's need. |
|
Thanks for testing it out @Flash1232 First thing I would check is that the HA is using the right image/tag. The add-on config points towards an image and I worry it is still using the old code. After a attempt, does a new entry appear in header_samples in device_key_state.json? Can you send the version, method, path, signature_len, query, nonce, and ts? As well share the recovery dict in that same file? |
|
Could you maybe publish the home assistant build for 22943d8 (or later if you updated), and update the tag in the config for the home assistant app/add-on in your branch? It should the be possible to add the custom repository in home assisant, by using https://github.com/Python-roborock/local_roborock_server#<branch_name> , as documented in https://developers.home-assistant.io/docs/apps/presentation/#offering-stable-and-canary-version I am happy to test, but I need a second computer, and home assistant is the easiest way to accomplish that at the moment for me. Otherwise I have to setup a second Arm single board computer - I have one lying around somewhere, but it'll take longer before I can make time to set that up. |
|
Yes! @pieterbos good idea. I merged this PR and will do the rest later tonight |
|
Should be the correct version. The Oddly enough, "header_samples" stays empty/ as-is even though I can clearly see v2 /region requests (same as those I shared initially in the Saros 20 Sonic ticket) in the decompiled jsonc file. I tried manually emptying the "header_samples" in the device key state json but it made no difference. But as you've figured out the correct format, I was able to manually get the public key from those decoded payloads which I could manually insert it into the json. Unfortunately, even though the onboarding web view now says "ready" and I ran another cycle, the robot didn't connect (no NC_Prepare). Maybe I should try a completely blank slate and re-import from cloud first again. Will try this in the coming days if nobody else did already. Thank you again for all your efforts! |
|
Hmm maybe i'm missing some of the routing logic for v2/ I still have some of my placeholder logic that discards v2 data... I'll take a deep looker. For now, I have published a beta version - will be helpful going forward. it is "Roborock Local Server Beta" you may have to refresh your apps page @pieterbos @Flash1232 Trying to think through this - can you check that modulus_hex is under the right DID, did you try restarting the addon. What does the region look like in decompiled_http.jsonl? |
|
It recovered the public key with 2 header samples. Took 335 seconds, as this was running on an Odroid N2 (+?) Arm board, on a single core. This is a QRevo Edge 2 Set, The second pairing cycle however does not finish. It does record a POST to /nc. I see no working MQTT Connection. Do you need any more information? I'll leave the server running, but will reconnect my vacuum to the normal app for now :) (this log is in Local time, so 2 hours ahead of other timestamps) |
|
Firmwre v02.15.44. Let's encrypt certificate. I can try another one, but I assume this is not the problem as it completed some succesful requests. |
|
@pieterbos TY. I was being overly optimistic on the changes I needed to make, but this is good progress. We are building the public key which is great. I published a new pre release version, give it a try? I believe the issue is that the request uses multipart on your device. |
No description provided.