News:

SMF - Just Installed!

Main Menu

Clean shutdown

Started by jkrafft, August 06, 2021, 04:26:41 PM

Previous topic - Next topic

jkrafft

Hello
I'd like to know what is the cleanest way to shut down the system.
Unplugging the power barrel will end up corrupting the sd card at some point.
What's recommended ?

thx

Randall (Admin)

Thanks for asking about that.  It's been on my ToDo list for a while so I just did something about it.  Yes, the best way is to shut down services and processes before removing power.

So now, there is a "System shutdown" option in the System menu.

You'll need to update the pi-stomp software:
https://treefallsound.com/wiki/doku.php?id=software_installation#software_updates

Then, when you're ready to shut it off, long-press the encoder until you get the System Menu, then scroll to "System shutdown".  The "pi Stomp" splash screen should appear (Red text), then all services and processes will be shut down gracefully.  Once the LCD goes all white, you can remove power.  When booting, the splash screen text will be Green so you know whether it's booting up or shutting down.


jkrafft

Great, works perfectly !
Would it be possible in the futrure to assign a switch to it ? (or to any other function)

thx

Randall (Admin)

You certainly could, there are a number of tutorials on how to do that, like this one:
https://www.recantha.co.uk/blog/?p=13999

Essentially, you need a service running monitoring the status of a GPIO pin.  You have 3 spare on the pi-Stomp Core (0, 13, 26).

The other option is to add an inline hardware switch like these:
https://www.amazon.com/gp/product/B08933K6G7/ref=ox_sc_act_title_1?smid=A3KP7XO7P8OFXQ&psc=1

Just make sure they have 2.5mm center pin, not the more common 2.1.  I might buy up a bunch of these to make them available in the treefallsound.com store.

Randall (Admin)

In my previous posting, I didn't mean that the inline switch was an alternative to a shutdown switch, but that it could be used in addition to a shutdown switch (or "System shutdown" via the System menu) for disconnecting power.

jkrafft

Quote from: Administrator on August 07, 2021, 12:35:22 PM
You certainly could, there are a number of tutorials on how to do that, like this one:
https://www.recantha.co.uk/blog/?p=13999

Essentially, you need a service running monitoring the status of a GPIO pin.  You have 3 spare on the pi-Stomp Core (0, 13, 26).

The other option is to add an inline hardware switch like these:
https://www.amazon.com/gp/product/B08933K6G7/ref=ox_sc_act_title_1?smid=A3KP7XO7P8OFXQ&psc=1

Just make sure they have 2.5mm center pin, not the more common 2.1.  I might buy up a bunch of these to make them available in the treefallsound.com store.
Works perfectly !
Does take a led gpio pin though...

benh

Talking of shutdown... I wonder how much work it would be to have the system boot with the sdcard mounted read-only. That would be a generally safer option long term. Maybe have a separate partition that can be mounted rw "on demand" for permanent setting (and gets unmounted as soon as the settings are saved).

It probably requires tinkering with Patchbox OS / Raspbian but a quick google shows that's something commonly done with the latter at least.