ESP8266: Artnet receiver

Posted on Updated on

The other I was playing with a matrix of led. The matrix is made of a stripe of WS2801.

So, here is what I have done.

  1. I flash a new lua based firmware in the ESP8266 using Marcel’s NodeMCU custom build cloud service.
    Add WS2801 and / or WS2812 modules
  2. Wait and download the compiled firmware
  3. Flash it using the tool ESPtool
  4. I use ESPlorer to program the ESP
    1. Create a new ini.lua
    2. Copy the following lines of code.
      This is for a matrix 10×10 “snakelines”

      wifi.setmode(wifi.STATION)
      wifi.sta.config("******","******",1)
      tmr.delay(5000000)   -- wait 1,000,000 us = 1 second
      
      ws2801.init(0, 2)
      tmr.delay(1000000)
      
      ws2801.write(string.char(0,0,0):rep(100))
      
      s=net.createServer(net.UDP)
      s:on("receive",function(s,c) ws2801.write(string.sub (c, 19, 318)) end)
      s:listen(6454)
  5. Use Jinx or Glediator (I prefer Jinx) to drive the matrix and send the Artnet commands to the ESP8266

It works very well.
The code is simple and works well. I haven’t tried on large matrix but I think for larger matrix a fast wifi connection would be needed.

Advertisements

3 thoughts on “ESP8266: Artnet receiver

    Philippe Maegerman said:
    May 5, 2016 at 5:19 pm

    Hello,

    thank you for your code, this is my first project with nodemcu. I have run these leds with arduino and raspberry pi before, time for a new challenge.

    I have only used the udp part of your code to drive 104 leds ( 8*13 ), if I send 104 * blue, only the first 16/17 ones get the right color, the other ones go random.

    Do you have an idea what can cause this ? could it be because of the 3.3V from nodemcu ? Do you use a level shifter on the data line ?

    Here’s my code :

    ws2801.init(4, 5)
    tmr.delay(1000000)
    ws2801.write(string.char(0,0,255):rep(104))

    Cheers

    Like

      DV responded:
      May 13, 2016 at 10:38 pm

      Hi Philippe,
      which version of Nodemcu are you using?
      I didn’t use any level shifter. Do you have enough power for all the stripe?
      In my Matrix 10×10, I inject 5 vdc every 25 leds.

      Like

    pim_man said:
    May 24, 2016 at 11:15 pm

    Hello, just saw your reply …
    I have nodemcu 1.0, never managed to drive the ws2801, the ws2812 do work, even without level shifter, power was OK 5V40A , connected every 50 pixels.
    I gave up on LUA and managed to have my matrix running with arduino IDE and Fastled, using UDP :
    http://pastebin.com/rBSD0Sqm
    No problems, only solutions ;P
    Cheers

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s