Hi community, it's that time of year again and I've got a few Pis around the place controlling strings of NeoPixels, I've modified the stringiest.py
I can initiate the python script no problem with the Exec node however I do not seem to be able to stop the script even when the node says killed, I've tried all combinations of SIGINT
, SIGQUIT
, SIGHUP
and SIGTERM
sadly no luck.
Is it something to do with needing to do sudo kill? if so how does one do that?
As ever I'm sure it's something blindly obvious I've missed, any help would be greatly appreciated.
[{"id":"a82c1e1b.dbe","type":"exec","z":"95b8f1c0.e06bf","command":"sudo python /home/pi/neopix.py","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":420,"y":400,"wires":[["6b08cd62.01fb84"],["916ca703.ef5588"],["4db11d4f.a5e754"]]},{"id":"6b08cd62.01fb84","type":"debug","z":"95b8f1c0.e06bf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":650,"y":360,"wires":[]},{"id":"916ca703.ef5588","type":"debug","z":"95b8f1c0.e06bf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":650,"y":400,"wires":[]},{"id":"4db11d4f.a5e754","type":"debug","z":"95b8f1c0.e06bf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":650,"y":440,"wires":[]},{"id":"9d7b5683.af8a08","type":"inject","z":"95b8f1c0.e06bf","name":"Go","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":400,"wires":[["a82c1e1b.dbe"]]},{"id":"cfb8a6d2.798938","type":"status","z":"95b8f1c0.e06bf","name":"","scope":["a82c1e1b.dbe"],"x":140,"y":540,"wires":[["f357f47d.d37178","7c8433be.8a479c"]]},{"id":"7c8433be.8a479c","type":"debug","z":"95b8f1c0.e06bf","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"status.text","targetType":"msg","x":420,"y":540,"wires":[]},{"id":"f357f47d.d37178","type":"function","z":"95b8f1c0.e06bf","name":"Set & Check LED PID","func":"//msg.payload = Number(msg.status.text.substring(4, 8))\n\nvar led_pid = Number(msg.status.text.substring(4, 8))\n\nif (led_pid === isNaN){return}\n\nglobal.set(\"ledpid\",led_pid)\n\nmsg.payload = led_pid\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":200,"y":600,"wires":[["d901617b.6d72a"]]},{"id":"d901617b.6d72a","type":"debug","z":"95b8f1c0.e06bf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":410,"y":600,"wires":[]},{"id":"1512d427.9caf6c","type":"function","z":"95b8f1c0.e06bf","name":"Get LED PID & Kill","func":"msg.pid = global.get(\"ledpid\")\nmsg.payload = global.get(\"ledpid\")\nmsg.kill = \"SIGTERM\"\nreturn msg\n\n//SIGINT, SIGQUIT or SIGHUP. Defaults to SIGTERM","outputs":1,"noerr":0,"initialize":"","finalize":"","x":150,"y":440,"wires":[["ce2149a7.c811e8","a82c1e1b.dbe"]]},{"id":"92a7204c.1ef76","type":"inject","z":"95b8f1c0.e06bf","name":"Stop","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":480,"wires":[["1512d427.9caf6c"]]},{"id":"ce2149a7.c811e8","type":"debug","z":"95b8f1c0.e06bf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"pid","targetType":"msg","statusVal":"pid","statusType":"auto","x":340,"y":460,"wires":[]}]