beyondscreen / node-rpi-ws281x-native

native bindings to drive WS2811 (or WS2812) LED-Controllers on a Raspberry Pi
MIT License
224 stars 101 forks source link

Raspberry Pi 4 Model B Rev 1.4 - Hardware not Supported Issue #127

Open parrfolio opened 2 years ago

parrfolio commented 2 years ago

I'm currently facing this issue in my node app. Running v17.4.0 and NPM 8.3.1 on a Raspberry Pi 4 Model B Rev 1.4. I'm having a difficult time getting past the bindings error. Is this library supported with this version of Raspi?

/ws281x-native.js:160
  bindings.init();
           ^

Error: Hardware revision is not supported

Note, when I run rpi-ws281x-python library examples my LEDs light right up. No errors. Only seeing errors in the Node JS implementation.

Sure could use some help from anyone who has faced this with this particular model. I've read and tried a lot of solutions but cannot get past this bindings issue.

parrfolio commented 2 years ago

Fixed this for Pi 4 Model B Rev 1.4 on Node 17.5 by

  1. Using https://github.com/gbkwiatt/node-rpi-ws281x-native#readme fork
  2. Then reinstalling rpi_ws281x library by following these instructions here https://github.com/ibmtjbot/tjbot/issues/158#issue-574903273

This combination of fork plus updating rpi_ws281x worked for me! Sharing for those struggling to use this library as I did.

More detailed instructions:

//install from package from @gbkwiatt instead of rpi-ws281x-native@latest 
(rpi-ws281x-native@latest had tons of build errors, simply would not install for me on any version of Node)
npm install @gbkwiatt/node-rpi-ws281x-native
//git clone outside project 
https://github.com/jgarff/rpi_ws281x.git
// cd to src 
~/node_modules/@gbkwiatt/node-rpi-ws281x-native/src
// delete rpi_ws281x existing library that came pre-installed
rm -rf rpi_ws281x/
// copy latest rpi_ws281x to src folder in node-rpi-ws281x
cp -r ~/rpi_ws281x ~/node_modules/@gbkwiatt/node-rpi-ws281x-native/src
// cd out to main folder to build
cd ~/node_modules/@gbkwiatt/node-rpi-ws281x-native/
// run rebuild
node-gyp rebuild