-
-
Notifications
You must be signed in to change notification settings - Fork 891
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
Bug fix for GPIO under recent Linux kernel versions #1562
base: development
Are you sure you want to change the base?
Conversation
Using libgpiod
Tested on my Raspberry PI / NRF24 gateway and working fine (with around 10 devices). Not tested on any other platform. |
Nice work, thanks! Attaching the restyling that the butler requests: Will add further comments shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding review comments.
Do you know how long this interface has been available? The reason I'm asking is that we would prefer to not break older gateways (running on older Linux versions) if people upgrade.
MyConfig.h
Outdated
@@ -442,7 +442,7 @@ | |||
* - RF24_PA_MAX = 0dBm | |||
*/ | |||
#ifndef MY_RF24_PA_LEVEL | |||
#define MY_RF24_PA_LEVEL (RF24_PA_HIGH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if we didn't change the default PA level in this PR, since it is not related to the change.
// FILE *fp = fopen("/sys/class/gpio/unexport", "w"); | ||
// if (fp == NULL) { | ||
// logError("Unable to unexport pin %d for interrupt\n", gpioPin); | ||
// exit(1); | ||
// } | ||
// fprintf(fp, "%d", gpioPin); | ||
// fclose(fp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind deleting those lines instead of commenting them? We have git for history.
@@ -24,6 +24,9 @@ | |||
|
|||
#include <stdint.h> | |||
|
|||
// Ajout RRO | |||
#include <gpiod.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if this is installed by default on Raspberry Pi OS? If it is not, we should probably document how to install the dependency.
Styles and minor updates done. For the documentation, sorry for my question but, how do I do that ? |
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 |
Thank you to the reviewers. |
Hi, |
Just tested this on RPi Zero W with Raspbian Bookworm 32-bit kernel. Works great. |
Slight update of MySensors using libgpiod instead of all standard sysfs to map interrupts.