Idea

Kevin Windrem avatar image
Kevin Windrem suggested

Enhance restore to factory defaults to include Venus OS reinstall

I keep seeing posts of people loosing access to the GUI for whatever reason and not being able to recover even after restoring settings to factory defaults. Part of the restore settings mechanism blocks ssh access so it's a double whammy.

I have a mechanism that forces a Venus OS firmware update as part of my SetupHelper blind uninstall mechanism. I recommend that this be added to the restore to factory defaults venus-data.tgz.

I also rename venus-data.tgz so it won't run again if the media is left plugged in.

Here's the shell script code I used:

# check to see if Venus OS will be reinstalled - actuall reinstall will be done later
swCheckOutput=$(/opt/victronenergy/swupdate-scripts/check-updates.sh -offline -force -check)
if (( $? == 0 )); then
    reinstallVenusOs=true
    swUpdateVersion=$(echo $swCheckOutput | awk '{print $NF}')
else
    reinstallVenusOs=false
    swUpdateVersion="none"


# reinstall Venus OS - done in background so this script can clean up and exit without disrupting the software update
if $reinstallVenusOs ; then
    logMessage "reinstalling Venus OS $swUpdateVersion"
    nohup sh -c 'sleep 1; /opt/victronenergy/swupdate-scripts/check-updates.sh -offline -force -update' > /dev/null &
# reboot if not reinstalling Venus OS
else
    logMessage "rebooting ..."
    nohup sh -c 'sleep 1; reboot' > /dev/null &
fi


# rename archive on removable media to prevent blindInstall from running again
drives=$(ls /run/media/)
for drive in $drives ; do
    archive="/run/media/$drive/venus-data.tar.gz"
    if [ -f "$archive" ]; then
        logMessage "renaming venus-data.tar.gz so blindUninstall won't run again"
        mv $archive "/run/media/$drive/venus-data.UninstallPackages.tar.gz"
    fi
done



restore to factory defaults
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

1 Comment

mvader (Victron Energy) avatar image
mvader (Victron Energy) commented

Hey Kevin, thanks for your post here. It triggered a better solution:


https://community.victronenergy.com/questions/204255/cerbo-gx-bricked-how-to-recover.html


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

Related Ideas