Skip to content
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

Perfomance - input don't use interrupts #1087

Open
helmutacp opened this issue Jan 8, 2025 · 4 comments
Open

Perfomance - input don't use interrupts #1087

helmutacp opened this issue Jan 8, 2025 · 4 comments

Comments

@helmutacp
Copy link

With Bullseye RPi.GPIO is used. With Bookworm it uses rpi-lgpio and lgpio.
lgpio no longer uses interrupts for inputs. This means some cpu seconds for every input.
The official gpiod still uses interrupts. This means zero cpu when monitoring inputs.
Is there a chance to change the underline library?

By the way pigpiod is also polling the imputs ...

@helmutacp helmutacp changed the title Perfomance - input don't use interrups Perfomance - input don't use interrupts Jan 8, 2025
@dceejay
Copy link
Member

dceejay commented Jan 8, 2025

There is already a node that uses gpiod - https://flows.nodered.org/node/node-red-node-pi-gpiod

@helmutacp
Copy link
Author

Unfortunately, this is a little confusing. There is a library gpiod (https://pypi.org/project/gpiod/) and a daemon gpiod ore Remote GPIO: https://gpiozero.readthedocs.io/en/stable/remote_gpio.html
Unfortunately, both have the same name...
node-red-node-pi-gpiod uses the daemon and not the library. Unfortunately, the daemon does not support interrupts and therefore polls with a certain percentage of CPU

@dceejay
Copy link
Member

dceejay commented Jan 8, 2025

To use the library I think you have (or certainly used to have to) run as root... and we don't want to have to run Node-RED as root so was not easily possible - hence the use of the daemon. If that has changed recently that would be good but yes will need someone with time to help re-write the node.

@helmutacp
Copy link
Author

I think it should work as user without root rigts. I did a short python program and it worked as normal user.

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

No branches or pull requests

2 participants