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

node-red-node-pi-gpio -> nrgpio.py uses ~1% CPU per IO port #1060

Open
pebl-hank opened this issue Apr 4, 2024 · 2 comments
Open

node-red-node-pi-gpio -> nrgpio.py uses ~1% CPU per IO port #1060

pebl-hank opened this issue Apr 4, 2024 · 2 comments

Comments

@pebl-hank
Copy link

Node-red: 3.1.8
node-red-node-pi-gpio: 2.0.6
Nodejs: 20.12.1
Raspberry Pi 5 (64bit)

My flow uses multiple "rpi-gpio in" nodes to monitor if an IO port is 0 or 1. Debouncing is set to 100mS (changing this value seems not to solve the issue).
The issue is that htop shows 4 "nrgpio.py" process per IO line that is configured in the node-red flow. That are about 40 processes. 1 of each 4 processes continously has a CPU usage of about 0.7 up to 2%. So 10 processes use around 1% each on average.

I did not notice that issue on my Raspberry Pi 4 that ran a 32bit OS.

Is that something that can be fixed in this module?

Example:
[ { "id": "a95c2f4d.c0168", "type": "rpi-gpio in", "z": "bb3e7715.2c09", "name": "bad", "pin": "26", "intype": "down", "debounce": "100", "read": true, "bcm": true, "x": 90, "y": 700, "wires": [ [ "b860d764.0aea98", "a65e9d62ead68e73" ] ] }, { "id": "728b682e.a4b2c", "type": "rpi-gpio in", "z": "bb3e7715.2c09", "name": "wohn", "pin": "16", "intype": "down", "debounce": "100", "read": true, "bcm": true, "x": 90, "y": 640, "wires": [ [ "9b4d24c4.8bd2f", "a65e9d62ead68e73" ] ] }, { "id": "17b463b.93fcc1c", "type": "rpi-gpio in", "z": "bb3e7715.2c09", "name": "schlaf", "pin": "21", "intype": "down", "debounce": "100", "read": true, "bcm": true, "x": 90, "y": 520, "wires": [ [ "c8aba6f6.5eb048", "a65e9d62ead68e73" ] ] }, { "id": "a65e9d62ead68e73", "type": "debug", "z": "bb3e7715.2c09", "name": "debug 51", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 420, "y": 640, "wires": [] } ]

@clickworkorange
Copy link
Contributor

clickworkorange commented Sep 3, 2024

I'm had this as well on a Pi3B+ with quite modest GPIO usage; two input pins monitored for changes and one pin used to output a PWM signal. I had at some point added duplicates of the input pins on a separate flow for troubleshooting reasons - removing these dropped total CPU usage dramatically from ~50% to under 10%. 15 min load average is down to 0.1 from 1.7! It seems these nodes conflict somehow when you have duplicates...

@pebl-hank
Copy link
Author

I double checked the nodes for dublicate pins. There was one that was disabled. I removed it, but no luck in my case.
Thanks for the suggestions though!

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