Valetudo icon indicating copy to clipboard operation
Valetudo copied to clipboard

Random firmware reset

Open xoxys opened this issue 7 years ago • 370 comments

Hi, im running valetudo 0.3.1 and today robo was not accessable, so i restarted the robot and after that he was back with default AP. No ssh connection possible und no valetudo available at port 80.

So maybe this is not fixed?

xoxys avatar May 02 '19 10:05 xoxys

There were some commits for the upstart config which could possibly fix this.

You might want to try those

Hypfer avatar May 02 '19 10:05 Hypfer

How does the upstart fix Firmware resets?

xoxys avatar May 02 '19 10:05 xoxys

Do you mean 6fd1be698a990e0746fa9eec460734fc8cdfd761?

xoxys avatar May 02 '19 10:05 xoxys

There is some kind of error counter somewhere in the roborock software which reverts to the previous firmware if it reaches a certain value.

I have no idea where it is and what causes it to increment, but I assume that going OOM is one thing that might do it.

https://github.com/Hypfer/Valetudo/commit/91088195f869d6d6f96bb612770e3bcc7a1d00b8 contains some mitigations against memory leakage which causes the player process to be killed.

Hypfer avatar May 02 '19 10:05 Hypfer

Thanks for clarification :) I'll give it a try. First I have to re-flash the firmware to get back control over the robot...

xoxys avatar May 02 '19 11:05 xoxys

Robot is back to life, lets see what happens.

xoxys avatar May 03 '19 17:05 xoxys

This morning robot was not reachable and wlan led was off. So I decide to reboot, after that robot was reconnecting to wifi and NOT reseted. So there seems to be another problem. valetudo log contains:

Loading configuration file: /mnt/data/valetudo/config.json^M
Dummycloud is spoofing 203.0.113.1:8053 on 127.0.0.1:8053^M
Webserver running on port 80^M
events.js:183^M
      throw er; // Unhandled 'error' event^M
      ^^M
^M
Error: getaddrinfo EAI_AGAIN mymqtt.example.com:8883^M
    at Object._errnoException (util.js:992:11)^M
    at errnoException (dns.js:55:15)^M
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)^M
Loading configuration file: /mnt/data/valetudo/config.json^M
Dummycloud is spoofing 203.0.113.1:8053 on 127.0.0.1:8053^M
Webserver running on port 80^M
events.js:183^M
      throw er; // Unhandled 'error' event^M
      ^^M
^M
Error: getaddrinfo EAI_AGAIN mymqtt.example.com:8883^M
    at Object._errnoException (util.js:992:11)^M
    at errnoException (dns.js:55:15)^M
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)^M

and boot.log:

 * Stopping flush early job output to logs^[[74G[ OK ]^M
 * Starting configure virtual network devices^[[74G[ OK ]^M
 * Stopping System V initialisation compatibility^[[74G[ OK ]^M
 * Starting system logging daemon^[[74G[ OK ]^M
^M
dnsmasq: unknown interface wlan0^M

xoxys avatar May 04 '19 10:05 xoxys

dnsmasq: unknown interface wlan0

That sounds very broken

Hypfer avatar May 04 '19 10:05 Hypfer

... Flashed with a fresh firmware yesterday. Works fine for a whole day, and works also after a reboot. No idea what's wrong

xoxys avatar May 04 '19 10:05 xoxys

@Hypfer does the reboot command over ssh works for you? Running reboot from a SSH session kills my current session but does not bring back the robo until i hardly power it off with the physical button and turn on again

xoxys avatar May 05 '19 16:05 xoxys

Yup works here

Hypfer avatar May 05 '19 18:05 Hypfer

Ok so what I've done: I've build a fresh Firmware image from v1810 and v1820 both have a dnsmaq error in the Boot log also without adding valetudo to the image. So i decide do remove dnsmasq from upstart. After reboot all seems to work. AP mode and provisioning works fine. Also I notices sometimes a network error in my valetudo log. It seems that the upstart script does not respect the network-start directive... Maybe there is a small gap between "network interface is up" and network interface can reach my mqtt server. To fix this i've added a 30s sleep to pre-script section in the upstart config.

For now, no more errors in valetudo log and reboot works also. Lets see what happens tomorrow :D

xoxys avatar May 05 '19 18:05 xoxys

Robot is now up and running since 3 days, but: Lost the map today.....

xoxys avatar May 08 '19 14:05 xoxys

Because I had my robot also reset on my 2 days ago, I was searching for related issues.

For me, it took about a week before the robot reset itself (I think, didn't pay to much attention)

In regards to the error counter, could it be possible they have it in memory? Was thinking that maybe restarting the player process once a day (cron) could be worth a shot until a real solution was found. Unless you guys think I'm way off base :)

tadly avatar May 08 '19 15:05 tadly

There is already a memory limit with the upstart config on master which should prevent the resets I think

matthiasharrer avatar May 08 '19 20:05 matthiasharrer

Currently for me its very hard to get a stable solution. For me the memory limit does not solve the reset issue finally.

xoxys avatar May 08 '19 20:05 xoxys

Do you use the memory limit already? Well then I am afraid I cannot help :( I do think however that restarting player is not the right direction to go torwards .. maybe just downgrade valetudo to a more stable version

matthiasharrer avatar May 08 '19 20:05 matthiasharrer

Jep using the limit :) dont worry i know its hard develop for a "closed source" device. Random resets and my current map issue are hard to debug.

xoxys avatar May 08 '19 21:05 xoxys

…same here; memory limit set, reboot & firmware reset this night at 3:52 am. (My Gen1 "lives" in the bedroom. - my wife was not amused… ;-)

desq42 avatar May 13 '19 06:05 desq42

For me the robot is stable since more than a week with my changes. The map was back after a reboot, no idea why the map wasn't displayed

xoxys avatar May 13 '19 07:05 xoxys