Author Topic: Clean shutdown  (Read 1135 times)

jkrafft

  • Newbie
  • *
  • Posts: 32
    • View Profile
Clean shutdown
« on: August 06, 2021, 04:26:41 PM »
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)

  • Administrator
  • Full Member
  • *****
  • Posts: 225
    • View Profile
Re: Clean shutdown
« Reply #1 on: August 06, 2021, 10:09:42 PM »
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

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Clean shutdown
« Reply #2 on: August 07, 2021, 12:25:46 PM »
Great, works perfectly !
Would it be possible in the futrure to assign a switch to it ? (or to any other function)

thx

Randall (Admin)

  • Administrator
  • Full Member
  • *****
  • Posts: 225
    • View Profile
Re: Clean shutdown
« Reply #3 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.

Randall (Admin)

  • Administrator
  • Full Member
  • *****
  • Posts: 225
    • View Profile
Re: Clean shutdown
« Reply #4 on: August 07, 2021, 12:39:52 PM »
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

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Clean shutdown
« Reply #5 on: August 07, 2021, 05:29:16 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

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Clean shutdown
« Reply #6 on: October 16, 2021, 05:29:23 PM »
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.