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

Integration of Sauceconnect with Nightwatch/NodeJS
Read application/X-www-form-urlencoded data from Angular 2 in express
passportjs deserializeUser nothing happen after call
Nodejs express, Heroku CORS
How to debug request-promise which fail with ETIMEDOUT
How to use Node http-proxy to serve external site in subfolder behind AWS load balancer with SSL
why mongoose queries dos not work when put inside promise function
How do I export a node.js module which is inside the Promise.all (somefunction) . then (function (){})
How to fix error when installing node.js on windows 7 32bit
PdfKit doc.pipe() error
Add custom login form to hapi-auth-basic
start command not working with node js firereader
node js scheduler iterates 3 times while it supposed to Fire only one Time
Rename uploaded images using MULTER
jsDoc: how to get object of required module
How do I send a buffer in an HTTP request?

Categories

HOME
linux-kernel
coldfusion
google-analytics
slickgrid
loops
sails.js
reporting-services
jsoup
unix
fiware
set
visual-studio-mac
google-home
distributed-database
jestjs
fontforge
pthreads
video-processing
amazon-route53
smt
sdl
pad
clang-format
httpsession
nlog
twitter-streaming-api
raycasting
messagebox
webm
radio
layer
product-key
dexguard
codeigniter-2
rrd4j
sqlcmd
james
envelope
digestive-functors
fpu
event-listeners
background-position
cakephp-2.x
tableau-public
slam
wamp-protocol
object-oriented-analysis
equation
android-build
csla
google-chrome-arc
gio
plone-4.x
nokia
grape
lunrjs
liquibase-hibernate
mongoose-web-server
jcarousel
lg
zodb
episerver-6-r2
pagerslidingtabstrip
swift-mt
hottowel
nameerror
qubole
xmlpullparser
protractor-net
materialized-views
smslib
protection
er-diagrams
wpftoolkit
dcraw
curator
class-relationship
subsonic2.2
xcode6.1
kiwi
rhodecode
objectarx
apparmor
opendocument
factoring
apiaxle
amazon-simpledb
resourcedictionary
interlacing
offlineapps
where-in
asp.net-compiler
amber-smalltalk
.class-file
mdbtools
robohelp
emacs-dirtree
lytebox
ejbql
camping
iphone-4
happstack
pubchem
generic-list
nsformatter
texinfo
scalaquery
wcsf
mindmapping
fibonacci-heap
layar
single-user
bootclasspath
entityreference
dynamic-css
live-cd
tibco-gi

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile