Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Replace legacy sysfs code with chardev #39

Open
rene0 opened this issue Feb 23, 2020 · 10 comments
Open

Replace legacy sysfs code with chardev #39

rene0 opened this issue Feb 23, 2020 · 10 comments
Assignees

Comments

@rene0
Copy link
Owner

rene0 commented Feb 23, 2020

sysfs has been deprecated since Linux 4.8, replace the existing sysfs code to interface with GPIO in the Linux version with chardev.

@rene0
Copy link
Owner Author

rene0 commented Mar 8, 2020

@Avamander I tried running some tools from libgpiod (gpiomon etc) but these do not seem to work properly. I have a DCF77 and an NPL receiver hooked up, for one it always return a high readout and for the other always a low readout. This also happens with the sysfs code. Kernel is 4.19 from Debian Buster. I am member of the gpio group.

However if I run the same code (from dcf77pi using the sysfs interface) with an ancient 3.10.25 kernel I get the expected result.

Would you have an idea of what's going on?

@rene0
Copy link
Owner Author

rene0 commented Mar 8, 2020

This is on a Rasperry Pi 1B.

@Avamander
Copy link

It might be that on such an old kernel libgpiod doesn't work properly?

@rene0
Copy link
Owner Author

rene0 commented Mar 8, 2020

That distribution is old enough to not have libgpiod (nor is it properly updateable anymore). Reading the GPIO pins using sysfs using the old kernel works fine, but the new kernel refuses.

@Avamander
Copy link

Avamander commented Mar 8, 2020 via email

@rene0
Copy link
Owner Author

rene0 commented Mar 8, 2020

That is just with gpiomon GPIODEVICE PIN ?

@Avamander
Copy link

Avamander commented Mar 8, 2020 via email

@rene0
Copy link
Owner Author

rene0 commented Mar 8, 2020

Hm, so something is off with Debian Buster (kernel 4.19) then :( Thanks for the insights.

@rene0
Copy link
Owner Author

rene0 commented Nov 1, 2020

The same happens for me on Raspbian Buster with kernel 5.4.72, both the sysfs and chardev interface seem stuck at the same value (either all low or all high). A reboot to clear the kernel state did not help.

@rene0
Copy link
Owner Author

rene0 commented Nov 1, 2020

Looks like none of the 54 (out of 24 for the Raspberry Pi 1B ?) work on Linux 5.4.72 using the chardev interface. It works fine on FreeBSD 12.2-RELEASE.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants