[NesPi case] Script for full shutdown?

I have a Rapberry PI3 in a Retroflag SNES case with a dual-fan inside. When I put in an SD-card with Retropie and install the script below the PI shutsdown completely (no standby LED and fans stop spinning). However this script doens’t work on OSMC:

Script 1: GitHub - crcerror/ES-generic-shutdown: A script that includes a few known standard power switches (MAUSBERRY, SHIM, POLOLU) and gots a default config for a safe shutdown

This script (meant for OSMC) works but the standby LED stays on and the fan’s never stop spinning:

Script 2: Rerns OSMC GPIO button service (customized for NESPi Case and OSMC by seamonkey420) · GitHub

I tried to take the code the shutdown_fan script and implement it into the script for OSMC/Raspbian but can’t get it to work!

#!/bin/sh
This script disables fan control off NESPi+ case
Dedicated to gollumer
cyperghost for https://retropie.org.uk
You need to install raspi-gpio with sudo apt install raspi-gpio

GPIO 4 controls power
place script to /lib/systemd/system-shutdown
and make it executable with chmod +x shutdown_fan
You need root for this

[ “$1” = “poweroff” ] && raspi-gpio set 4 op pn dl

How would I merge this code into the second script so the PI also does a full shutdown in Raspbian, or just disable fan’s at boot-up since I only need them on OSMC.

Did you seek support from the people who wrote/provided the script with their product that they sold you?

Did you install raspi-gpio as suggested in the script? Does it work if you manually run the raspi-gpio command? If not, you need to do as @ActionA suggested and contact the seller.

I have raspi-gpio installed yes, people on Github are complaining they don’t respond.

I guess their cases are just targeted to the Retropie market. And I don’t have enough knowledge to modify the script to run on OSMC.

or they dont have enough interest in supporting you there isnt a huge differance between running shell script under osmc vs retropie all it has to have is is the things that its calling in the script again seek support from novice linux users or support from the retailer but it seems pretty straight forward to me alteast.

again gpio follow the instructions on the pins then follow the instructions in the shell script.

in anycase its not really a osmc problem :slight_smile:

Could you clarify exactly what you want to do. If you simply want to power off OSMC, you could try running the command poweroff from a shell script, assuming that you can get it to run in the first place.

The raspi-gpio commands might not all work because the OSMC kernel has been built for running a media server, whereas Raspbian is a general-purpose system with a strong educational emphasis. Please take a look at OSMC raspDAC overlays gpio-shutdown pin 17 &22 for an example of what I’m talking about.