node-red / node-red/node-red-nodes
node-red-node-pi-gpio: python script nrgpio consuming a lot of processor time
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 13h 57m
- Merged PRs (30d)
- 3
Description
On an original PI Zero, running NR 4.0 on Bullseye, with Python 3 I find that for each gpio pin configured there is an instance of the nrgpio script running. Each one of those consumes about 3% of the processor, even when there is no IO activity. Even on a Pi 3 it is 0.7%.
Looking at the source of nrgpio I deduce that the python input function may be polling stdin which is not ideal if I am right. Perhaps there is no alternative.
I have not been able to try it on python 2 to see if this is worse with 3, as I don't have a pi running 2.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the nrgpio Python script and reproduce the idle processor use on the reported Raspberry Pi setup. Investigate how its input handling waits for GPIO activity, then verify that configured pins remain responsive while idle processor consumption is reduced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100