I'd like to run the same thing in Note-red, so I have done a simple flow [{"id":"e7d70765.df79d8","type":"exec","z":"91cb8da0.1019d8","command":"python /home/franck/Bureau/Yann/wiiboard_test.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":390,"y":220,"wires":[["50e195f7.d2d324"],["49bfc4f6.1d350c"],["1c185622.fe1422"]]}]
but I got an error in the 3 outputs...
I have not idea why it is not working since it worked in my terminal...
It says "Host is down" near the end! Looks like the Python script it throwing an error.
Also you have appended the msg.payload, does that contain valid parameters?
Yes, I think the python script throw an error but I do not get why since when I run my code inside the terminal it works perfectly... the error "Trying to connect..." comes from my python code..
Thank you. It's better, the code begins to work. But I think that my main trouble is that inside my python code I do the init, then the connection and when this is done I can print the output of the signal... Probably that by doing this node-red, my python code is every time re read from the beginning whereas the init and connection should not be done a second time... I need to figure out how to pass this...
maybe use the node-red-node-daemon node - that is designed for longer running process (like scanning). You specify an app to run - then you can send it commands via the input and get outputs as they come back.