Open btsimonh opened 3 years ago
Are they all the same? Maybe different software version ?
they came in one package... but how to tell...
implementation of flasher is not complete. xiaomi uses 2 command formats. Some time ago I makeed implementation for scooters (kotlin for android). If you have any questions you can contact me.
@majsi - you have a repo with a modified version? I can try it and see?...
ok, I think it's two things. 1/ doGenerate() should wait until the key is made - if can make the key after sending. tested with 'stupid' code:
doGenerate();
setTimeout(()=>{
mainCharSend("a2000000", enc_10);
}, 1000);
2/ these devices have a pairing button; It seems this may need to have been 'long pressed' before connect, and that activation must happen within a few seconds of the long press.
Now got my next key, will try the third device.
s
yes so for device MCCGQ02HL: go to universal flashing page. Long press the button on the device (3 quick flashes of LED), quickly connect, then activate. The above is a bug in the page - but probably has little effect as i'd expect the key to be ready before it's needed, but it's not guaranteed.
@btsimonh can you try this app? https://drive.google.com/drive/folders/18yTESidmA5bGY7Xrf20H8avtT2PguaBN?usp=sharing
they work fine as long as you long-press before trying (and then do it quickly). Of course, in a browser we can't yet hear adverts - there is info in there which would tell us when to connect and activate, but we can't see it at the moment.
What I really need now is a firmware update? Mine don't send regularly, and mi home does not see them either (not in the supported list - may be geographic :( ).
The door sensors worked fine for me, but I couldn't get motion sensors (RTCGQ02LM) to activate at all.
Looking at the log, the motion sensor got stuck after one more step, after 15000000 it also sends 000000030400 and then nothing.
The code received no incoming message in the state == 1
condition, so I just did the stupidest thing imaginable and added a little setTimeout
"as if that thing arrived" i.e. for the state = 2; mainCharSend("0100" + own_public_key.substring… these nested 0200 0300 0400 things)
code, right when it sets state = 1
(line 198, i.e. the second send of 000000030400).
Somehow that worked. For one device anyway. Trying to do that on a second identical RTCGQ02LM did not work. What even was that?
I had the same problem with my Mi scooter getting stuck after key exchange, but I got it figured out. Yes, a button (power button) has to be pressed, but was not enough to press it before running the authorization. A 100% reliable way to do it is:
->15000000
) disconnect (receive timeout)You can find my Python package for Mi authentication here: https://github.com/dnandha/miauth. Would be interesting to know if it also works for door and motion sensors, because then this logic could also be adapted for the TeLink Flasher and other projects.
Hi atc1441,
I have three MI door sensors, and I'm using your universal version. It got the keys for the first one no problem, but the other two just stall at activation.
Any clues?
s
console log: