merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
390 stars 61 forks source link

handshake timeout #265

Closed sadanro100 closed 2 years ago

sadanro100 commented 2 years ago

Everything was fine until I decided to setup my ISP modem and Apple Time Capsule in bridge mode, now for some reason I've been getting the error below.

I've updated the device's ip in the plugin (which obviously changed because I started using the Time Capsule to attribute ips) and checked the token is still the same using the plugin's tool to fetch devices info from the Mi Cloud.

Any other ideas?

[4/27/2022, 11:20:09 PM] [miot] [Aspirador] (Protocol) Start handshake 10.0.1.5 [4/27/2022, 11:20:13 PM] [miot] [Aspirador] Error: Could not connect to device, handshake timeout [4/27/2022, 11:20:13 PM] [miot] [Aspirador] Could not connect to the device! Retrying in 40 seconds!

merdok commented 2 years ago

Handshake timeout means pretty much that the token or ip is wrong and the plugin cannot connect to the device. Make sure those are correct!

sadanro100 commented 2 years ago

I've double checked them both several times. They're all correct. Still getting timeout I'm afraid. I doubt it has anything to do with IP/token

merdok commented 2 years ago

The handshake timeout error like i already mentioned means that the plugin cannot connect to the device. The most common causes are wrong ip or token. It might also be that your device is simply not reachable in your network for some reason.

sadanro100 commented 2 years ago

I am able to ping its IP from my raspberrypi, where Homebridge is running.

merdok commented 2 years ago

Then your token is most probably incorrect.

sadanro100 commented 2 years ago

I'm using the same token as before I changed my network architecture which worked, I checked it towards the info fetched by the plugin from the MiCloud and it hasn't changed.

Is there a chance it's wrong in the MiCloud?

merdok commented 2 years ago

I certainly already had cases where the token in MiCloud was outdated for some reason...

sadanro100 commented 2 years ago

If that's the case, any idea how to fix that?

merdok commented 2 years ago

Try to reset the device and re-add it to the xiaomi home app, other then that you would need to use some manual methods to retrieve the token.

sadanro100 commented 2 years ago

I wanted to avoid that otherwise I'll have setup all my rooms and ids again, but I guess there'll be no other way around it. Thanks

sadanro100 commented 2 years ago

It actually worked! Surprisingly it kept the map, rooms ids and everything else. Thank you very much.

merdok commented 2 years ago

Glad it works now!