Open westerxddd opened 4 years ago
I discovered the same and found that the same case statement with a return of 2 rather than 1 works as well. I was not able to determine what the return value is used for??
@CaskAle me too.
So i suspect this is only to limit script only for raspberry use.
I also had to add this line on a Raspberry Pi 4. Does the return value perhaps describe the device GPIO pinout?
I had to add: case 'bcm2711': return 1; to: lib/ws281x-native.js
var raspberryVersion = (function() { var cpuInfo = require('fs').readFileSync('/proc/cpuinfo').toString(), socFamily = cpuInfo.match(/hardware\s*:\s*(bcm\d+)/i); console.log(cpuInfo.match(/hardware\s*:\s*(bcm\d+)/i)); if(!socFamily) { return 0; } switch(socFamily[1].toLowerCase()) { case 'bcm2708': return 1; case 'bcm2835': return 1; case 'bcm2709': return 2; case 'bcm2711': return 1; <--- this line to work with my raspberry pi 4 default: return 0; } } ());
it's really works! thank you!
I had to add: case 'bcm2711': return 1; to: lib/ws281x-native.js