seikan / homebridge-xiaomi-mi-robot-vacuum

XiaoMi Mi robot vacuum plugin for Homebridge.
Other
64 stars 8 forks source link

can't get token #3

Closed philboycn closed 6 years ago

philboycn commented 7 years ago

Hello

I use synology nas server as homebridge server, it has no wifi connet so i can't connet it to the robot's wifi spot. i opened command prompt on synology nas server and input the miio command, it says: Token: ???. is there some other way to get the token?please help,thanks!

seikan commented 7 years ago

Is your NAS server and the robot within same local area network? Try to reboot the robot and try again.

th3cube commented 7 years ago

the problem is, you can't connect directly to the mi-wifi with the synology. you have to install homebridge with the mii command on another computer with wifi. i did it with ubuntu and docker

seikan commented 7 years ago

@th3cube Thanks for clarification, I'm never use a Synology before :)

philboycn commented 7 years ago

@seikan yes,same local network. reboot doesn't help. but your other homebridge-plugin works perfect, like mi-camera and mi-air-purifier.MiAirPurifier, Synology can get the token as well. only robot-vacuum cannot get the token.

@th3cube thanks, i'll try a virtual machine.

philboycn commented 7 years ago

got token with a virtual machine can wifi. but token are different with every homebridge server,so it can't use on pc without wifi...

th3cube commented 7 years ago

the token just changes when you reset the robot. i use it on a synology and it works very well. I also got the token with a different machine and put it into my synology. do not reset the robot again when u get the token...

philboycn commented 7 years ago

@th3cube when i got the token i didn't reset the robot ,i just put it in config.json and reboot homebridge server, it cannot work with homekit.what your step is could you please tell me..thanks

philboycn commented 7 years ago

(node:17) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: Call to device timed out

now i think it is not about the token...

th3cube commented 7 years ago

Here is what i did,

  1. Reset the Robot.

  2. Connect a VM in Bridged-Mode.

  3. Get the Token with a VM directly connected to the WiFi of Mi-Robot with Ubuntu and the Docker Container marcoraddatz/homebridge.

  4. Connect the Robot to your WiFi again.

  5. Import the Token to your config.json, reboot homebridge (note: if you use a docker container on your Syno u must start it fully exposed to your local LAN like --net=host). Lan and Wifi must be in the same subnet.

Hope this helps.

philboycn commented 7 years ago

blocked by VM Docker Container IP setup...i don't know how to setup marcoraddatz/homebridge's ip address to 192.168.8.x...

th3cube commented 7 years ago

First you must set your VM in bridge mode. And the host must be connected to the mi-robot-wifi. Second you must start the docker homebridge container like this

docker run --net=host -i -t YOURIMAGE /bin/bash

the "--net=host" is very important

philboycn commented 7 years ago

Thanks, @th3cube. Tyied everything above, still not working.

When i run cmd miio --discover --sync, node appears wrong message:

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.

philboycn commented 7 years ago

miio homepage, it's seems like a miio bug for vacuum's new firmware..

https://github.com/aholstenson/miio/issues/40

th3cube commented 7 years ago

Yeah, looks like the method no longer works with the new firmware. i got mine with the older version.

Did you try the method with the ios backup?

philboycn commented 7 years ago

@th3cube Yes, Tried. It's Worked.Thanks!

Beastard commented 7 years ago

Hi Guys,

i may have an issue or i did something wrong. Maybe someone can help. I followed this:

  1. Delete Mi-Home app and re-setup my iOS device with the app again.
  2. Created an unencrypted backup of the device on my desktop using itunes.
  3. Installed iBackup Viewer from here: http://www.imactools.com/iphonebackupviewer/
  4. Extracted this file /raw data/com.xiami.mihome/1234567_mihome.sqlite to my computer
  5. Open the file extracted using SQLite Database Browser Portable.
  6. I saw the list of all the devices in my account with their token.
  7. I took the 32 character one in the line for the "Mi Vacuum Cleaner". No other line there.
  8. I copied the token into the config.json like described.

So far so good. But now i get a Syntax-Error: Unexpectet token ... What could be the problem? Thx for your help!

seikan commented 7 years ago

@Beastard Make sure you have at least Node 6 installed. You can run node -v command to confirm that.

Nastras commented 7 years ago

Hello, i have here a detailed instructions as it worked with me has the right token to read out. Maybe it helps you further.

http://forum.smartapfel.de/forum/thread/370-saugroboter-xiaomi-mi-robot-vacuum-token-auslesen/?postID=7021#post7021

Greeting Nastra

xmmwc commented 7 years ago

i got a 92 character token from ios backup with latest version mi-home app, and homebridge can't work with it

Antonix1 commented 7 years ago

Same problem... with iOS backup i got a strange token

schermata 2017-09-08 alle 13 05 24
jwilling commented 6 years ago

Seems like the token is now encrypted by the iOS app. Android still seems to be unencrypted for now, though I can't verify this.

xmmwc commented 6 years ago

i finally got token from android backup

Nastras commented 6 years ago

Hello, here is the solution for iOS decrypting the 92-digit token under variant 1, step 7.

http://forum.smartapfel.de/forum/thread/370-saugroboter-xiaomi-mi-robot-vacuum-token-auslesen/?postID=7021#post7021

Solusan commented 6 years ago

Hello,

I hope you can help me with homebridge-mi-camera

I’m trying to get the token from a Dafang 1080P Camera. http://en.miui.com/thread-953895-1-1.html

I made:

% miio discover sync

Model info: Unknown
Address: 192.168.10.47
Token: ???
Support: Unknown

As you see I cannot retrieve the token info.

Can you help m with it?

Thanks in advance and thanks a lot for your great work, @seikan