mysensors / MySensors

MySensors library and examples
https://www.mysensors.org
1.32k stars 895 forks source link

Bug fix for GPIO under recent Linux kernel versions #1562

Open romaricr opened 8 months ago

romaricr commented 8 months ago

Slight update of MySensors using libgpiod instead of all standard sysfs to map interrupts.

romaricr commented 8 months ago

Tested on my Raspberry PI / NRF24 gateway and working fine (with around 10 devices). Not tested on any other platform.

mfalkvidd commented 8 months ago

Nice work, thanks!

Attaching the restyling that the butler requests: restyling.patch

Will add further comments shortly.

romaricr commented 8 months ago

Styles and minor updates done. For libgpiod, it has been there for a while. The release notes says 6 years. About the potential dependency, you are right. It might require a sudo apt-get install libgpiod-dev to build and sudo apt-get install libgpiod to run. I have not tested what it looks like on a genuine installation.

For the documentation, sorry for my question but, how do I do that ?

mfalkvidd commented 8 months ago

Excellent, thanks!

6 years should be good enough, imo.

The documentation is not under version control unfortunately but I can add it to https://www.mysensors.org/build/raspberry

romaricr commented 8 months ago

Thank you to the reviewers. I have seen some of the errors but I'm really not sure how to fix them ... Anyone could help ?

ricgyver commented 3 months ago

Hi, I was trying the fixed version after upgrading my RPI to the latest Raspbian OS. However, even after using the MySensors-gpio_fix version of the library I get "Could not open /sys/class/gpio/gpio16/direction" Can you please help me? Thanks in advance!

functionpointer commented 2 months ago

Just tested this on RPi Zero W with Raspbian Bookworm 32-bit kernel. Works great.

raks-dev commented 1 month ago

Hi, I was trying the fixed version after upgrading my RPI to the latest Raspbian OS. However, even after using the MySensors-gpio_fix version of the library I get "Could not open /sys/class/gpio/gpio16/direction" Can you please help me? Thanks in advance!

What is the SOC and CPU detected as part of the configure command execution?

E.g.

[SECTION] Detecting target machine.
  [OK] machine detected: SoC=BCM2712, Type=rpi5, CPU=aarch64.
[SECTION] Detecting SPI driver.
  [OK] SPI driver detected:BCM.