rand256 / valetudo

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

Feature Request: a way to save/restore all configuration to/from the local computer #41

Open MadJoker0815 opened 4 years ago

MadJoker0815 commented 4 years ago

As for me, my robot reflashed it self after about 1 Month of operation. I ran 003468 on my Gen1 and current veletudo.conf with Valetudo RE7.1.

After reflashing all maps and zones are gone. Here a backup/restore function to save all configuration to the local PC would be nice. It should copy the zones, saved maps, timers and maybe other settings what can be done. This way it is easy to go back to the full working operation without having to rerun the whole procedure of creating maps, zones and settings.

rand256 commented 4 years ago

Yes, such universal backp/restore is missing and could be not that easy to implement inside valetudo.

For now I'd suggest at least the following:

  1. Store your full map in Valetudo (need to enable saving/restoring maps in Settings -> Web Interface);
  2. Log in to the device via SSH and manually copy all the files from /mnt/data/valetudo to your PC or a smartphone.

In case of reset, just put all files back to /mnt/data/valetudo and type restart valetudo in SSH console. Then restore the map on Home tab (for gen2 owners it might be required to enable map saving in Settings -> Persistent Data first). This way you will get 90% of your configuration back immediately.

Also you might be interested in saving some files from /mnt/data/rockrobo as well:

After replacing those it's better to reboot the device or issue restart rrwatchdoge.

TheMicroDevil commented 4 years ago

@MadJoker0815 As work around that may help.... Easy backup of valetudo settings to local pc: http://%ROBOT_IP%/api/get_config You will get a json object. Just save it somewhere as config.json To restore that configuration, just copy that file to /mnt/data/valetudo and restart valetudo, as @rand256 described. Now your defined zones are safe.

More advanced ways for other needs: If you speak German, have a look here: https://www.roboter-forum.com/index.php?thread/34607-tipp-roboter-als-laufwerk-mounten/&postID=434933#post434933

  1. You may try filezilla to access your robot too (scp).
  2. If you are on ununtu/debian, there is another easy way to backup & restore everything you want and access the whole robot as mounted drive, as soon as you can access the robot over ssh. For Windows (untested) https://github.com/billziss-gh/sshfs-win

Do the following on YOUR PC Install sshfs: sudo apt-get install sshfs

Save the following lines as script e.g. robot_mount.sh, change ROBOT_IP to host name or ip address of your robot and start that script with ./robot_mount.sh.

The following lines will create the directory /home/%CURRENT USER%/robot and will first unmount - if mounted - and then mount /mnt/data of your robot. Now you can access the files. Keep in mind: to unmount such a mount you have to use fusermount -u %MOUNT%. File managers like nautilus use the umount command and will not be able to unmount.

 #!/bin/bash
 mkdir ~/robot              
 fusermount -u  ~/robot
 sshfs root@ROBOT_IP:/mnt/data/  ~/robot

!!! BE CAREFUL !!! The following lines will mount the whole robot. So be careful what you are doing and you can easily damage something. Just copy these lines to the script and you will have access to ALL files under /home/%CURRENT USER%/robot_root from your pc.

 mkdir ~/robot_root    
 fusermount -u  ~/robot_root
 sshfs root@ROBOT_IP:/  ~/robot_root
AlexOnFOSS commented 4 years ago

Hey Rand256 what do you mean with map saving state?

lab.cfg - map saving state in gen2

rand256 commented 4 years ago

That's persistent map option value stored there, map won't be saved if there is no "1" in that file.

kquinsland commented 3 years ago

I just got bit by this. I recently moved my S6 to a portion of the floor plan that had been inaccessible to the robot until recently; think temporary partition like a child / pet fence. I placed the robot down on the floor just on the other side of where the fence had been and went to check through the web UI if I had already created a name for the region or not. While in the web UI, i accidentally clicked the "return to dock" button.

After a few seconds, the robot vocalized: "error positioning, invalid map".

I checked the web UI and the entire map has been reset. All my existing zones/segments are no more and i'll have to wait until the entire floor is clear of obstructions so i can send the robot around to do a "full" cleaning/map discovery.

A "upload backup archive" function would have been really helpful :(.

I do not expect any backup/restore function to support moving configuration across robots! Given that Valetudo now has a more scalable architecture where generic attributes/abilities are implemented via device-specific code, perhaps the device specific code can be updated w/ the list of files/dirs to be backedup / restored? It appears that this may already be the case.

pidator commented 3 years ago

I checked the web UI and the entire map has been reset. All my existing zones/segments are no more

Your problem could've been easily solved with a map save and and map reload (on home tab). All zones and segments will be saved too while "saving" the map.

kquinsland commented 3 years ago

I checked the web UI and the entire map has been reset. All my existing zones/segments are no more

Your problem could've been easily solved with a map save and and map reload (on home tab). All zones and segments will be saved too while "saving" the map.

Can you show me a screenshot of this save button? I've got nothing like it anywhere in the Valetudo UI. Or were you speaking hypothetically about how a feature could be implemented?

I don't understand why, but rebooting the vac was enough to restore the map. After I did that, i sent the robot on a full cleaning and it automatically discovered the previously inaccessible area and added it as a new segment.

¯_(ツ)_/¯

jlmii commented 3 years ago

I ran into a similar issue - trying to get the vac to access an area the robot saw as inaccessible.

The problem: A door to a little used room was closed at some point. I sent the robot to clean an adjacent room/area and the robot saw the closed door and marked it as a hard barrier (wall) on the map. After opening the door, I tried to send the robot to that room to clean, but the robot said unable to reach the target.

The fix: I simply opened the door and manually drove the robot into the doorway, then drove it in a circle several times, and then back and forth through the doorway until I saw that the robot had scanned the area and the “wall” had disappeared. For a test, I repeated the door closed/try to clean process and was able to repeat the manual drive scan to remove the barrier.

I do have the map, zones, etc saved via the UI, but manually driving the robot to force a scan avoided running a full house cleaning that would have reset the map. Hope that helps someone in the future.

pidator commented 3 years ago

Can you show me a screenshot of this save button?

You'll first have to enable the feature in settings / web interface / show multimap buttons, then you'll get two new buttons on home tab:

Screenshot_20210627-202541_Chrome

The problem: A door to a little used room was closed at some point.

You can get to robot to drive thru the closed door by simply creating a zone at the closed door (one part in the still reachable area, the other part on the other side). While cleaning the zone the door will "be opened".

kquinsland commented 3 years ago

@pidator Thanks! I don't have a specific web interface section under settings... Unless that's something that's enabled by editing the valetudo config json file.

FWIW, i'm running 0a07d97571dc4bc767bad9b9d75c1db8e3b76067 which is the 2021-06 build.

rand256 commented 3 years ago

which is the 2021-06 build.

Then please for God's sake read at least the Preamble paragraph in REAME.md and understand that this is the repo for the old fork. There is no 2021-06 version here and never will.

pidator commented 3 years ago

FWIW, i'm running 0a07d97571dc4bc767bad9b9d75c1db8e3b76067 which is the 2021-06 build.

You're running valetudo vanilla by hypfer, but this is the issue section of the mod valetudo RE by rand256. The feature I described does only exist in this mod.

kquinsland commented 3 years ago

understand that this is the repo for the old fork.

sigh. Who let me out on the internet!?

Apologies.