aholstenson / miio

Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more
MIT License
1.87k stars 354 forks source link

Cannot connect to light after configuring wireless network #319

Open xMaciekMx opened 3 years ago

xMaciekMx commented 3 years ago

Hi, I've spent the last few hours trying to connect to my yeelink.light.color5. When I'm connected to light's own wifi network, everything works fine.

I've saved token and then configured light to connect to my everyday 2.4GHz wireless network. After that, I cannot connect to it. I've inspected requests with Wireshark, and I see that the first request is 32 long, then my pc gets the response that is 32 long too, then It starts retrying process, after which it fails.

What might be wrong?

ofen commented 3 years ago

It's possible that after connecting to wireless network with internet access the device regenerates it's token and send it to Xiaomi cloud for future use (similar behavior as pet-drinking-fountain). You can use https://github.com/Squachen/micloud#in-terminal (may requires to set --country cn) to check that token actually changed.

https://github.com/aholstenson/miio/issues/93#issuecomment-529639069