Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MadJoker0815 opened this issue Dec 2, 2019 · 13 comments

Comments

@MadJoker0815
Copy link
Contributor

MadJoker0815 commented Dec 2, 2019

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.

@MadJoker0815 MadJoker0815 changed the title Feature Request: Button to save all maps/settings and zones to the local computer. Feature Request: Button to save/restore all maps/settings and zones to/from the local computer. Dec 2, 2019
@rand256
Copy link
Owner

rand256 commented Dec 2, 2019

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:

  • apptimer.cfg - contains local timers like DND start/end
  • timezone - chosen in firmware time zone
  • lab.cfg - map saving state in gen2

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

@rand256 rand256 changed the title Feature Request: Button to save/restore all maps/settings and zones to/from the local computer. Feature Request: a way to save/restore all configuration to/from the local computer Dec 2, 2019
@TheMicroDevil
Copy link

TheMicroDevil commented Dec 12, 2019

@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
Copy link

Hey Rand256 what do you mean with map saving state?

lab.cfg - map saving state in gen2

@rand256
Copy link
Owner

rand256 commented Feb 20, 2020

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

@kquinsland
Copy link

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
Copy link
Contributor

pidator commented Jun 27, 2021

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
Copy link

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
Copy link

jlmii commented Jun 27, 2021

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
Copy link
Contributor

pidator commented Jun 27, 2021

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
Copy link

@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
Copy link
Owner

rand256 commented Jun 28, 2021

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
Copy link
Contributor

pidator commented Jun 28, 2021

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
Copy link

understand that this is the repo for the old fork.

sigh. Who let me out on the internet!?

Apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants