Closed riccardolardi closed 6 years ago
so you're using the 1.0 version?
This can happen when one of the option-values has an invalid value (i.e. it's not a number or a boolean). Here is the code that throws that error: https://github.com/beyondscreen/node-rpi-ws281x-native/blob/724303a4518314086fa5765e5c402218c30e8591/src/rpi-ws281x.cc#L105-L109
And this is where it is called:
Yes, I'm on the 1.0x branch. The line in my code that causes the error to be thrown is this:
var ledChannel = ws281x(60, {stripType: 'sk6812-grbw'});
The thing I don't undrstand is why it only happens when I run node-red with sudo?
If you don't, the initialization of the ws281x-library won't happen.
I know - any idea why this line triggers the error only when run as root? Or why it throws at all?
My fault - I was passing 60 as a string (not reflected in the snippet I put above) :|
I'm using your library as a dependency for a custom Node-RED node I'm working on. When I start node-red with no root privilege the program runs but obviously no LEDs light up as the library needs to have root privileges granted for GPIO access - but when I run node-red with sudo I get this error in console:
Any hint on where this stems from?