Using rpi-ws281x-python lib

I’m using the rpi-ws281x-python lib to control WS2812 LED stripes.

It was pretty easy to set it up and run some examples on my Pi Zero.

Now I’m doing a couple of .py scripts for my setup - and I want to trigger them with nymea.

I need to run the .py scripts with sudo, like sudo python3 because it needs access to PWM hardware on the Pi.

How can I define that in the command launcher?
I want to properly start and stop any script - tied to nymeas rule engine.


Given that nymea runs as root in the default setup, sudo shouldn’t be needed in the command launcher plugin. There is also a kill action in the plugin which should allow you to stop it again.

Hi! I used the Application launcher to start the .py - which works for me (no sudo required indeed).

If I try to start a python script with the Bashscript launcher then I get this error:

So, the difference between the two is that one starts binaries, the other starts a bash and executes bash “code”.

In your case, it probably fails because python3 isn’t in the path. You might still get it to work by using /usr/bin/python3 ... instead of just python3 ....