George_ wrote: 
> Hello,
> I have installed a "Pimoroni onoff shim" for a completely shut on and
> off of my Raspberry with a hardware momentary button. The switch works
> fine with Raspbian, but the original software doesn't run with
> piCorePlayer.
> 
> The switch needs a trigger script to initiate shutdown by button press
> (GPIO17 set to 0) and a gpio-shutoff code (GPIO4 set to 0), which is
> executed at the end of the poweroff-function when piCorePlayer is
> shutdown.
> 
> The trigger script works fine with typing "/home/tc/pcp-powerbutton.sh
> -i -17 --low" as user command #1 on the tweaks page. Is there any
> possibility to set GPIO4 to 0 when piCorePlayer is shutdown so that the
> shim realises the shutdown and cuts off completely?
> 
> Regards George

Using a program to drive an output high is going to be tricky, since the
shutdown kills all processes.  You can try the gpio-poweroff overlay,
which will do this at the firmware/kernel level.

in your config, set
dtoverlay=gpio-poweroff,gpiopin=4,active_low=1

I have a feeling that a reboot will trigger a the power off event too,
as there is notes in the help info


Code:
--------------------
    
  Name:   gpio-poweroff
  Info:   Drives a GPIO high or low on poweroff (including halt). Enabling this
  overlay will prevent the ability to boot by driving GPIO3 low.
  Load:   dtoverlay=gpio-poweroff,<param>=<val>
  Params: gpiopin                 GPIO for signalling (default 26)
  
  active_low              Set if the power control device requires a
  high->low transition to trigger a power-down.
  Note that this will require the support of a
  custom dt-blob.bin to prevent a power-down
  during the boot process, and that a reboot
  will also cause the pin to go low.
  input                   Set if the gpio pin should be configured as
  an input.
  export                  Set to export the configured pin to sysfs
  
--------------------


I'm have not found how to generate the "custom" dt-blob.bin.   The new
audiophonics power module that is active high, works just fine.



piCorePlayer a small player for the Raspberry Pi in RAM. 
Homepage: https://www.picoreplayer.org

Please 'donate'
(https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=U7JHY5WYHCNRU&lc=GB&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
if you like the piCorePlayer
------------------------------------------------------------------------
paul-'s Profile: http://forums.slimdevices.com/member.php?userid=58858
View this thread: http://forums.slimdevices.com/showthread.php?t=109734

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to