How to set up Volumio to reboot nightly

Guides to let you easily discover and enjoy Volumio

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

How to set up Volumio to reboot nightly

Postby likescookies » Sun Mar 31 2019 12:06

I have a Raspberry Pi 3B that has been running Volumio for a couple of years through various versions of the OS. I use it exclusively as a DLNA renderer. The biggest issue I've had is stability when idle. If I don't use the machine for a few days in a row, which is common, it becomes unresponsive and I have to unplug it and replug it in to reboot it.

I don't know if it is a hardware issue or network issue or a problem in the OS, but I finally took some time to set up a cron job to reboot the machine in the middle of the night every night. This is a heavy-handed solution but in the couple of months since I made the change I've only had to reboot it manually once. A huge improvement.

I'm new at a lot of this--I didn't know what cron even was--so I'm documenting this here for other newbies (and for myself in the future if I ever need to do it again).

1. Enable SSH here: ipaddress/dev
2. Download PuTTY on my Windows machine.
3. Connect PuTTY to ipaddress with username and password volumio.
4. sudo nano /etc/crontab
5. Enter password again.
6. Down arrow to the lowest hash (#). ENTER to lower it, then up arrow to edit between them.
7. Add the following line: 00 8 * * * root reboot
8. CTL-X to exit, then Y to save changes and ENTER to accept default file name.

The 00 8 at the beginning of the new line sets the time of the reboot at 0800. When I was testing the reboot code, I first set the reboot to just a few minutes ahead of the current time, which is how I discovered that my Pi with Volumio isn't set to my current timezone; it's on Universal Time. Rather than figure out how to change the timezone, I just set it to reboot at 0800 UT, which is the middle of the night here.

I haven't upgraded Volumio since I made this change; I'm not sure if it will be wiped out on upgrade.

Anyway, leaving here for others or for suggestions of other ways to deal with the problem.
Random avatar
likescookies
Sunday DIYer
Sunday DIYer
 
Posts: 11
Joined: Sat Jun 24 2017 12:00

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


How to set up Volumio to reboot nightly

Postby samboman » Fri Apr 19 2019 09:15

Thanks for sharing! I was looking for this solution as well.
In my case (I use volumio to play Internet radio only) it happens that when I stop playing any radio station before night, next day when I click on "play" button, nothing happens, simply there's no sound. Manual restart does help.
Did you face similar issue?
Random avatar
samboman
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Fri Mar 15 2019 22:02


How to set up Volumio to reboot nightly

Postby likescookies » Fri Apr 19 2019 17:58

My issue sounds different. I only use my system as a DLNA renderer, and the whole system (not just the Volumio UI) seems to become unresponsive if I don't use it for a number of days. But, yeah, setting up a nightly reboot may solve your problem as well.
Random avatar
likescookies
Sunday DIYer
Sunday DIYer
 
Posts: 11
Joined: Sat Jun 24 2017 12:00


How to set up Volumio to reboot nightly

Postby LinkeLoutje » Sat Nov 23 2019 23:28

Can't get it to work, have tried the steps exactly. Experimented with UT and local timezone.

If you'd like to change your timezone, should be working using steps from
https://www.audiophonics.fr/en/blog-diy ... lumio.html

Tried to check with crontab -l if something was planned, but nope. If anyone would like to understand a bit more on how to edit cron... https://www.raspberrypi.org/documentati ... ge/cron.md

Somebody any clues on how to get this fixed? Using volumio with balbuzes connect plugin regularly "disappears" which is only solved via a reboot. Hoping a regular reboot fixes the issue.
Random avatar
LinkeLoutje
Serious Listener
Serious Listener
 
Posts: 86
Joined: Sun Dec 11 2016 15:57


How to set up Volumio to reboot nightly

Postby akbo » Thu Jan 09 2020 22:40

If it helps anyone, I just made a fresh Volumio install and got nightly shutdowns to work without problem. (But I use UTC time and haven't cared about local timezone)
1. Install cron:
Code: Select all
sudo apt-get update
sudo apt-get install -y cron

2. Configure:
Code: Select all
crontab -e

Added this line for a shutdown at 22:30 UTC:
30 22 * * * /volumio/app/plugins/system_controller/volumio_command_line_client/commands/playback.js shutdown
Save and exit with Ctrl-x y

I haven't found any documentation, but replacing 'shutdown' with 'reboot' seems to give the expected behavior.
Random avatar
akbo
Fresh off the boat
Fresh off the boat
 
Posts: 9
Joined: Tue Feb 03 2015 21:00


How to set up Volumio to reboot nightly

Postby likescookies » Sat Feb 22 2020 12:55

Hey, thanks for that, akbo. That sounds more elegant than my original solution and I'll give it a try.
Random avatar
likescookies
Sunday DIYer
Sunday DIYer
 
Posts: 11
Joined: Sat Jun 24 2017 12:00


Return to Guides

Who is online

Users browsing this forum: No registered users and 0 guests