Giter VIP home page Giter VIP logo

node-rpi-ws281x-native's People

Contributors

achingbrain avatar coderesting avatar drewcovi avatar febe95 avatar gavspav avatar granjow avatar guuz avatar joakimunge avatar kunaakos avatar natcl avatar nicklasfrahm avatar paulchabotca avatar usefulthink avatar zefiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-rpi-ws281x-native's Issues

does not run on Raspberry Pi ZeroW

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

Could not verify raspberry-pi version

Hi,
Trying to use the rainbow example, I got this message :
Could not verify raspberry-pi version. If this is wrong and you are running this on a raspberry-pi

My node version is 7.7.4.

Using the cpuInfo object, here is what I get for the hardware section:

Hardware : BCM2835
Revision : a02082
.....

Compilation error

Hi,
Using npm install I get this error.
To be clear, I had to uninstall the package.

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | arm
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/node-rpi-ws281x-native/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/.node-gyp/7.9.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/pi/.node-gyp/7.9.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/pi/node-rpi-ws281x-native',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
make: Entering directory '/home/pi/node-rpi-ws281x-native/build'
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/ws2811.o
  CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/pwm.o
  CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/dma.o
  CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/mailbox.o
  CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/board_info.o
  AR(target) Release/obj.target/rpi_libws2811.a
  COPY Release/rpi_libws2811.a
  CXX(target) Release/obj.target/rpi_ws281x/src/rpi-ws281x.o
In file included from /usr/include/c++/4.9/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.9/memory:62,
                 from /home/pi/.node-gyp/7.9.0/include/node/v8.h:21,
                 from /home/pi/.node-gyp/7.9.0/include/node/node.h:42,
                 from ../node_modules/nan/nan.h:49,
                 from ../src/rpi-ws281x.cc:1:
/usr/include/c++/4.9/bits/stl_pair.h:109:15: internal compiler error: Segmentation fault
       : first(), second() { }
               ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
Preprocessed source stored into /tmp/cc5q8c2V.out file, please attach this to your bugreport.
rpi_ws281x.target.mk:95: recipe for target 'Release/obj.target/rpi_ws281x/src/rpi-ws281x.o' failed
make: *** [Release/obj.target/rpi_ws281x/src/rpi-ws281x.o] Error 1
make: Leaving directory '/home/pi/node-rpi-ws281x-native/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.50-v7+
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/node-rpi-ws281x-native
gyp ERR! node -v v7.9.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok 

investigate problem with short typed-arrays

quoting from #5:

One thing I have noticed is that if you new up an Uint32Array with length 15 or under, it balks in the
C++ code claiming it's not a Uint32Array. This might be an internal node/io.js "optimisation" though.

Cannot build on RPi B+

When executing the build command with the verbose option

pi@raspberrypi /var/node/LED-Stips/hello/node-rpi-ws281x-native $ sudo node-gyp rebuild -v
gyp info it worked if it ends with ok
gyp verb cli [ 'node', '/usr/local/bin/node-gyp', 'rebuild', '-v' ]
gyp info using [email protected]
gyp info using [email protected] | linux | arm
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `python2 -c "import platform; print(platform.python_version());"` returned: "2.7.3\n"
gyp verb get node dir no --target version specified, falling back to host node version: v0.10.32
gyp verb command install [ 'v0.10.32' ]
gyp verb install input version string "v0.10.32"
gyp verb install installing version: 0.10.32
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 0.10.32
gyp verb build dir attempting to create "build" dir: /var/node/LED-Stips/hello/node-rpi-ws281x-native/build
gyp verb build dir "build" dir needed to be created? /var/node/LED-Stips/hello/node-rpi-ws281x-native/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /var/node/LED-Stips/hello/node-rpi-ws281x-native/build/config.gypi
gyp verb config.gypi checking for gypi file: /var/node/LED-Stips/hello/node-rpi-ws281x-native/config.gypi
gyp verb common.gypi checking for gypi file: /var/node/LED-Stips/hello/node-rpi-ws281x-native/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn python2
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/node/LED-Stips/hello/node-rpi-ws281x-native/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.node-gyp/0.10.32/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.node-gyp/0.10.32',
gyp info spawn args   '-Dmodule_root_dir=/var/node/LED-Stips/hello/node-rpi-ws281x-native',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture arm
gyp verb node dev dir /root/.node-gyp/0.10.32
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/var/node/LED-Stips/hello/node-rpi-ws281x-native/build'
make: *** No rule to make target 'Release/obj.target/rpi_libws2811/src/rpi_ws281x/ws2811.o', needed by 'Release/obj.target/rpi_libws2811.a'.  Stop.
make: Leaving directory '/var/node/LED-Stips/hello/node-rpi-ws281x-native/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.12.29+
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" "-v"
gyp ERR! cwd /var/node/LED-Stips/hello/node-rpi-ws281x-native
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok

System:

$ cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

File System going read-only! With latest raspbian updates

I originally raised this issue against another project: jamesbulpin/meshblu-connector-ws2811#4 However after some further investigation it appear the issue is rooted in this library.

Issue:
After running the test program or the examples on a Raspberry Pi 3 with Raspbian Jessie + all updates as of 17 June 2017. The file system gets marked read-only. Checking dmesg shows lots of errors from the moment the program starts:

[  303.215569] mmc0: timeout waiting for hardware interrupt.
[  303.218188] mmcblk0: error -110 transferring data, sector 10372992, nr 8, cmd response 0x900, card status 0xc00
[  313.455603] mmc0: timeout waiting for hardware interrupt.
[  313.465817] mmcblk0: error -110 transferring data, sector 3767312, nr 8, cmd response 0x900, card status 0xc00
[  323.695659] mmc0: timeout waiting for hardware interrupt.
[  323.698214] mmcblk0: error -110 transferring data, sector 3767312, nr 8, cmd response 0x900, card status 0xc00
[  323.698359] blk_update_request: I/O error, dev mmcblk0, sector 3767312
[  323.698418] Aborting journal on device mmcblk0p2-8.
[  333.935677] mmc0: timeout waiting for hardware interrupt.
[  333.938401] mmcblk0: error -110 transferring data, sector 92160, nr 8, cmd response 0x900, card status 0xc00
[  344.175717] mmc0: timeout waiting for hardware interrupt.
[  344.178360] mmcblk0: error -110 transferring data, sector 92160, nr 8, cmd response 0x900, card status 0xc00
[  344.178480] blk_update_request: I/O error, dev mmcblk0, sector 92160
[  344.178502] Buffer I/O error on dev mmcblk0p2, logical block 0, lost sync page write
[  344.178552] EXT4-fs (mmcblk0p2): previous I/O error to superblock detected
[  344.179720] EXT4-fs error (device mmcblk0p2): ext4_journal_check_start:56: Detected aborted journal
[  344.179727] EXT4-fs error (device mmcblk0p2): ext4_journal_check_start:56: Detected aborted journal
[  344.179738] EXT4-fs (mmcblk0p2): Remounting filesystem read-only
[  344.180900] EXT4-fs (mmcblk0p2): ext4_writepages: jbd2_start: 6144 pages, ino 22151; err -30

See attached
dmesg.txt for full log.

I've reproduced this on 3 different (all new) SD Cards:

  • Sandisk 8GB - man:0x000003 oem:0x5344 name:SL08G hwrev:0x8 fwrev:0x0
  • Samsung Pro 16GB - man:0x00001b oem:0x534d name:00000 hwrev:0x1 fwrev:0x0
  • Integral 16GB - man:0x00009e oem:0x4245 name: hwrev:0x1 fwrev:0x0

Everything works fine when using the base Raspbian Image (2017-04-10-raspbian-jessie), it breaks with updates issued after that release. These updates are:

PROGRAM: login INSTALLED: 1:4.2-3+deb8u3 AVAILABLE: 1:4.2-3+deb8u4
PROGRAM: perl INSTALLED: 5.20.2-3+deb8u6 AVAILABLE: 5.20.2-3+deb8u7
PROGRAM: perl-base INSTALLED: 5.20.2-3+deb8u6 AVAILABLE: 5.20.2-3+deb8u7
PROGRAM: perl-modules INSTALLED: 5.20.2-3+deb8u6 AVAILABLE: 5.20.2-3+deb8u7
PROGRAM: libc6-dev INSTALLED: 2.19-18+deb8u7 AVAILABLE: 2.19-18+deb8u9
PROGRAM: libc-dev-bin INSTALLED: 2.19-18+deb8u7 AVAILABLE: 2.19-18+deb8u9
PROGRAM: rpcbind INSTALLED: 0.2.1-6+deb8u1 AVAILABLE: 0.2.1-6+deb8u2
PROGRAM: libc-bin INSTALLED: 2.19-18+deb8u7 AVAILABLE: 2.19-18+deb8u9
PROGRAM: libc6-dbg INSTALLED: 2.19-18+deb8u7 AVAILABLE: 2.19-18+deb8u9
PROGRAM: libc6 INSTALLED: 2.19-18+deb8u7 AVAILABLE: 2.19-18+deb8u9
PROGRAM: libtirpc1 INSTALLED: 0.2.5-1 AVAILABLE: 0.2.5-1+deb8u1
PROGRAM: libudev1 INSTALLED: 215-17+deb8u6 AVAILABLE: 215-17+deb8u7
PROGRAM: udev INSTALLED: 215-17+deb8u6 AVAILABLE: 215-17+deb8u7
PROGRAM: initramfs-tools INSTALLED: 0.120+deb8u2 AVAILABLE: 0.120+deb8u3
PROGRAM: libsystemd0 INSTALLED: 215-17+deb8u6 AVAILABLE: 215-17+deb8u7
PROGRAM: libpam-systemd INSTALLED: 215-17+deb8u6 AVAILABLE: 215-17+deb8u7
PROGRAM: systemd INSTALLED: 215-17+deb8u6 AVAILABLE: 215-17+deb8u7
PROGRAM: systemd-sysv INSTALLED: 215-17+deb8u6 AVAILABLE: 215-17+deb8u7
PROGRAM: libgnutls-openssl27 INSTALLED: 3.3.8-6+deb8u4 AVAILABLE: 3.3.8-6+deb8u5
PROGRAM: libtasn1-6 INSTALLED: 4.2-3+deb8u2 AVAILABLE: 4.2-3+deb8u3
PROGRAM: libgnutls-deb0-28 INSTALLED: 3.3.8-6+deb8u4 AVAILABLE: 3.3.8-6+deb8u5
PROGRAM: libldap-2.4-2 INSTALLED: 2.4.40+dfsg-1 AVAILABLE: 2.4.40+dfsg-1+deb8u2
PROGRAM: libavutil54 INSTALLED: 6:11.8-1~deb8u1+rpi1 AVAILABLE: 6:11.9-1~deb8u1+rpi1
PROGRAM: libavresample2 INSTALLED: 6:11.8-1~deb8u1+rpi1 AVAILABLE: 6:11.9-1~deb8u1+rpi1
PROGRAM: libavcodec56 INSTALLED: 6:11.8-1~deb8u1+rpi1 AVAILABLE: 6:11.9-1~deb8u1+rpi1
PROGRAM: librtmp1 INSTALLED: 2.4+20150115.gita107cef-1 AVAILABLE: 2.4+20150115.gita107cef-1+deb8u1
PROGRAM: libavformat56 INSTALLED: 6:11.8-1~deb8u1+rpi1 AVAILABLE: 6:11.9-1~deb8u1+rpi1
PROGRAM: libisc-export95 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libdns-export100 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libgudev-1.0-0 INSTALLED: 215-17+deb8u6 AVAILABLE: 215-17+deb8u7
PROGRAM: libicu52 INSTALLED: 52.1-8+deb8u4 AVAILABLE: 52.1-8+deb8u5
PROGRAM: libisccfg-export90 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libirs-export91 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libnss3 INSTALLED: 2:3.26-1+debu8u1 AVAILABLE: 2:3.26-1+debu8u2
PROGRAM: libwbclient0 INSTALLED: 2:4.2.14+dfsg-0+deb8u5 AVAILABLE: 2:4.2.14+dfsg-0+deb8u6
PROGRAM: libsmbclient INSTALLED: 2:4.2.14+dfsg-0+deb8u5 AVAILABLE: 2:4.2.14+dfsg-0+deb8u6
PROGRAM: samba-libs INSTALLED: 2:4.2.14+dfsg-0+deb8u5 AVAILABLE: 2:4.2.14+dfsg-0+deb8u6
PROGRAM: libswscale3 INSTALLED: 6:11.8-1~deb8u1+rpi1 AVAILABLE: 6:11.9-1~deb8u1+rpi1
PROGRAM: libtiff5 INSTALLED: 4.0.3-12.3+deb8u2 AVAILABLE: 4.0.3-12.3+deb8u3
PROGRAM: libxslt1.1 INSTALLED: 1.1.28-2+deb8u2 AVAILABLE: 1.1.28-2+deb8u3
PROGRAM: samba-common INSTALLED: 2:4.2.14+dfsg-0+deb8u5 AVAILABLE: 2:4.2.14+dfsg-0+deb8u6
PROGRAM: multiarch-support INSTALLED: 2.19-18+deb8u7 AVAILABLE: 2.19-18+deb8u9
PROGRAM: passwd INSTALLED: 1:4.2-3+deb8u3 AVAILABLE: 1:4.2-3+deb8u4
PROGRAM: tzdata INSTALLED: 2016j-0+deb8u1 AVAILABLE: 2017b-0+deb8u1
PROGRAM: vim-tiny INSTALLED: 2:7.4.488-7+deb8u2 AVAILABLE: 2:7.4.488-7+deb8u3
PROGRAM: vim-common INSTALLED: 2:7.4.488-7+deb8u2 AVAILABLE: 2:7.4.488-7+deb8u3
PROGRAM: wget INSTALLED: 1.16-1+deb8u1 AVAILABLE: 1.16-1+deb8u2
PROGRAM: bind9-host INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libisc95 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libdns100 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libisccc90 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libisccfg90 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: libbind9-90 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: liblwres90 INSTALLED: 1:9.9.5.dfsg-9+deb8u10 AVAILABLE: 1:9.9.5.dfsg-9+deb8u11
PROGRAM: locales INSTALLED: 2.19-18+deb8u7 AVAILABLE: 2.19-18+deb8u9
PROGRAM: binutils INSTALLED: 2.25-5 AVAILABLE: 2.25-5+deb8u1
PROGRAM: ca-certificates INSTALLED: 20141019+deb8u2 AVAILABLE: 20141019+deb8u3
PROGRAM: git-man INSTALLED: 1:2.1.4-2.1+deb8u2 AVAILABLE: 1:2.1.4-2.1+deb8u3
PROGRAM: git INSTALLED: 1:2.1.4-2.1+deb8u2 AVAILABLE: 1:2.1.4-2.1+deb8u3
PROGRAM: git-core INSTALLED: 1:2.1.4-2.1+deb8u2 AVAILABLE: 1:2.1.4-2.1+deb8u3
PROGRAM: libblas-common INSTALLED: 1.2.20110419-10 AVAILABLE: 3.7.0-1~bpo8+1
PROGRAM: libblas3 INSTALLED: 1.2.20110419-10 AVAILABLE: 3.7.0-1~bpo8+1
PROGRAM: libbluray1 INSTALLED: 1:0.6.2-1 AVAILABLE: 1:0.9.3-3
PROGRAM: libcupsfilters1 INSTALLED: 1.0.61-5+deb8u3 AVAILABLE: 1.0.61-5+deb8u3+rpi1
PROGRAM: liblapack3 INSTALLED: 3.5.0-4 AVAILABLE: 3.7.0-1~bpo8+1
PROGRAM: libmwaw-0.3-3 INSTALLED: 0.3.1-2 AVAILABLE: 0.3.1-2+deb8u1
PROGRAM: raspberrypi-sys-mods INSTALLED: 20170313 AVAILABLE: 20170519
PROGRAM: raspi-config INSTALLED: 20170307 AVAILABLE: 20170503
PROGRAM: rc-gui INSTALLED: 1.7 AVAILABLE: 1.9
PROGRAM: realvnc-vnc-server INSTALLED: 6.0.3.27095 AVAILABLE: 6.1.1.28093
PROGRAM: realvnc-vnc-viewer INSTALLED: 6.0.3.27095 AVAILABLE: 6.1.1.28093
PROGRAM: rpi-chromium-mods INSTALLED: 20170317 AVAILABLE: 20170614
PROGRAM: sudo INSTALLED: 1.8.10p3-1+deb8u3 AVAILABLE: 1.8.10p3-1+deb8u4
PROGRAM: unzip INSTALLED: 6.0-16+deb8u2 AVAILABLE: 6.0-16+deb8u3
PROGRAM: libraspberrypi-dev INSTALLED: 1.20170405-1 AVAILABLE: 1.20170427-1
PROGRAM: libraspberrypi-doc INSTALLED: 1.20170405-1 AVAILABLE: 1.20170427-1
PROGRAM: raspberrypi-kernel INSTALLED: 1.20170405-1 AVAILABLE: 1.20170427-1
PROGRAM: libraspberrypi-bin INSTALLED: 1.20170405-1 AVAILABLE: 1.20170427-1
PROGRAM: libraspberrypi0 INSTALLED: 1.20170405-1 AVAILABLE: 1.20170427-1
PROGRAM: raspberrypi-bootloader INSTALLED: 1.20170405-1 AVAILABLE: 1.20170427-1
PROGRAM: raspberrypi-ui-mods INSTALLED: 1.20170315 AVAILABLE: 1.20170503

I've not narrowed down which update triggers this conflict. I can confirm that running other applications including sysbench tests of the filesystem and memory don't trigger any problems.

Once the system has gone read-only it recovers if you reboot the RPi.

Pwm1

Hello my name is Carlos I want to know how I can configure pwm to use raspberry channel 1 because I have conflicts with that channel and Audio.

I appreciate your collaboration.

Cant build :-(

25 http GET https://registry.npmjs.org/rpi-ws2812-native
26 http 404 https://registry.npmjs.org/rpi-ws2812-native
27 verbose headers { date: 'Mon, 08 Dec 2014 18:04:10 GMT',
27 verbose headers server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)',
27 verbose headers 'content-type': 'application/json',
27 verbose headers 'cache-control': 'max-age=0',
27 verbose headers 'content-length': '52',
27 verbose headers 'accept-ranges': 'bytes',
27 verbose headers via: '1.1 varnish',
27 verbose headers age: '0',
27 verbose headers 'x-served-by': 'cache-ams4139-AMS',
27 verbose headers 'x-cache': 'MISS',
27 verbose headers 'x-cache-hits': '0',
27 verbose headers 'x-timer': 'S1418061850.793670,VS0,VE92',
27 verbose headers 'keep-alive': 'timeout=10, max=50',
27 verbose headers connection: 'Keep-Alive' }
28 silly registry.get cb [ 404,
28 silly registry.get { date: 'Mon, 08 Dec 2014 18:04:10 GMT',
28 silly registry.get server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)',
28 silly registry.get 'content-type': 'application/json',
28 silly registry.get 'cache-control': 'max-age=0',
28 silly registry.get 'content-length': '52',
28 silly registry.get 'accept-ranges': 'bytes',
28 silly registry.get via: '1.1 varnish',
28 silly registry.get age: '0',
28 silly registry.get 'x-served-by': 'cache-ams4139-AMS',
28 silly registry.get 'x-cache': 'MISS',
28 silly registry.get 'x-cache-hits': '0',
28 silly registry.get 'x-timer': 'S1418061850.793670,VS0,VE92',
28 silly registry.get 'keep-alive': 'timeout=10, max=50',
28 silly registry.get connection: 'Keep-Alive' } ]
29 silly lockFile 7b9f093c-rpi-ws2812-native rpi-ws2812-native@
30 silly lockFile 7b9f093c-rpi-ws2812-native rpi-ws2812-native@
31 error 404 404 Not Found: rpi-ws2812-native
31 error 404
31 error 404 'rpi-ws2812-native' is not in the npm registry.
31 error 404 You should bug the author to publish it
31 error 404 It was specified as a dependency of 'rpi-ws281x-native'
31 error 404
31 error 404 Note that you can also install from a
31 error 404 tarball, folder, or http url, or git url.
32 error System Linux 3.12.28+
33 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "rpi-ws2812-native"
34 error cwd /home/pi/ws2812/node-rpi-ws281x-native
35 error node -v v0.10.33
36 error npm -v 1.4.28
37 error code E404
38 verbose exit [ 1, true ]

Support for Pi 3 Model B?

I'm having a very difficult time getting this library to work with Pi 3 Model B.

Using an 74AHCT125 level converter on my breakout board, similar to this guide for the ws281x python library

I'm using NeoPixels but I can't get any voltage out of my converter... wondering if there is a library support issue.

I've already modified my audio param and HDMI hotplugs, per the pi 3 support issue in ws281x.

Let me know if you have any thoughts, or if this library simply isn't up to date enough to support pi 3.

Thanks!

Autorun script

Not an issue with the library but I'm struggling to run my script automatically on boot.

Perhaps it would be useful for people if anyone could help me nail it!

I currently have sudo node /myscript.js & in a script which gets executed via rc.local.

The script won't run - I'm guessing its something to do with permissions.

Lower values only update every 16

I'm running an Adafruit Neopixel strip of 120 lights (Should be ws2812), hooked up to a raspberry pi via a 74AHCT125 3.3v to 5v converter. Values on the darker ranges only seem to update every 16 steps. For an example:

  • 0x000009 = Completely off
  • 0x000010 = On
  • 0x000019 = Same as 0x000010
  • 0x000020 = Very notably brighter than 0x000019

Is this an issue of hardware, or am I doing something wrong?

Edit: Might as well post my code:

const ws281x = require('rpi-ws281x-native');
const NUM_LEDS = 120,
	pixelData = new Uint32Array(NUM_LEDS);
ws281x.init(NUM_LEDS); 
let pow = 0;
setInterval(() => {

	pow = (pow+1)%255;
	for( let i =0; i < NUM_LEDS; ++i )
		pixelData[i] = pow;

	ws281x.render(pixelData);

}, 100);

Throw error and/or return mock.

Hello,

I'm using this module in my app and stumbled upon the following.
During development I don't want to run as root (why should i?) and I cant really use this module anyway because it only works on a Pi.
The code here logs to strerr and exits the process. This is not very friendly for a consumer.

I would propose we throw an error that the consumer can detect and ignore during development.
Maybe the mock implementation could be made available to use too.

Curious to hear what your opinion is on this! I can work on a PR if we come to a solution.

Compatibility with Johnny Five?

Has anyone gotten this to work with Johnny five? I think the native library and rasp-io don't get along even though they are going after different pins.

I made some test code to take the working rainbow example and speed it up while a button is being held down:

const ws281x = require('rpi-ws281x-native');
const five = require('johnny-five');
const Raspi = require('raspi-io');

const board = new five.Board({
  io: new Raspi()
});

let rainbow;

const NUM_LEDS = parseInt(process.argv[2], 10) || 20,
    pixelData = new Uint32Array(NUM_LEDS);

ws281x.init(NUM_LEDS);

// ---- trap the SIGINT and reset before exit
process.on('SIGINT', () => {
  ws281x.reset();
  process.nextTick(() => { process.exit(0); });
});

const RAINBOW_FAST = 100;
const RAINBOW_SLOW = 1000;
let offset = 0;

const makeRainbow = (speed) => {
  if (rainbow) {
    clearTimeout(rainbow);
  }

  rainbow = setInterval(() => {
    for (let i = 0; i < NUM_LEDS; i++) {
      pixelData[i] = colorwheel((offset + i) % 256);
    }

    offset = (offset + 1) % 256;
    ws281x.render(pixelData);
  }, speed / 30);
}

console.log('Press <ctrl>+C to exit.');


// rainbow-colors, taken from http://goo.gl/Cs3H0v
function colorwheel(pos) {
  pos = 255 - pos;
  if (pos < 85) { return rgb2Int(255 - pos * 3, 0, pos * 3); }
  else if (pos < 170) { pos -= 85; return rgb2Int(0, pos * 3, 255 - pos * 3); }
  else { pos -= 170; return rgb2Int(pos * 3, 255 - pos * 3, 0); }
}

function rgb2Int(r, g, b) {
  return ((r & 0xff) << 16) + ((g & 0xff) << 8) + (b & 0xff);
}

board.on('ready', function() {
  const button = new five.Button('GPIO23');
  button.on('down', () => {
    console.log('button down');
    makeRainbow(RAINBOW_FAST);
  });

  button.on('up', () => {
    console.log('button up');
    makeRainbow(RAINBOW_SLOW);
  });
});

makeRainbow('RAINBOW_SLOW');

// ---- animation-loop
var offset = 0;
setInterval(function () {
  for (var i = 0; i < NUM_LEDS; i++) {
    pixelData[i] = colorwheel((offset + i) % 256);
  }

  offset = (offset + 1) % 256;
  ws281x.render(pixelData);
}, 1000 / 30);

What I expect to happen: Rainbow effect speeds up when button is pressed, slows down when released.

What actually happens: I get the button up/down console logs from the johnny-five part, but the rainbow doesn't display. The LEDs don't light at all.

Secondary output: Pin 13 on Rpi b+ and a+ broken

Hi

It looks like the library is having trouble initializing the new PWM Pin 13 on the a+ and b+.

Im working on a project that would utilizes both 18 and 13. Perhaps this is an easy fix?

Thanks

Example uses index mapping.

Hello,

One of the examples isn't working for me because it's using a mapping:
https://github.com/beyondscreen/node-rpi-ws281x-native/blob/master/examples/iterate.js#L8

Especially for this example it's nice to have no mapping. That way you can see how your strips are connected (if you have multiple strips). And mappings are always specific for every user/implementation so maybe it's a good idea to leave them out for all examples.

What do you think?

I can make a PR if you want, though it's only 1 line ;-)

Update brightness, without changing color

I'm completely new to this, so apologies in advance if this is a simple task, but I would like to know how to update just the brightness of my strip, without affecting a solid color that's already been preloaded by another script. If that's not possible, is there any way to detect the state/color the strip is, set the color from that, and then change the brightness.

[rpi-ws281x-native] Could not verify raspberry-pi version

Hi Team,

I am using raspberry Pi 3 model B.
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : BCM2835
Revision : a02082
Serial : 00000000441b8267

But when I load rpi-ws281x-native & run tests, the LED does not change.
Getting error: [rpi-ws281x-native] Could not verify raspberry-pi version.

Could you please help.

Thanks,
Divya Bansal

"Failed to open /dev/vcio" Error

Hi, tried to run on my device. I have a Raspberry 2 with HASS.IO (resin.io os) and I get this errors:

Failed to open /dev/vcio, trying old method. Can't open device file /dev/mailbox-26: Operation not permitted Error: init(): initialization failed. sorry – no idea why. at Error (native) at EventEmitter.ws281x.init (/usr/src/pixel-wall/node_modules/rpi-ws281x-native/lib/ws281x-native.js:136:14)

Can someone help me?
Thank you very much

TODO for v1.0

node-module and native parts

  • support for multiple PWM channels (issue: #18)
  • support for different binary-formats (i.e. CanvasPixelData, Uint8Array and Uint32Array, Buffer/ArrayBuffer)
  • a tiny bit more abstraction: the public api should be fully implemented in Javascript, so the underlying native-implementation is able to move without breaking BC
  • generic implementation for per pixel and full data-array operations (color-correction, channel-splitting, whatever..)
  • switch to node-pre-gyp instead of node-gyp

rpi_ws281x

  • update library to use the original repository again, now that a lot of compatibility-work has happened there

Soundcard conflict on RPi3

The file mentioned in the radme wasn't found on my RPi3/Raspbian. This worked for me

Create a kernel module blacklist file that prevents all the sound drivers from loading:

  1. sudo vi /etc/modprobe.d/blacklist-rgb-matrix.conf
  2. add the following lines:
blacklist snd_bcm2835
blacklist snd_pcm
blacklist snd_timer
blacklist snd_pcsp
blacklist snd
  1. Save the file and quit vi
  2. sudo update-initramfs -u
  3. reboot and confirm no snd modules are running by executing the command lsmod

v1.0 consolidation

A rewrite of the library with adjusted API and rewritten native bindings is on it's way and did just pass some initial testing.

The new code can be found here: https://github.com/beyondscreen/node-rpi-ws281x-native/tree/v1.x

This issue is used to consolidate all open issues that are resolved by these changes.

TODOs

  • dynamic DMA selection (would be awesome, but right now no idea how to do this: #61
  • implement legacy-api wrapper
  • all data visible to the user should be in 4-byte format (Int32BE), internally reformatted as appropriate for RGB and RGBW LEDs
  • Test across different node-versions
  • Test across different hw-versions

Adventurous? Here's how to play with it..

For this early stage where you might actually need to fiddle with the code, I'd recommend cloning the repository to your workstation, checking out the v1.x-branch and and using the upload-script to get the files over to you raspberry-pi for testing.

For me that looks like this:

UPLOAD_DEST="[email protected]:/home/martin/rpi-ws281x-dev" npm run upload

where UPLOAD_DEST is the destination-argument to an rsync-call (this requires that you have ssh setup using a private key instead of password).

My current workflow (two terminals open, one locally in my project and one on the raspi in ~/rpi-ws281x-dev)

  • edit something
  • run npm run upload (see above)
  • on the pi: node-gyp build (if changes involved the .cc-file) and sudo node examples/new-api.js

problems with reset() and finalize() in the new api

With the new version (1.x)
I get the following error when I call reset():

Press <ctrl>+C to exit.
^C/home/pi/leds/node_modules/rpi-ws281x-native/lib/ws281x-native.js:93
    this.array.fill(0);
              ^

TypeError: Cannot read property 'fill' of null
    at Channel.[_reset] (/home/pi/leds/node_modules/rpi-ws281x-native/lib/ws281x-native.js:93:15)
    at channels.forEach.channel (/home/pi/leds/node_modules/rpi-ws281x-native/lib/ws281x-native.js:173:46)
    at Array.forEach (native)
    at Function.reset (/home/pi/leds/node_modules/rpi-ws281x-native/lib/ws281x-native.js:173:12)
    at process.<anonymous> (/home/pi/leds/node_modules/rpi-ws281x-native/examples/new-api.js:10:10)
    at emitNone (events.js:86:13)
    at process.emit (events.js:185:7)
    at Signal.wrap.onsignal (internal/process.js:217:44)

Also finalize() does a segmentation fault.

Any ideas ?

Thanks !

Does not run on Raspberry pi 3 B+

Tried the v1.0.0 version on Raspberry pi 3 B+ and it says it could not verify the raspberry version and to file a bug report.

Thanks !

Installation fails on current node-version

I reinstalled Raspbian and installed the current node (v10.3.0 with npm v6.1.0).
Installation of rpi-ws281x-native failed during node-gyp rebuild.
Using nvm to use node v8.0.0 with npm v5.0.0 helped since it could be build now.

Logs (v10.3.0, npm v6.1.0):
2018-06-03T10_11_26_415Z-debug.log
terminal-output.txt

I'm definitely not a C/C++ programmer but I think I'll may further investigate this out of curiosity. But I'm not sure if I can help you with this. :/

Conflict with Audio (was: Conflict with Pure Data)

I'm trying to run the library in conjunction with Pd-extended (https://puredata.info) on the RPI 2.

When I open Pure Data on the Pi the rainbow.js patch stops working properly.

If I close it and start it again I get some leds flickering, seemingly randomly.

Closing Pure Data does not solve this. I have to restart the Pi before the rainbow patch will run properly.

I have tried assigning each process to a separate core, using taskset, but it makes no difference.

Any way around this?

Root required

Hi,

Seems to require running with sudo e.g.:

sudo node node_modules/rpi-ws281x-native/examples/rainbow.js 190

How can I run it as my normal user - gpio-admin or something similar (didn't seem to work for me)

WS2813 GPIO ?

WS2183 LED Strip has four line

GND, 5V, D0, B0

B0 is the backup line.

D0 => #12 PIN
B0 => ?

Best way to change to rgb output?

This is from an email but it would be better on here.

Ages ago I dug deep into the library and swapped the r and the g of the rgb around so that it would render correctly on my grb led's!

Now I'm using a different installation and can't remember how the hell I did it! I think that proves I am degenerating. Any idea where to look? You might have even told me in the first place!

I'm sure I'll find it - when I do this would probably be useful for the read me?

Gavin

As the underlying driver still lacks support for GRB-LEDs (jgarff/rpi_ws281x#17) I think it would be best to simply manipulate the Uint32Array in Javascript before it get passed to the native driver.
For this, the best option would be to use the "beforeRender"-event fired here https://github.com/raspberry-node/node-rpi-ws281x-native/blob/master/lib/ws281x-native.js#L146

Something like this:

var ws281x = require('rpi-ws281x-native');

ws281x.on('beforeRender', function(arr) {
// do whatever you want with the pixel-data in arr
});

Hope it helps.
Martin

Does not compile

when I try to install this module, I get compile errors:
pi@raspberrypi:~/tjbot/recipes/speech_to_text $ npm install rpi-ws281x-native
\

[email protected] install /home/pi/tjbot/recipes/speech_to_text/node_modules/rpi-ws281x-native
node-gyp rebuild

make: Entering directory '/home/pi/tjbot/recipes/speech_to_text/node_modules/rpi-ws281x-native/build'
CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/ws2811.o
CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/pwm.o
CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/dma.o
CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/mailbox.o
CC(target) Release/obj.target/rpi_libws2811/src/rpi_ws281x/board_info.o
AR(target) Release/obj.target/rpi_libws2811.a
COPY Release/rpi_libws2811.a
CXX(target) Release/obj.target/rpi_ws281x/src/rpi-ws281x.o
In file included from ../src/rpi-ws281x.cc:1:0:
../node_modules/nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
rpi_ws281x.target.mk:85: recipe for target 'Release/obj.target/rpi_ws281x/src/rpi-ws281x.o' failed
make: *** [Release/obj.target/rpi_ws281x/src/rpi-ws281x.o] Error 1
make: Leaving directory '/home/pi/tjbot/recipes/speech_to_text/node_modules/rpi-ws281x-native/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.1.18-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/tjbot/recipes/speech_to_text/node_modules/rpi-ws281x-native
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the rpi-ws281x-native package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls rpi-ws281x-native
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.1.18-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "rpi-ws281x-native"
npm ERR! cwd /home/pi/tjbot/recipes/speech_to_text
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/tjbot/recipes/speech_to_text/npm-debug.log
npm ERR! not ok code 0

Pi Detection

Raspberry Pi 1B not detected:

$ cat /proc/cpuinfo

processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 000d
Serial          : 00000000c5b4676c

installation-problems with node 6

submitted by @ben0bi as comment in #29

I could not install it with nodejs v6 and I could not install nodejs v4.
For me, it works with nodejs v0.12.

Would like to mark this as todo, compatibility for nodejs >= v4
(Or is it my system? I use the RetroPie-Distro and LXDE as window manager. Multipurpose is the key.)

init(num_pixels) never returns

I had been using the December 8th version just fine. Now after putting it on a new pi and ending up with the latest node and this library, init() never returns.

build instructions and verification for RPi2

Apparently, there is an updated version of the rpi_ws281x-library which also supports the RPi2 here: https://github.com/richardghirst/rpi_ws281x

In order to support the RPi2 in this module we need to do the following:

  • test if that new version also works with the RPi1.
  • update the module to use the new version.

Unfortunately, I don't own a RPi2, so I need someone else to test this.

instructions

(all of this should be done on the raspberry-pi)

First, you'll need a clone of this repository.

git clone --recursive https://github.com/raspberry-node/node-rpi-ws281x-native.git
cd rpi-ws281x-native

And verify that the build works as it is:

npm install -g node-gyp
node-gyp rebuild

Switch the submodule to the forked library:

  • edit .gitmodules to contain the git-url of the forked repository, should read

    [submodule "src/rpi_ws281x"]
        path = src/rpi_ws281x
        url = [email protected]:richardghirst/rpi_ws281x.git
    
  • next, we need to tell git to update the submodule content

    git submodule sync
    git submodule update --remote --force
    

    at this point git should be telling you something like

    remote: Counting objects: 19, done.
    remote: Compressing objects: 100% (4/4), done.
    remote: Total 19 (delta 5), reused 5 (delta 5), pack-reused 10
    Unpacking objects: 100% (19/19), done.
    From github.com:richardghirst/rpi_ws281x
    de5a765..39afaac  master     -> origin/master
    Submodule path 'src/rpi_ws281x': checked out '39afaac5f2b8b307d7d7b5f2f790fbb6759bda5e'
    

    check for the commit-id in the last line, if that one matches, everything worked fine.

  • from what i saw, the forked library introduced some new C-files, so you need to edit the binding.gyp, which contains the recipes for building the library and the node-module. The interesting section is the sources-list in lines 16-20. Might be as easy as adding the new files (board_info.c and mailbox.c).

  • you can always check if it works by running node-gyp rebuild

  • if it works, there is one more thing left: in lib/ws281x-native.js there is a routine that checks the CPU-ID before the module is loaded. This should be extended to include the CPU-ID of the RPi2 (have a look at the output of cat /proc/cpuinfo, the line should start with "Hardware:").

Finally: Send a PR.
Thanks a lot for your help!

[rpi-ws281x-native] it looks like you are not running on a raspberry pi

Hello, I went through the same Adafruit tutorial that you linked to with a single neopixel on a raspberry pi 2 and am able to get a rainbow animation using their python code. I'd prefer to work in JS so thought I'd try out your library. Unfortunately when I run sudo node rainbow.js I get:

[rpi-ws281x-native] it looks like you are not running on a raspberry pi so there will be no functionality exposed by this module. For convenience, implementation stubs are provided.

Any ideas why this is happening? Help appreciated!

Using any control line other than BCM 18

Has anyone gotten any other interface to work? I am doing this:

   var ws2812 = require('../../node_modules/rpi-ws281x-native/lib/ws281x-native');
   ws2812.init(NUM_LEDS, {gpioPin: 18});

and if I use any value other than 18 (i.e. 10 or 21) as the gpioPin I get this error:

   <snip>/node_modules/rpi-ws281x-native/lib/ws281x-native.js:136
   bindings.init(numLeds, options);
   ^
   Error: init(): initialization failed. sorry – no idea why.
   at Error (native)

I am running on a Raspberry Pi Zero. Pin 18 is basically working but I am getting irregular delays on the write command. I am driving a 60 LED strip and most calls to write take <2ms, but every minute or so a write will take ~600ms to ~1200ms ... I'm only looking to use SPI to see if this problem can be solved.

I am running on Jessie, node 6.10.3.

=======================================================

Opps, sorry, should have read through all of the other issues, one gave me the tip of trying:

{dmaNum: 10}
and it seems to have fixed the blocking.

I'd still like to know if anyone else has gotten SPI to work, for when I want to control multiple strips.

Error when trying to run rainbow.js

Just trying to get some lights working on an image from https://ccrma.stanford.edu/~eberdahl/Satellite/ .It is basically raspbian as I understand it.

I've installed node.js - when I run the rainbow patch I get the following error (below).

No idea if this is an issue with the library - probably not - but any idea whats going on?

ccrma@satellite ~/node_modules/rpi-ws281x-native/examples $ sudo node rainbow.js 40
Can't open device file /tmp/mailbox-3693: Permission denied
Can't open device file /tmp/mailbox-3693: Permission denied
Can't open device file /tmp/mailbox-3693: Permission denied
/home/ccrma/node_modules/rpi-ws281x-native/lib/ws281x-native.js:119
bindings.init(numLeds, options);
^
Error: init(): initialization failed. sorry – no idea why.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.