Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: tdotrob on Dec 08, 2015, 05:58 am

Title: Ws2801 and WiFi
Post by: tdotrob on Dec 08, 2015, 05:58 am
Hi, I have been controlling several strands of WS2801 (4-wire SPI) LEDs from an UNO R3 very happily.  I have distance sensors set up so that two or three people can interact to directly change the values for R, G and B by moving closer or farther away to the sensors.  I'd like to add Wi-Fi so I can send commands remotely, make the sensors mobile, and hide them.  (I sense an Elf-On-The-Shelf game of hide and seek coming up...the lights are orange so you are getting warmer!)

I tried a Huzzah and a NodeMCU but was unable to get the Adafruit 2801 library or FastLED working on them for the WS2801. 

The native Lua firmware looks like it might do the trick but I don't know any Lua and have already flashed both chips to Arduino.  Since I'm trying to do this in a classroom full of 3rd to 5th graders who are using Arduino I'd like to not introduce another platform.

I looked for tutorials to get the ESP8266 devices to talk to the UNO over serial.  Most of what I've found takes the approach "why bother to waste the ESP8266 as a simple serial bridge when you can use it as the primary MCU?"  The ones I did find pre-dated the Arduino IDE availability and mostly talk about level conversion.  Apparently if you can do that, the serial comms are a breeze and need little to no docs.

I tried using the native SPI libraries for the ESP8266 Arduino IDE but don't have the chops to climb that technical mountain before Christmas. I waded through the WS2801 spec sheet and sent the required frames inside of begin/end transaction, and tried as Mode0 and Mode2.  Nada.  Not even a flicker.

I can continue using what I have now and wait to see if the 2801 libraries are ported to the ESP hardware but before I call it a day I wanted to ask - anyone doing this successfully?  And by "this" I mean "driving WS2801 connected over WiFi using some combination of UNO, Huzzah, and/or NodeMCU"?  If so, can I ask what the approach was?

Thanks in advance.
-- T.Rob
Title: Re: Ws2801 and WiFi
Post by: tdotrob on Dec 09, 2015, 12:56 am
I kept searching the forum here and eventually ran into the excellent AltSoftSerial by Paul Stoffregen.  About 5 minutes after installing it I had my NodeMCU talking to my Ardunio Uno.  Awesome!  I will shortly have a string of WS2801 lights responding to MQTT commands and Tweets.  Even without responses, I got what I needed here. Thanks for the help!
Title: Re: Ws2801 and WiFi
Post by: twim on Dec 21, 2015, 06:13 pm
Hi,
you can also try my WiFiEsp library (http://yaab-arduino.blogspot.com/p/wifiesp.html).
It runs on the default ESP firmware and behaves like a standard Arduino WiFi shield.
Hope you may find it useful.
Title: Re: Ws2801 and WiFi
Post by: MrWonkerz on Apr 27, 2016, 09:40 pm
Could you explain how you managedgetting the WS2801 to work with nodemcu and AltSoftSerial by Paul Stoffregen? I'm now trying to get it running but it won't work