node.js


Raspberry pi 3 + node js controlling ws2811 leds


I am trying to control a string of rgb leds via my raspberry pi. I had this working via an arduino but I would like to do it directly from the pi.
I am using nodejs to do this, and the rpio library. I have connected the leds to the physical pin 19 (SPI - MOSI) and the ground to physical pin 39. Very similar to the arduino set up I had - basically a data and a ground connection. The power goes directly to the lights to take the load off the pi.
My issue is I cannot get the lights to turn on. I've been playing in the node repl trying to get it to work so the code I'm using is very basic:
const rpio = require('rpio');
rpio.spiBegin();
rpio.spiWrite(lights, lights.length);
I suspect its likely due to the lights buffer that I'm sending. Truth is I'm not sure what to send, right now I just populate a list with 50 (thats how many leds i have) 24 bit colors and then just convert it to a buffer with new Buffer(...).
I'm also not sure if my hardware is wired correctly. So any advice on that front also welcome.
If anyone provide a simple code snippet - preferably in nodejs - just so that I can test my lights are connected correctly. That way I can at least narrow down the problem to the software. If anyone has had experience with SPI using rpio any advice would also be helpful.
Pi pinout reference:
https://az835927.vo.msecnd.net/sites/iot/Resources/images/PinMappings/RP2_Pinout.png
The following is not my setup. I'm just using it to show I have 1 connection for 'data', a ground that is connected to pi and to the power supply. And then power straight to the lights (capacitor in that pic). Sorry this was the closest image I could find.
https://i.imgur.com/VP9iB1o.jpg
Ideally im trying to get to something like this:
https://www.youtube.com/watch?v=WLbLOEfoo8s
But I'd settle for 1 light turning on at this point ;)
I'm going to try and get in contact with the uploader aswell.
Let me know if any more info is required.
Any help is appreciated!

Related Links

node.js: get byte length of the string “あいうえお”
node-webkit windows build where to store persistent data?
Connect to MonetDb Virtualbox from node.js server app
stream.Writable: how to use CallBack while defining the prototype._write method?
Emit socket.io message on http get request (in Express.js)
starting node forever script with PORT=XXXX
How to use a npm modules in nightwatchjs based project
Session Invalidation in node.js with passport
nodejs driver for mongodb fndAndModify
Sorting a mongoDb Cursor
running multiple tests via npm test and jspm
How does bcrypt know which hashed method has been used
How to connect multiple sockets to sails in test
How to access static js files in EJS?
Nodejs npm step downloads packages on every build in TeamCity
Creating a array element in mongoose

Categories

HOME
linux-kernel
git
parsing
highcharts
recaptcha
local-storage
g2o
houndify
imageview
filesystems
mutex
external
aurelia-router
datagrid
apache-spark-2.0
osticket
ieee-754
jasperserver
slim
sourceforge
alexa-voice-service
face-recognition
fix
cassandra-cli
j
sirikit
laravel-blade
pad
4d-database
polymer-1.0
couchbase-view
stackdriver
google-developers-console
google-cloud-vision
python-datetime
pex
xml-configuration
bing-api
affiliate
spacing
jquery-chosen
fixtures
legacy
war
webmin
ats
oracle-ebs
model-driven
spring-cloud-sleuth
sw-precache
cartography
wistia
heyzap
autocompleteextender
cpio
visual-c++-2013
aide-ide
helium
rate
self-referencing-table
metamodel
kindle
lzma
powergrep
page-load-time
android-selector
reducers
wns
data-connections
divider
pdl
jedit
wx
steroids
bitarray
excel-2008
approximation
materialized-views
order-of-operations
childviewcontroller
reagent
setlocale
orchardcms-1.6
android-view
irssi
jsqlparser
kooboo
psychology
google-playground
declarative-services
bitmapimage
scite
meteor-slides
mic-1
tandem
pull-to-refresh
lytebox
nservicebus3
mysql-error-1052
customer-support
addr2line
nsinteger
memory-profiling
pasteboard
ubuntu-9.10
continuations
silverlight-embedded
mahjong
nsenumerator
sqlmetal

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App