beyondscreen/node-rpi-ws281x-native

does not run on Raspberry Pi ZeroW

Closed this issue · 1 comments

The first issue I've encountered was around the Raspberry PI CPU version which I've got around by updating the section of getNativeBindings() like so:

var raspberryVersion = (function() {
        var cpuInfo = require('fs').readFileSync('/proc/cpuinfo').toString(),
            // socFamily = cpuInfo.match(/hardware\s*:\s*(bcm27[0-9][0-9][0-9])/i);
            socFamily = cpuInfo.substring(cpuInfo.indexOf("Hardware"),cpuInfo.indexOf('\n',cpuInfo.indexOf("Hardware"))).split(':');
        if(!socFamily) { return 0; }
        var fam = socFamily[1].toLowerCase().trim();
        if(fam === 'bcm2835'){
        	return 3;
        }
        else if(fam === 'bcm2709'){
        	return 2;
        }
        else if(fam === 'bcm2708'){
        	return 1;
        }
        else{
        	return 0;
        }
    } ());

However now examples crash on init():

ws281x-native.js:151
    bindings.init(numLeds, options);
             ^

Error: init(): initialization failed. sorry – no idea why.
    at EventEmitter.ws281x.init (/home/pi/temp/neopixel-test/node_modules/rpi-sk6812-native/lib/ws281x-native.js:151:14)
    at Object.<anonymous> (/home/pi/temp/neopixel-test/node_modules/rpi-sk6812-native/examples/iterate.js:6:8)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Function.Module.runMain (module.js:703:10)
    at startup (bootstrap_node.js:193:16)
    at bootstrap_node.js:665:3

Any hints on how this could be fixed ?

Thank you,
George

Hey, sorry for not noticing this earlier!
Did you already solve this somehow? You could try to switch to the 1.x-branch (install with npm install rpi-ws281x-native@next). At least the error-messages should make a bit more sense there.