RPi shutdown/reboot button


#1

Hi,

I’m using MODEP via the browser of my mobile and it’s a bit of a hassle to fire up a ssh shell to reboot/shutdown the RPi. Would it be possible to add a button to the web UI to handle this? Thanks.


#2

Hey @noobido,

I had a similar concern, and I was able to sort it out with a software solution:

I wrote a python script, which creates a virtual midi device, MidiShutdownServer.

If you connect some other MIDI thing to it in the MODEP UI, and send it CC 64 with value 127, it runs ‘sudo init 0’, so long as the system has been up for at least 120 seconds.

The only problem I’ve had, is it seems like the UI does not save the check mark next to the output MIDI ports. That means I have to select them again before use, but that might be something I’ve messed up along the way in my hackery.

Hope this helps!


#3

Hi whofferbert,

thanks for your reply. What a great idea to use a GUI MIDI tool to send the shutdown command! I’ll definitely will give this a try.

As it seems a shutdown button comes in handy. Maybe it might still be considered to be added to the GUI by the makers of MODEP?


#4

I think that would be a good addition, but until then and for my needs, the script works for me.

There is an x42 plugin, “MIDI Generator”, that sends midi CC 64 with value 127 regularly, when using the Sustain Pedal Test.

Also, in my testing, even when the MODEP UI does not draw the MIDI output and the connection to it as I would expect, they still seem to be connected.
The system still shuts down as I expect when I trigger the action, even when the component is not drawn.
If I re-check the MIDI output channel, the connection is drawn immediately, so I suspect the UI “knows”, but is not handling something just right.