skhg / juice4halt

📝 systemd scripts for the juice4halt Raspberry Pi UPS HAT
MIT License
14 stars 7 forks source link

Cannot start service on newer RPi platforms: update to pinctrl instead of using /sys/class/gpio directory #4

Open jacoblapenna opened 7 months ago

jacoblapenna commented 7 months ago

See pull request. You are using /sys/class/gpio to interact with GPIO25 in bash. /sys/class/gpio has been deprecated since 2015 and targeted for removal in 2020 (see here). pinctrl (see here) is the official Raspberry Pi util for command line manipulation and reading of GPIO. New Raspberry Pi OS versions will not support your current scripts (e.g., the Raspberry Pi 5).

I have submitted a tested PR to update to pinctrl. Please review and merge or provide comments for changes.

NOTE: I have forked and updated my own repo for my use. But because J4H officially points to this repo from their webpage, you should merge for others to use.

jacoblapenna commented 7 months ago

See fork using pinctrl here in case this repo is no longer maintained.