How to shut down Volumio when using Raspberry Pi with a Witty Pi 3 hat?

I usually shut down Volumio from the GUI. I’m guessing this shuts down the GUI, any non-GUI Volumio services and then runs the Linux command ‘shutdown’. I’m running Volumio on a Raspberry Pi and have just added a Witty Pi 3 Mini hat/board to provide a hardware on/off switch facility for the Pi. The Witty board has a push switch and a small controller which, when the switch is pressed, cleanly shuts down the Raspberry Pi and cuts the power to it (when the Witty is fitted the Pi gets its power via the Witty). As part of adding the Witty there are some shell scripts that are installed on the Pi(Volumio). One of these scripts ( is a “pre-shutdown” script which gets run before the Witty shuts down the Pi, and is the place for users to add their own shutdown commands. I’m guessing that I should add commands to this file to close the Volumio GUI and any Volumio specific services. So I’m looking for advice as to what command line commands I should add to “” to close the Volumio GUI and any Volumio specific services before the Witty does a standard/non-Volumio specific shutdown. Before you ask, I don’t know exactly what the Witty does/runs to shut down the Pi, but it won’t know the OS is Volumio rather than a standard Linux.

Neil Mackie

I don’t believe you need to do anything specific to shutdown/close Volumio’s GUI and services judging by what Volumio does when you use the Shutdown button on the GUI.

Thanks for posting the code snippet. I agree, that looks like a standard shutdown, so there should be nothing that needs to be added to the Witty file. Thanks for your help.

You might want to add the call to sync to ensure any pending config files get written to disk…

I want to place a witty pi on my raspberry pi running Volumio aswell, but the software installation won’t work. How did you do it?

I used the codes:
this one works,

But then:
sudo sh
This one doesnt work. I get a lot of “missing” and “not found” errors.

It has been some time since I installed the Witty software so I cannot supply details. I did get some error messages during the installation. One of the utilities used (cant remember which) was not installed in Volumio so I had to install it in addition to the Witty software. Even then there were some error messages, but I had a look in the file structure and the Witty files seemed to be there, so I ignored the messages and it seems to be working OK. I have not used any of the advanced Witty features like setting up schedules so cannot say whether they are working for me or not.