I recenty bought the RaspDAC I-Sabre V4 DIY Kit and I like it very much. What a nice piece of hardware!
However, I was less happy with the power control and the scripts to use it. The timeout approach seems outdated.
So I created my own solution, and I want to share it with you today:
I wrote a new firmware for the ATtiny45 on the RaspDAC that works with the new Linux drivers gpio-shutdown and gpio-poweroff.
https://github.com/unhold/avr/tree/master/src/raspdac
I attached a built version for 1 MHz clock frequency, the default for the ATtiny45.
Note that the original RaspDAC uses the #RESET pin (top left) as GPIO, so they had to fuse the RSTDISBL fuse. You will need a High-Voltage Serial Programmer or a new ATtiny45. You have to burn the RSTDISBL fuse or bend/cut the #RESET pin. I don't use it in my firmware.
Flash it on your ATtiny, then put this into your Raspi /boot/config.txt:
Code : Tout sélectionner
dtoverlay=gpio-shutdown:gpio_pin=17,active_low=0
dtoverlay=gpio-poweroff:gpiopin=22
Code : Tout sélectionner
ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \
SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \
ATTRS{keys}=="116", TAG+="power-switch"
- Immediate poweroff after Raspi finished shutdown,
Works with every (reasonable up-to-date) Raspi Linux image,
Easy to configure,
Works with any shutdown option (shutdown, halt, from GUIs, etc.).
Cheers and happy listening
unhold