[GUIDE] How to set up Volumio to reboot nightly

Hi,

Many thanks for the reply!

Are you thinking an upgrade to a Rpi4 would help things?

Thank you also for the instructions for the automatic reboot - I’ll take a look and see if I can figure the steps out. I’m not a natural at this so each time something goes wrong it feels like I’m starting from scratch and having to relearn how to dabble in the rpi code. I know I can do it and have done in the past but… well you know, ultimately I just want to be able to sit down and listen to my tunes. (Ps my sd card now keeps being corrupted - arghh)

Thanks though,

Robert

Lots of people use the older Pis quite happily, and although I have retired all my 1s & 2s, I run a couple of RPi0s with Volumio … it’s a matter of expectations. An upgrade to a RPi4 would certainly lead to a much more responsive experience. RPi3s would be fine, but since they’re all at a similar price-point, why not got for the RPi4. The only thing to watch for with the RPi4 is that you get a decent 3A power supply.

Let us know how you get on. :wink:

P.S. if you’re getting the sd corruption on multiple cards, then this might be a result of poor power supply.

1 Like

hi - sd card rebuilt and the tunes return… immediate reduction in stress… right - ssh…

Ok - so, downloaded openssh from the link under SSH on the volumio documentation but no idea how to install the software (I’m guessing that it is software to install) on my macbook… sorry for being a pain but you might be starting to pick up on how much of a struggle this is for me! I have looked through all of the files that downloaded but nothing leaps out at me - under pc/windows I’m thinking that this would be an .exe file?

Am I right in thinking that openSSH is a small programme that allows access to the Rpi from my mac and so allows me to ammend the volumio code to include the instruction to reboot at 1am?

No need to download any software. Your Mac should already be capable of using ssh directly. Have a quick read here … jump past the first section straight to “Connecting to a Server via SSH in Terminal”. The server referred to there is your RPi, and the command to start the ssh connection will be:

ssh volumio@volumio.local

That should get you yo your RPi’s command line.

(There will also be graphical ssh clients available, if you feel more comfortable in that kind of environment, but you will need to install them … and honestly I don’t think it’s worth the effort for what you are going to do.)

Yes. :slight_smile:

Thanks for your patience! I feel that I’m getting there… then I get this…

[2]+ Stopped sudo nano /etc/systemd/system/systemd-reboot.timer
volumio@volumio:~$ sudo systemctl enable /etc/systemd/system/systemd-reboot.timer
Failed to execute operation: No such file or directory
volumio@volumio:~$ sudo systemctl start /etc/systemd/system/systemd-reboot.timer
Failed to start etc-systemd-system-systemd\x2dreboot.timer.mount: Unit etc-systemd-system-systemd\x2dreboot.timer.mount failed to load: No such file or directory.
volumio@volumio:~$

‘nano’ is a text editor that you are using to make the .timer file. Can you check that you have made the file correctly by typing:

cat /etc/systemd/system/systemd-reboot.timer

and pasting the output here please.

I tried running through the previous instructions again just in case and got the dame result. Here is what I get after inputting your last instruction… guessing something is missing…

volumio@volumio:~$ cat /etc/systemd/system/systemd-reboot.timer
cat: /etc/systemd/system/systemd-reboot.timer: No such file or directory
volumio@volumio:~$

yes, you are not creating the file systemd-reboot.timer with ‘nano’ for some reason.

Oh wow, my mistake … sorry you need to hit CTRL-O to write the file, and CTRL-X to exit back to command line. I’m going to go back and edit my original post for the sake of clarity for people following afterwards.

Hi,

Took a few goes… but hopefully it’s working - is there any way of checking that it’s actually doing the job? Will this: cat /etc/systemd/system/systemd-reboot.timer

tell me?

Many thanks,

Robert

Have afeeling that this is now looking psitive!

volumio@volumio:~$ cat /etc/systemd/system/systemd-reboot.timer

[Unit]

Description=Reboot daily at 1am

[Timer]

OnCalendar=--* 1:00:00

[Install]

WantedBy=timers.target

volumio@volumio:~$

There is an error in this post, please go here for further details.

The easiest way to check is to edit the file:

  1. Stop the timer from running.
    sudo systemctl stop /etc/systemd/system/systemd-reboot.timer
  1. Edit the file to include a time say 10 minutes from now.
sudo nano /etc/systemd/system/systemd-reboot.timer

So change the 01:00 to say 14:10 in the OnCalendar= line, save the file CTRL-o, and exit nano CTRL-x

  1. Restart the timer.
sudo systemctl start /etc/systemd/system/systemd-reboot.timer

and wait until your set time (14:10) is reached… the RPi should reboot.

To your other question, ‘cat’ just shows the contents of the file.

Dear chsims1,
thank you for your reboot code.
I have created the file and all works pretty. at 1:00am the mashine did made a reboot,

volumio@volumio-bad:~$ cat /etc/systemd/system/systemd-reboot.timer
[Unit]
Description=Reboot daily at 1am

[Timer]
OnCalendar=*-*-* 1:00:00

[Install]
WantedBy=timers.target

but what I am realy wondering is, after I enable the code and want to start the code the following message comes up:

volumio@volumio-bad:~$ sudo systemctl start /etc/systemd/system/systemd-reboot.timer
Failed to start etc-systemd-system-systemd\x2dreboot.timer.mount: Unit etc-systemd-system-systemd\x2dreboot.timer.mount failed to load: No such file or directory.

On the end it works but I can not trace why? Do you have an idea?
Kind regards Korniman

I think that you have made a typo somewhere.

Once you have enabled the file ok, it will automatically start after a reboot. You can see if it is running successfully by typing ‘sudo systemctl status systemd-reboot.timer’.

volumio@volumiostudy:~$ sudo systemctl status systemd-reboot.timer
● systemd-reboot.timer - Reboot daily at 1am
   Loaded: loaded (/etc/systemd/system/systemd-reboot.timer; disabled; vendor preset: enabled)
   Active: active (waiting) since Mon 2021-04-19 06:38:59 UTC; 17s ago
  Trigger: Tue 2021-04-20 01:00:00 UTC; 18h left

Apr 19 06:38:59 volumiostudy systemd[1]: Started Reboot daily at 1am.

So to summarise:

sudo systemctl enable timerfile         start timer automatically after a reboot.
sudo systemctl start timerfile             start timer immediately
sudo systemctl stop timerfile             stop timer immediately
sudo systemctl restart timerfile          restart timer if it is already running
sudo systemctl status timerfile          shows status of the timer

As the reboot function work at night perfectly and the check of typos was without results, it seems maybe only the feedback by the code is wrong depending on my raspi system. On my installation I add a real time clock as an small IC connected to the Gpios: “Adafruit DS3231 Precision RTC Breakout” and the reboot code receives not the write feedback as software clock is deactivated

Maybe you have a clue about?
Cheers

I do not understand this line at all:

Failed to start etc-systemd-system-systemd\x2dreboot.timer.mount: 
Unit etc-systemd-system-systemd\x2dreboot.timer.mount failed to load: No such file or directory.

Is this something to do with your RTC? Where has the x2drereboot.timer.mount file come from?

“etc-systemd-system-systemd\x2dreboot.timer.mount” has an invalid backslash in it (but it looks remarkedly similar to the normal systemd path and file of “/etc/systemd/system/systemd-reboot.timer”

I think this is a result of executing

sudo systemctl enable /etc/systemd/system/systemd-reboot.timer

IIRC only the unit name (not its path) has to be used with systemctl, so IMHO the command to enable “systemd-reboot.timer” would have to be

sudo systemctl enable systemd-reboot.timer

To get rid of the cited error message run

sudo systemctl disable /etc/systemd/system/systemd-reboot.timer

P.S. “\x2d” is systemd escaping the “-” sign in “systemd-reboot.timer”.

You’re exactly right @gvolt, thank you for the correction. :slight_smile: No idea why I did it. I’m not going to go back and change each post, because it loses context for someone following the topic chronologically, so I will just add a link at the end of the two incorrect posts pointing here.

My sincere apologies for my mistake in including the path to the timer file when the timer is started/stopped/enabled … you just use the timer filename. (However, you do still need to use the full path when creating the file with ‘nano’.)

Incorrect:

sudo systemctl start /etc/systemd/system/systemd-reboot.timer

Correct:

sudo systemctl start systemd-reboot.timer

If you followed the original posts (using full path), then you also need to run:

sudo systemctl disable /etc/systemd/system/systemd-reboot.timer

(Don’t forget to enable it again, correctly … sudo systemctl enable systemd-reboot.timer).

Dear @gvolt and @chsims1 , thank you for your great support!. That has been working like a charm now.
Cheers
Korniman

:+1: Thank you for the feedback!