Hi. Ia working on an Andon projekt on Raspberry. The python code is working. Soni have some input buttons, output are lights Signal tower inkl. Music playing according the switched buton and also sending alert mail to particiapents. I made also a dashboard to this. And here is the main problem. In Node red the GPIO inputs are unknown. So with the simple flow which means rpi gpio input - debug node. There is nothing in debug menu. No info from status of GPIO input. Can you please help what is wrong.
HW and wiring is good. There is something between GPIO and Node red communication thanks a lot
Welcome to the forum @Miki1983
Did you use the recommended install script to install node-red?
If you did install using that method then open a command window and run
node-red-stop; node-red-start
That will stop and restart node-red. Then copy and paste (not screenshot please) the full output from the command here. Add lines containing just three backticks before and after the output to stop the forum from interpreting it as Markdown.
What version of Pi and OS are you running on? You can use
cat /proc/device-tree/model
and
cat /etc/os-release
to get that information.
Finally show us how you have configured the gpio node.
Edit: Also which pin have you connected to on the pi, and what status is showing under the gpio node?
Hi Colin. Thanks for your answer.
Yes the Node red Install i made direkt with this script von Github. here are the text after node red start:
Start Node-RED
Once Node-RED has started, point a browser at http://10.11.8.150:1880
On Pi Node-RED works better with the Firefox or Chrome browser
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
Starting as a systemd service.
Started nodered.service - Node-RED graphical event wiring tool.
13 Nov 07:29:18 - [info]
Welcome to Node-RED
===================
13 Nov 07:29:18 - [info] Node-RED version: v4.1.0
13 Nov 07:29:18 - [info] Node.js version: v20.19.1
13 Nov 07:29:18 - [info] Linux 6.12.47+rpt-rpi-v8 arm LE
13 Nov 07:29:18 - [info] Loading palette nodes
13 Nov 07:29:23 - [info] Dashboard version 3.6.6 started at /ui
13 Nov 07:29:25 - [info] Settings file : /home/multi/.node-red/settings.js
13 Nov 07:29:25 - [info] Context store : 'default' [module=memory]
13 Nov 07:29:25 - [info] User directory : /home/multi/.node-red
13 Nov 07:29:25 - [info] Projects directory: /home/multi/.node-red/projects
13 Nov 07:29:25 - [warn] No active project : using default flows file
13 Nov 07:29:25 - [info] Flows file : /home/multi/flows.json
13 Nov 07:29:25 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
13 Nov 07:29:25 - [warn] Encrypted credentials not found
13 Nov 07:29:25 - [info] Server now running at http://127.0.0.1:1880/
13 Nov 07:29:25 - [info] Starting flows
13 Nov 07:29:25 - [warn] [rpi-gpio in:MTC] GPIO pin 27 already set as type: input with pull down
13 Nov 07:29:25 - [info] Started flows
Raspberry Pi 4, model B, rev.1.5
PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"
NAME="Raspbian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=raspbian
ID_LIKE=debian
In Node red flow is first for the test only one GPIO 27 to test it if it works. Unfortunatelly there is only OK under the node. there are no state 0 or 1 shown.
thanks a lot
Admin edit: Added tripple backticks around log to prevent it being interpreted as Markdown
I have edited the post to add the backticks around the log as I suggested.
You have not shown us how you have configured the gpio node.
Have you got more than one gpio node configured for the same pin (maybe an gpio in and a gpio out)? That is not allowed.
Have you got another process trying to use that pin (a python script maybe)?
Hello
I have in node red only this one gpio node, but in python code is this same also used.
This is a problem?
Thanks
Colin via Node-RED Forum <notifications@nodered.discoursemail.com> (idĹ‘pont: Cs 13. 11. 2025, 10:41) ezt Ărta:
I believe that you cannot have two processes monitoring the same pin. It is easy to find out if that is the problem. Kill the python process and reboot.
Hi
I have tested, and you have right. without python code is node red running without problems.
so it means it can not work together?
thanks
št 13. 11. 2025 o 11:22 Colin via Node-RED Forum <notifications@nodered.discoursemail.com> napĂsal(a):
It means that only one process can access the GPIO pin at a time. You have to decide which process you want to access the pin.
The only problem is, that with the same GPIO (switch button) if its pull down, it sends alert email and also data to the csv file and also some visualization to the dashboard... thats why is it not so simple.
i try to do it with MQTT in python. or you have better idea? But thanks a lot, now i know where si the problem (two processes used the same GPIO)
št 13. 11. 2025 o 12:54 Colin via Node-RED Forum <notifications@nodered.discoursemail.com> napĂsal(a):
I would do everything in node-red, but if you want to do some in python and some in node-red then you could use MQTT as you suggest, or you could just link two input pins together and use one in python and the other in node-red.