Page 1 of 1

[Solved] VC button to shutdown the RPi

Posted: Sun Dec 09, 2018 5:41 pm
by Mibmusic
Sorry to ask but even after reading the documentation I still have no idea how to add a script containing a system command to shutdown the RPi. I would like to have a button on the VC to gracefully shut the RPi when I am done. Who can help me out?

Re: Vc button to shutdown the RPi

Posted: Sun Dec 09, 2018 7:26 pm
by edogawa
Isn't that a contradiction in itself? You cannot quit QLC without leaving run mode,which makes your VC widget inactive...

But if you're running Massimo's QLC+ image, that version of QLC has a configuration screen with buttons for reboot and shutdown.

Re: Vc button to shutdown the RPi

Posted: Mon Dec 10, 2018 7:49 pm
by Mibmusic
I just thought that if you can run a script from within QLC+ that can start programs, it might be possible to run a script that shuts the RPI. We don’t use a monitor and we prefer to not use wifi either. If not, we will use wifi, or buy a shutdown button. I read some guy designed them.

Re: Vc button to shutdown the RPi

Posted: Wed Dec 12, 2018 12:58 pm
by edogawa
Yes, that may well be possible, I don't have experience in QLC scripting so you'll have to experiment yourself.

From the docs I see that there's a systemcommand keyword that you'll need. But it's not a trivial task, as shutdown is a superuser command, so you'll need to call it via sudo, and I don't see a way with scripting to enter your password...

Re: Vc button to shutdown the RPi

Posted: Wed Dec 12, 2018 1:01 pm
by mcallegari
QLC+ is ran at startup, so no sudo is needed.

Code: Select all

systemcommand:/sbin/halt
That's it

Re: Vc button to shutdown the RPi

Posted: Wed Dec 12, 2018 7:13 pm
by Mibmusic
I got it and works great! Thank you so much!! QLC+ gives us exactly what we were looking for. Great job en I will post a link to a live video as soon as we’re ready.