Skip to content
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

No response from the device on Xiaomi Roborock v2 #349

Closed
sgtio opened this issue Jun 23, 2018 · 11 comments
Closed

No response from the device on Xiaomi Roborock v2 #349

sgtio opened this issue Jun 23, 2018 · 11 comments

Comments

@sgtio
Copy link
Contributor

sgtio commented Jun 23, 2018

I'm trying to set up a Xiaomi roborock v2 and use it through home-assistant. However, I can't get it to work, so perhaps I'm doing something wrong.

I have extracted the pairing token by resetting the wi-fi in the device. I have used both the mirobo cli tool (with the --authenticate flag) and netcat to retrieve the token, just to confirm that it's correct. However, after confiiguring the robot through the Mi App to conect it to my wi-fi, I can't interact with the vacuum cleaner through the cli tool. From what I can see, it looks like the cli tool sends a HELLO message, which the vacuum cleaner answers, and then sends something else with goes unanswered?

Here is a capture with wireshark. I have highlighted the response from the vacuum cleaner:

  • IP of the vacuum cleaner: 192.168.10.118
  • IP of my host: 192.168.10.100
➜  ~ export MIROBO_IP=192.168.10.118
➜  ~ export MIROBO_TOKEN=524179706b483355455a4d41736a3071
➜  ~ mirobo
ERROR:miio.device:Got error when receiving: timed out
Error: No response from the device

Hello from cli tool:
query-hello

Response from vacuum cleaner:
response-hello

Unanswered packet:
unanswered-query

So, is there anything I'm doing wrong?
I have stored the wireshark pcap file, so if anybody needs it, please let me know.

Thanks for the help!

EDIT: Added headers to screen captures

@rytilahti
Copy link
Owner

When you provision the device through the mobile app, the device is generating a new token, so you have to obtain the token again after adding it through the app.

@sgtio
Copy link
Contributor Author

sgtio commented Jun 23, 2018

That was what I tried in the first place, but all I got was the token composed by all 'f'. I read that this token was received because the robot was already paired, and the token retrieval needed to be done before the pairing with the Mi Home app. I also tried downgrading the app to 5.0.0, to extract the token from the app. Unfortunately it seems like that version of Mi Home is not able to discover the vacuum cleaner.

@sgtio
Copy link
Contributor Author

sgtio commented Jul 5, 2018

I have been reading a bit this issue: #185

Simulating the app from here seems like a plausible solution, but I wanted to ask if someone has tried messaging Xiaomi. Perhaps if enough of us send emails asking them for a way to extract the token, they will comply?

@J-CMartin
Copy link

I've used Method 3 for Non-rooted Android from the site below and was able to get the token properly.

https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/obtain_token.md

The only think that is not mentioned there is the fact that newer versions of the software don't store the token, so version 5.0.29 has to be used:
https://www.apkmirror.com/apk/xiaomi-inc/mihome/mihome-5-0-29-release/

After getting the token from the DB, it all worked fine.

@sgtio
Copy link
Contributor Author

sgtio commented Jul 6, 2018

Yeah, I installed the old version of the app and reset the robot. Unfortunately, the app could not find the robot, so I could not initiate the pairing.

@J-CMartin
Copy link

I don't think you need to pair via the old app necessarily, I've installed the app and signed in to my Xiaomi account, the Robot was already there... AFAIK the difference is that the old App stores the Token locally and the new ones don't.
I tried with version 5.0.0 on a different phone first but the backup was empty, not sure if it was the phone or App version, but then tried the 5.0.29 version and it worked

@sgtio
Copy link
Contributor Author

sgtio commented Sep 9, 2018

OK, finally I have some more time to play with this. I have done the pairing with the new app using the european servers, but the old app only allows you to connect to the server in China (maybe also the US) so perhaps I need to go through the onboarding procedure using the server in China (with the new app) and then install the old app. I'm going to give it a quick try and will write back with the results.

@sgtio
Copy link
Contributor Author

sgtio commented Sep 9, 2018

Well, nope, that didn't work either. I started up the new app and selected the US server (which is also available in the old app). Paired the robot with the new app and then uninstalled it and installed the old version. Then, I started the old app, selected the US server and signed up. The robot was not there.

Also, I checked the fw version of the vacuum cleaner: 3.3.9_001412

@sgtio
Copy link
Contributor Author

sgtio commented Sep 15, 2018

Ok, I got it working. There were two catches I was missing:
One of them is that, despite the device not showing up in the app interface, it actually downloads the token into the database.
The second catch is that you need to select the same server on the old app as with the new app. Since the Europe server is not available in the old app, it can't be used.

So thanks everyone for their help!

@sgtio sgtio closed this as completed Sep 15, 2018
@rytilahti
Copy link
Owner

Glad to hear you got it working :-) If you don't mind documenting this somehow to the documentation, it would be appreciated!

@sgtio
Copy link
Contributor Author

sgtio commented Sep 15, 2018

Absolutely! I'll publish a patch ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants