Hey there!
Managed to setup Node Red and I'm getting the input events, but when I try to set an output via MQTT it turns on briefly then back off.
I've uploaded a video of the behavior here:
https://www.youtube.com/watch?v=bfN-GiTGU00
The Red Lamp (O_2) is connected directly to the input in the main loop of the program.
The Green one (O_3) is supposed to be toggled by MQTT. It is marked as exported in PiCtory.
What am I doing wrong?
Thanks in advance!
Node Red MQTT set not working...ish
Moderator: RevPiModIO
- RevPiModIO
- KUNBUS
- Posts: 335
- Joined: 20 Jan 2017, 08:44
- Contact:
Re: Node Red MQTT set not working...ish
Hi cataliz3er!
If you are using RevPiModIO in your python program, it takes the complete control of the process image! So it forces the io states to the process image, which are set in the program! If you use MQTT or other programs parallel to the python program to set outputs, your python program will override the outputs, which are set from outside of it.
In your example: The MQTT System set output O_3 and the python program will switch it back to the value which is defined in the Python program (false).
If you want to change that, just add “shared_procimg=True” to your RevPiModIO(...) object in your Python program. Then it will sync the outputs and your system will work!
Sven
If you are using RevPiModIO in your python program, it takes the complete control of the process image! So it forces the io states to the process image, which are set in the program! If you use MQTT or other programs parallel to the python program to set outputs, your python program will override the outputs, which are set from outside of it.
In your example: The MQTT System set output O_3 and the python program will switch it back to the value which is defined in the Python program (false).
If you want to change that, just add “shared_procimg=True” to your RevPiModIO(...) object in your Python program. Then it will sync the outputs and your system will work!
Sven
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!