rand256 / valetudo

Valetudo RE - experimental vacuum software, cloud free
Apache License 2.0
666 stars 73 forks source link

Robot/MiIO connection breaks after a few restarts and WiFi credentials changes #406

Open Ennar1991 opened 3 years ago

Ennar1991 commented 3 years ago

I noticed after demonstrating the vacuum to a friend at his house: after changing the WiFi to my mobile phone's hotspot, and then back, that the webpage constantly displays that it has failed to load the interface configuration. A bit of poking around in the logs revealed that somehow the connection between dummycloud and valetudo might be broken:

tail /var/log/upstart/valetudo.log 2021-03-28T04:42:43.630Z Dummycloud is spoofing 203.0.113.1:8053 on 127.0.0.1:8053 2021-03-28T04:42:43.636Z Webserver is running on port 80 (http) 2021-03-28T04:43:09.315Z Failed to get response for message: get_status [] { retries: 25, retriesHS: 30 }

netstat -a reveals that valetudo opens the port, but it is not forwarded to the spoof IP: udp 0 0 localhost:8053 :

The port vanishes from the list when I stop the valetudo service.

I can't add the routing manually with ip route add 203.0.113.1 via 127.0.0.1 as in the modified rc.local file, the response is: RTNETLINK answers: File exists

Is there a way to salvage the robot, or do I have to re-root it?

Vacuum Model: Gen1

Valetudo Version: 0.10.5

Ennar1991 commented 3 years ago

I ended up re-installing everything on the vacuum. However this seems to be predictably reproducable by changing the WiFi config, and rebooting the device a few times. I will try to find out what exactly is changing in the system.

Edit: It seems to happen whenever you break the connection between the dummycloud and valetudo/the rest of the system, whether by accident, or on purpose. By changing around the wifi credentials, and stopping the rrwatchdoge service for a few minutes you can sort-of provoke it. I'm not exactly certain what exactly causes it yet.

The WiFi status LED flashes fast, indicating the robot is not connected to the cloud.

Edit 2: It seems you can save the robot by forcing an update to the same firmware you flashed initially. The files in /mnt/data like your map, settings and speech files are safe, but additional tweaks made in /opt/rockrobo are obviously gone then.

Ennar1991 commented 3 years ago

Another small update. It happened again after a long disconnect, resetting and re-entering credentials. Replacing the entire /etc folder from the backup at /mnt/updbuf/etc fixes the connection issues. When it happens again, I will investigate which files are different.