-
Notifications
You must be signed in to change notification settings - Fork 354
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
miio --discover node issues #40
Comments
firmware version: 3.3.9_003074, updated 4 days ago.. |
I am a bit surprised that you are getting an auto-token from yours. Mine is hidden and even after a reset, picking up per the instructions, it refuses to update. Device ID: 55355676 miio --update 55355676 --token 496535305450724B695A617537657448 |
Must be an incorrect token @rafale77 . I'm in the same boat, my Mi Robot is still on an older firmware and the app tells me there are no updates available. Running the update CLI command gives me this result.
So this wont force the device to update. I'm guessing Xiaomi is very slowly rolling out the latest updates, especially for user that use the international app. It would be interesting to see if the latest update exposes the token which would make discovery a lot easier. |
I thought so too but I triple checked the token output after the reset and it was correct. I am wondering if the new firmware resets the token again during setup of the device. My-Retina-Macbook:~ XXX$ miio --discover Device ID: 55355676 (node:1482) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Call to device timed out |
From the error you are getting it looks like miio doesn't handle the error properly, which is a bug. The problem comes from that Mi Vacuum is sometimes slow to respond to requests. I've had some issues where it doesn't show up during discovery. I'm guessing this is some sort of optimization done as it runs on battery. And yes, after the setup the device will hide its token. Most newer devices and firmwares seem to do this as a security measure. |
Thanks. So is there a way to extend the timeout so that the token gets saved? Or is the token actually saved locally anyway in spite of the error? Ran another test by extracting the comm from wireshark through the json and I am pretty convinced now that the token changes again when the device (vacuum cleaner) is setup into the account. The token appears invalid as the json does not get decoded. |
I can confirm that the token gets changed when one registers the vacuum into his account so resetting the vacuum cleaner to get the token no longer works with the newest firmware. I ended up making an encrypted backup of my ios device and went to look for the token which recorded in the account file of the app. |
But does it now also expose the token upon discovery, even after registration? If that would be the case it would actually be an improvement. |
I'm not 100% that the token will actually be saved when the error occurs and there is currently no way of increasing the time out without changing the code. The default is to try a call 3 times with 2 seconds between the calls. It's very interesting that the vacuum changes its token when it is registered in the Mi Home app. And bad news for this library. I'll play around with my own vacuum a bit and see if the same is true for the older 3.3.6_003061 firmware, but it'll probably be first next week. |
@jghaanstra |
@rafale77 I'm very much interested in what method you are referring to to obtain the token. Do you have a reference? |
This is what I did using a macos client
|
@rafale77 Is your token working by this way? |
@philboycn ... yes, I would not have posted it if it didn't work. |
@rafale77 Thank you. Worked for me. |
Inspired by @rafale77, I managed to recover a key from My Home app on Android on RPi.
|
@rafale77 Thanks a lot. It worked. So exciting. The token in .sqlite is one digit miss at the first of it. I was plan to try 1 to 0 to complete the token. fortunately succeed at the number 3... Thanks again ! |
I can confirm the last firmware renews the token when I register the vacuum with my phone.
|
Reading the above comments I am not sure if it is fixed or if there is a fix? I am using miio and with a Xiaomi Wifi Smart Plug I get the same error (after a while, seems the device got offline/online): UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 312998): Error: Call to device timed out Any pointers on how to handle the error appreciated. |
Narrowed it bit down by catching the unhandled rejection: Maybe it helps |
I have the same problem on the latest firmware. |
@tibahut I try your method but I can't create a backup without any password (because my device is crypted) I try this
PS: I'm not on windows but on mac but should work... and I'm not root on my phone |
@SebastianDaehnrich Can you tell me the length of your extracted token? It must be 32 hexadecimal characters. It looks like the iOS app stores 96 characters (encrypted token?) now. Can you confirm this? |
@syssi Android side it's still 32 characters |
Luckily, yes! :-) I hope it won't change, too. |
But doesn't change the fact that it doesn't work anymore with latest firmware :( |
I am getting the same issue, firmware 3.3.9_003077 (attempted update today from the iOS app, no new firmware found). The IP is fixed. miio --discover (node:67191) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Call to device timed out miio --update 6464...5 --token 3947........4d78685........f676e Tested with node 8.4 and 6.5. So, I seem to get a token, 32 length, then it says the "token might not be correct". |
@androidand You can try this http://forum.smartapfel.de/forum/thread/370-saugroboter-xiaomi-mi-robot-vacuum-token-auslesen/?postID=7021#post7021 to get the right token. It worked on my device. |
xiaomi vacuum, miio --discover --sync cmd:
Device ID: 55388595
Model info: Unknown
Address: 192.168.8.1
Token: 7a6c4e46553032326c53365374413834 via auto-token
Support: Unknown
(node:94) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Call to device timed out
(node:94) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
please help me out..
The text was updated successfully, but these errors were encountered: