Artnet LED Pixels With ESP8266

86K141117

Intro: Artnet LED Pixels With ESP8266

After the success of my last Instructable, ESP8266 Artnet to DMX, I have completely revamped my espArtNetNode code, releasing v2 with new features such as RDM support and WS2812 output. This code is still in beta and there are a few known bugs - and probably a few unknown also.

I have written this Instructable to help with some common questions on setting this device up to control WS2812 pixels.

We will quickly look at how I have laid out and wired my 30 x 15 pixels, then I'll show you which settings you need to get the ESP connected. Next, I'll do a quick run through how to patch the ESP outputs into Jinx so we can get some cool effects running. In the final step, I'll discuss some of the issues I'm currently having and things I'd like to add in the future.

The video here will show you very quickly through all of these steps. I apologize for the poor sound quality - I don't have an external microphone and my laptop fans are really loud.

I'd love to see how you use this. Post some photos, videos and comments below to let me know your experience and any suggestions you may have. I read all the comments I receive and try to reply in a timely manner.

Let's get started....

STEP 1: Pixel Layout and Wiring

This step is fairly easy but very time consuming.

Find a board to mount everything to - I used a 6mm MDF sheet, 600mm x 1200mm in size.

Work out the best way to lay everything out. I had 3x 5m rolls of tape so decided to do 15x 1m strips. This gave me 200mm at the side for the electronics and PSU. I used small bolts and standoffs to mount the PSU and PCBs. Measure the hole spacing and drill through the MDF - you might want to make a test template using scrap paper first.

I spaced the tape so the LEDs are the same distance apart as they are on the tape. I used the adhesive already on the LED tape to stick it down. Make sure you pay attention to the data in and data out for each strip - have them alternate to make connecting the data lines easier, ending up in a snakelike pattern. Also make sure your ESP location is next to the data in for the first strip.

Now wire all the power up. I chose to run 3 power lines, 1 per 5m of tape, and each with it's own fuse. When using such a large PSU, I'd recommend fuses to ensure you don't damage anything if there's a short. I mounted my fuses to a small piece of perf board to make a basic power distro board. If your runs are longer than about 150 pixels, you'll need to "inject" power along the runs to ensure the LED brightness and colour doesn't suffer. Make sure you insulate any connections so you don't get a short.

Data can now be connected. My code will allow a max of 680 ws2812 pixels per port. Wire the ESP to the data in of the first strip. Wire the data out of the first strip to the data in of the second strip, data out of the second to data in of the third....

To finish it off, I ran a strip of black gaff tape to hold the end down and protect the small data connections when I move it around.

STEP 2: ESP8266 Hardware & Firmware

The PCB in the photos is of the prototype which I'm currently testing. It is not quite finalised so the PCB files aren't yet public. I have however put the schematic above. There are also earlier schematics available on my github along with a Max485 to Pixel schematic needed if you use this schematic in it's entirety - I bypassed the OK & Max485 in the schematic above for my testing.

Ensure you have the latest ESP8266 Arduino Core files and the latest Arduino IDE version.

You can get the latest source code and pre-compiled binaries for this project from my github. You can also submit bugs or requests using the Issues tab there or you can post in the comments below.

Flashing:

Open the source file, connect the ESP8266 and flash it. I'm not going to cover this here as it's already been covered.

Once you've flashed the ESP, unplug it for a few seconds before repowering it. I find a soft reset doesn't always work for me.

The next time you want to flash firmware, you can do so via the web UI explained in the next step. In the Arduino IDE, goto Sketch->Export Compiled Binary to generate a .bin file in your sketch directory. Then goto the ESP web UI, select the firmware tab and upload it there. This is much easier then connecting a USB-serial programmer each time. You can also use pre-compiled bin files from my github when they're released.

STEP 3: EspArtNetNode Config

Now that you've got the device firmware installed, we can start getting everything connected.

Your computer should be able to see a WiFi network called espArtNetNode_xxxxx (the network will have a random number based on the chip's ID). Connect to it - the default password is byMtongnz2017 which can be changed later if you wish.

Once you're connected, open your browser to 2.0.0.1 and you should see the settings UI shown above. The first page gives you a run down of your settings.

Head to the WiFi settings page. Either enter your WiFi SSID and password or you could use stand alone mode. Click save - the save button should turn green to indicate the ESP has saved the settings.

If you need, head to the IP settings page and set a static IP. Once again click save.

Now unplug your ESP, wait a few seconds and repower it. Once again, I find it sometimes doesn't work when using a soft reset.

Reconnect to your main WiFi and you should be able to now point your browser at your ESPs new IP. If you're using DHCP, you may need to check on your routers config page to find the IP. You should see the same settings UI.

Head to the port A and/or port B settings. Choose WS2812 as the port type then click save - you should now have options for your pixel output, filled with the defaults which should be fine for most people.

First set the protocol - I use Artnet but you can use sACN if desired. sACN will still use Artnet for discovery and configuration.

Next, set the number of pixels - less pixels per port will make the device faster so it pays to set it to what you actually have but leaving it higher wont cause any issues.

Make sure you have pixel mapping as the mode. 12 channel FX allows you to control all your pixels while only using 12 DMX channels. It's explained more on my github.

Finally set the Net, Subnet and Universe settings. Each DMX universe allows 512 channels, so 170 RGB pixels. Hence why we need 4 universes for 680 pixels :)

Once everything is set, click save again. Make sure you click save if you intend to leave the page as the device won't prompt you to save and you'll lose any changes.

STEP 4: Jinx Config

Jinx is a free software for controlling LED matrices. It is not the only software for this - there are heaps of others available, both free and paid.

Start off by unchecking the Start Output option in the Setup menu. You'll be unable to make any changes while this is enabled.

Now we need to add some Output Devices, also in the Setup menu. Click Add, select Artnet or sACN, turn off Broadcast, enter the ESPs IP, enter the Net, Subnet and Universe as per the settings from the previous step, and then click OK to save the device. You need to add a new device for each universe you'll need - I'm using 3 for my 450 pixels.

Once you've added all your devices, click Close. Open the Matrix Options and enter your pixel dimensions - for me it's 30 pixels wide by 15 high. I don't touch the other options. Click OK to save the settings and close the window.

Now open the Output Patch. This is the tricky part and you must match each pixel in the physical world with each pixel in Jinx. My pixels are patched in a snaking pattern, starting at the top left corner but you can have them in any configuration you'd like. Start by clicking Clear Patch - the patch should already be clear but this makes sure.

Red squares means there's no output patched to that pixel, green means there is. Click a square and you'll see the device it's patched to and the channel for red, green and blue. You can manually enter these for each pixel but that'll take a while.

Select the top left corner and click the Fast Patch button. Select the dimensions for what you're patching, for me it's X: 30, Y: 6 (180 pixels - it'll only patch 170 as that's the max per universe). In patch mode, select the wiring type you used, for me it's snake lines starting top left. Set your pixel order - normally RBG for ws2812. For the first channel, set it as 0 (Jinx counts from 0, not 1). Select your device - mine is 192.168.0.37 (0 | 0 | 0). Now click OK and your channels will be patched.

Use the fast patch in combination with manual patching until your entire matrix is patched. Then click close on the patch window.

Go back to the Setup menu and check the Start Output option.

Jinx should now be sending data to your pixels via the ESP - but it's probably all black for now. Have a play with the various effects and find something you like. Jinx allows you to scroll text, play video, have an EQ running and you can store scenes for later callback.

STEP 5: Bugs and Future Goals

As you can see here, there are a few bugs and feature requests that still need to be addressed. I'm going to discuss the main ones below and also mention my give away for people who help me out with these.

Main Bug:

The biggest bug at present it a watchdog timer reset which occurs about 10-20 minutes into operation. I haven't been able to find the cause of this yet. Suggestions for a cause at this stage are that it's related to a rouge interrupt or possibly the WiFi/service routines being blocked for too long. I am offering a reward for the person(s) who can fix this issue.

Feature Wish List:

Many of the other issues are more feature requests. They range from web UI improvements to support for other pixel types.

I would like to see a scene storage feature added as I have in v1.2 of this device. With the addition of the ws2812 support, there is a lot more data to store. I'd also like to be able to store chases. This is a feature for which there is a reward offered.

People would also like to have a hardware button or screen to select stored scenes. Once scenes storage is implemented, I think this would be easy to add.

I'd also like to allow DMX inout to control ws2812 output or DMX scenes on the other port. This may be quite tricky to implement.

Give Away

I am offering a few of my PCBs featured in this Instructable as prizes/rewards for people who contribute to this project. In addition to the 2 mentioned above, I'm giving one to someone who contributes the most. They will be fully populated and flashed with the latest firmware. Details are here.

81 Comments

I am having a difernt issue now.
C:\Users\elton.pimentel\Downloads\ESP8266_ArtNetNode_v2-master\source\espArtnetNode_2.0.0_b5g\ws2812Driver.cpp: In member function 'byte ws2812Driver::setPixel(uint8_t, uint16_t, uint8_t, uint8_t, uint8_t)':
C:\Users\elton.pimentel\Downloads\ESP8266_ArtNetNode_v2-master\source\espArtnetNode_2.0.0_b5g\ws2812Driver.cpp:89:1: error: no return statement in function returning non-void [-Werror=return-type]
89 | }

Does anyone have the solution to this error?
Hi. people. the trick its flashing the esp with a flasher and this .bin espArtnetNode_2.0.0_b5g.bin . but i have a problem .the lolin works nice, the reolume and jinx! and madrix reconized mani nodes and all of them work. but after 2 or 3 hours the esp lost the link and lost ip. sometimes lost the code. if some one can help me would really appreciate it. thank you very much to all.
I
have an issue with the patching process within JINX. Not sure if its
a JINX problem or ArtNetNode.


I
have a 16x16 matrix in a line-snaking-top-left configuration. When
I configure patch for Universe 0 (16x8 line-snaking-top-left start
channel number 0) the mapping is correct for Universe 0. Testing
with just Universe 0 works as expected. The problem I have is when I
attempt to add a second universe, again using the 16x8,
snake-line-top-left. Using the fast patch and starting at position
9,0 I configure a second universe named universe 1 (although tried
2,3,& 4). The second universe does not patch correctly. The
first 2 lines are correct “snaking” from left to right. BUT
lines 3 and beyond seem to be patched vertically rather than
horizontally as configured. I’ve tried using subsequent flashing
and multiple NodeMCUs but the problem persists. I’ve also tried
multiple smaller universes of just a couple of lines but the problem
persists. From what I observe, it seems that any universe other
than 0 doesn’t fast patch correctly. The problem remains the same
within subsequent universes. The patching starts in a horizontal
manner, then by itself seems to go vertical.
Hello, Thanks for tjis great project ! I'm musician and I work on it for my show. It works for me with dmx hardware controlled by QLC+ with d1 mini. Now I build a 75X8 matrix of ws2812 using jinx. There's two days that I have a problem to solve ( image below)
I want to create 4 universes : 0,1,2,3 in jinx, each universe controls two lines of 75 pixels (so 150 per universe or 450 dmx channels). but in the panel, there is a hole of 20 pixel on the universe 1 and 2, the first : number 0 is ok
I don't understand. I 've tested with port a et port b, it's the same. I have also tested my strip directly and It seems to be ok. I have tested with many outpatch different, I have changed the number of pixel by universe in the port A settings.....the same.

is that somebody has already had this problem ?
Thank you
Hi
Did you ever get this sorted. I'm in the same situation. I have a gap between the universes?
Hi kids,
The year is 2021. I'm a newb who got this to work on a ESP8266 NodeMCU but there were a few tricks I had to figure out. Thought I would share:

I used the Arduino IDE to flash my board. I suggest downloading the zip from mtongnz github for ESP8266_ArtNetNode_v2 . Remember to install all libraries that come with this zip into the correct Arduino IDE folder. On this GitHub there is an instruction to first try to put his version 1 DMX project on your board and use the web UI to flash the version 2 Bin file. I would advise against this. It's a dark road to go down. Stick with V.2

If you try to upload to this board with the latest software you will get a ton of errors. In the Arduino IDE you will need to install the esp8266 board manager. I installed down to version 2.4.2 and had success. The latest version of 2.7.4 gave errors. You should also downgrade your ArduinoJson library to 5.13.5. Version 6.17.3 gave errors.

I also was getting the same error as DJ Breiko here in the comments. I implemented his code change and that solved it. But this was done before I downgraded board manager and Json library. Doing these first might solve this problem too.

Final problem was that after powering everything up, setting up all the network and artnet settings, and wiring up the data line to my LED strip the whole strip lit up white. The pixel mapping program I am using could see the ESP node. There was communication but no control. After triple checking all settings the strip was still unresponsive aside from lighting up the whole thing. The solution was to download just the espArtnetNode_2.0.0_b5g.bin file from the github and re-flash it to the board using the Web UI option that you now should have. After that it just worked.

Another note for the other ultra newbs like me: The wiring schematic looks super overwhelming but if all you want to do is control an LED strip it's actually super simple. You just run 5v to the VIN pin which can take 5v. Then run a ground line to the GND pin next to it. Then run the TX pin to the Data input on your LEDs. And obviously run power to LEDs. I'm sure all the stuff on the schematic about 5vDC to DC power isolation is best practice if you are developing something serious but if you just trying to make lights blink pretty all you need is VIN, GND, TX.
Good Luck






Hello @mtongnz,
Even after so man years, this project attracts so much attention as it is a very interesting and kinda educational project.
There are several forks and pull requests of your project in github which seem to have solved/fixed (some) issues and that it is most likely working good.
It seems like you have dropped interest on this project or you don't want to dedicate more time on this and it's fine, but
can you please upload/share the PCB files?
I am looking forward for your response..
Kind regards and thank you in advance!
i cant seem to upload the bin to the wemos d1 mini. i can flash the v1 version fine, but as soon as v2 goes in it disables.
evwen when the v1 is flashed, en via the webbrowser gui the v2 is tried to upload, it does not work :(
hanks for your work!
As I couldn't get v1.20 running, I tried to run v2.0.
Again I'm getting compiling errors:


C:\Users\cysign\Desktop\Artnet-Empfänger\ArtNetNode\source\espArtnetNode_2.0.0_b5g\ajax.ino: In function 'bool ajaxSave(uint8_t, ArduinoJson::JsonObject&)':

ajax:101:55: error: ambiguous overload for 'operator~' (operand type is 'IPAddress')

C:\Users\cysign\Desktop\Artnet-Empfänger\ArtNetNode\source\espArtnetNode_2.0.0_b5g\ajax.ino:101:55: note: candidates are:

C:\Users\cysign\Desktop\Artnet-Empfänger\ArtNetNode\source\espArtnetNode_2.0.0_b5g\ajax.ino:101:55: note: operator~(uint32_t {aka unsigned int}) <built-in>

C:\Users\cysign\Desktop\Artnet-Empfänger\ArtNetNode\source\espArtnetNode_2.0.0_b5g\ajax.ino:101:55: note: operator~(u32_t {aka long unsigned int}) <built-in>

C:\Users\cysign\Desktop\Artnet-Empfänger\ArtNetNode\source\espArtnetNode_2.0.0_b5g\ajax.ino:101:55: note: operator~(int) <built-in>

exit status 1
ambiguous overload for 'operator~' (operand type is 'IPAddress')
Solution of the ambiguous overload is in the comments below :)
You'll find the line to replace in ajax.ino line 101!

//deviceSettings.broadcast = deviceSettings.ip | (~deviceSettings.subnet); //faulty line
change to:
deviceSettings.broadcast = uint32_t(deviceSettings.ip) | ~uint32_t(deviceSettings.subnet); //this one works :) thanks to DJ_BREIKO
Hi everyone. It is working forme, but with two minor issues.
The first one is about using the two outputs (Port A and Port B) to drive 680 LEDS each. There is some delay on the 7th and 8th universes.
The second issue happens when I try to generate the bin file again from Arduino IDE I am getting the following error:
C:\Users\elton.pimentel\Downloads\ESP8266_ArtNetNode_v2-master\ESP8266_ArtNetNode_v2-master\source\espArtnetNode_2.0.0_b5g\ajax.ino:101:55: error: ambiguous overload for 'operator~' (operand type is 'IPAddress')
deviceSettings.broadcast = deviceSettings.ip | (~deviceSettings.subnet);
Does anybody has some fixes for any of this problems?
Thanks.
Regarding the problem with the ambiguous overload, the solution was simple. I have cahnged the code line to deviceSettings.broadcast = uint32_t(deviceSettings.ip) | ~uint32_t(deviceSettings.subnet);
I'm going to throw out a mistake:

"collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Generic ESP8266 Module."

Is there any solution?
Thanks.
I just discovered this project and am totally jazzed. I've done some DMX stuff but this will be my first attempt with ArtNet. Thanks for leading the way.

This will be a perfect compliment to my DMX Node project, which has smaller BOM. I note you added opto-isolators with your latest design. Excellent. I only used one for my receive-only node but that still left the output pin exposing the board to transients. Fail. Time to redesign that.
Alrighty, I've scoured just about every comment and read both versions of this project and I can't seem to get it to output to LED's with a nodeMCU.

Changes undergone in my limited understanding of this :
-uploaded fresh .bin through firmware option on esp.
-output from tx
-3.3v regulator going to esp w/ 5v rail on side for ws2812's, all powered from a stand-alone psu. USB power removed once IDE work was finished and esp configured online
-tried cpu speed to 160mhz for IDE upload (couldn't interface with esp on browser beyond load screen). Reuploaded at 80 as that was the most progress



Present Status:
-OTA interface works great, all settings easily changed, OTA update received
-Occasional all-white on the led's, doesn't seem to be linked to anything but moving pins around
-jinx I believe is configured correctly (refer to pictures) as I've used the same setting with the same static ip with another unit (teensy). The only thing that makes me think otherwise is the Artnetominator is showing that, although the node is being seen, no data is being output anywhere.
-Unit is nodeMCU 1.0, i'm pretty nub at this, and I'm a visual person. I don't think I messed up the wiring but it's hard for me to understand diagrams so I could of (breadboard pictured)
-When outputting artnet from QLC+, Artnetominator showed that it wasn't outputting to the nodes specifically even though it was directed towards the node's ip. BUT the led's turned on all white and one blue (maybe fried?) (not the intended setting and the LED's didn't change from there.) Even stranger was the tiny blue led from the ESP started to flicker very quickly and remained solid after closing QLC+.

I honestly am so frustrated with this project that I'm resorting to bothering ya'll. Thanks to any assistance from anyone.


That's a cool project, and it works form me at the on the first try.

I connect to jinx! and resolume and works well.

There is only an issue that turns me out. Sometimes when the NodeMCU was plugged off lost the configuration information about the wifi it has to connect and i don't know why.

Anyone has an idea why?

Thanks for all your work!!

Im trying to get this working with the NodeMCU as well and cant for the life of me figure out what pins correspond to the A and B channel. Do you have any insight? Thank you!

More Comments