New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recent kernels no longer support sysfs interface for GPIO (raspberry pi) #250
Comments
I did not intend to close this issue when working on it in my fork... sorry. |
I worked on this over in my fork (please see the PR in my fork that accidentally closed this issue). I'd have offered it as a PR here, but:
I did, however, determine the code went from not-working to working by actually watering my lawn. |
Your code tweaks worked for me. However libgpiod in ArchLinuxARM is now at version 2.0.1 which completely breaks the older API. Downgrading to libgpiod 1.6.4 allowed your code to compile. Just lovely how GPIO handling in the kernel and libraries seem to change every few months. Figured by now those APIs would be fairly stable, but change for change sake I guess. Thanks again! |
Thanks for the heads-up! Looking at distros, it seems Ubuntu (the base image I used for the docker image), Alpine (what I probably should have used), and even openSUSE Tumbleweed (what my k8s cluster running opensprinkler for me uses natively) are all still at 1.6.x. I confirm, though, that Arch Linux is at 2.0.1. It looks like I should bring my fork up-to-date with this repo anyway, and I should see if I can support both old and new Separately: you could try running opensprinkler as a container using docker or containerd ( |
See https://forums.raspberrypi.com/viewtopic.php?t=343514.
On my recent system, running
Linux sprinkler 6.3.9-1-default #1 SMP PREEMPT_DYNAMIC Thu Jun 22 03:53:43 UTC 2023 (0df701d) aarch64 aarch64 aarch64 GNU/Linux
, the sysfs interface no longer works. This breaksraspi-gpio
, and I think this critically impacts the workings of https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/gpio.cpp, beyond even just thesystem()
call toraspi-gpio
.A potential remedy is written up here: https://www.ics.com/blog/gpio-programming-exploring-libgpiod-library. There exists packages for
gpiod
(CLI tools),libgpiod2
(runtime libraries), andlibgpiod-dev
(runtime libraries and development headers). I notice three choices:raspi-gpio
and the sysfs interface with the use oflibgpiod
.rapsi-gpio
and the sysfs interface withsystem()
calls togpioset
.raspi-gpio
and the sysfs interface vs.gpioset
.I might be able to do a little empirical testing to see if
raspi-gpio
andgpioset
both work on older kernels.The text was updated successfully, but these errors were encountered: