Update 1 August 2019 – added the connectors to the list of components.
Update 4 July 2019 – You may also want to check out this instructable, which describes a more sophisticated ESP8266-based solution.
Update 6 April 2019 – I wrote a follow up post on the timing and jitter in DMX512 signals and fixed a bug in the firmware.
Update 26 May 2017 – added photo’s of second exemplar and screen shots of web interface for OTA.
Professional stage and theatre lighting fixtures are mainly controlled over DMX512. To allow a convenient interface between the EEGsynth and this type of professional lighting systems, I built an Artnet-to-DMX512 converter. It quite closely follows the design of my Artnet-to-Neopixel LED strip module.
Let me first show the finished product. It has a 5 pin XLR connector, a 2.1 mm power connector, and a multi-color status LED:
Here is the working prototype based on a NodeMCU board
It consists of the following components :
- NodeMCU Lua ESP8266 development board (replaced by a Wemos D1 mini in the final version)
- MAX485 Module TTL To RS-485
- common cathode RGB led
- 2x 220 Ohm and 1x 100 Ohm resistors
- 3 or 5 pin female panel-mount XLR connector
- 2-24V to 5V DC-DC Boost-Buck converter (not in the prototype)
- 2.1 mm dc panel-mount barrel jack connector (not in the prototype)
I was first planning to follow the design of Matthias Hertel, which includes an optical isolation between the MCU board and the DMX output. But I realised that the costs of the isolation transformer and optocoupler are more than the ESP8266, so I decided to keep it simple and not to add over-voltage protection. I would have added protection in case it had been directly coupled to the USB port of a computer, but in this case the computer connects over WiFi.
Another consideration is the voltage to drive the RS485 output. While testing, my Stairville LED flood panel seems quite happy with the 3.3V provided by the NodeMCU board. Driving the whole MAX485 module at 3.3V is therefore an option. But I figured that the MAX485 module can also be powered with 5V (causing a 5V differential signal on its output) while the TTL input to the module is at 3.3V.
In principle it would be possible to provide power on the micro-USB port of the NodeMCU. However, the wall of the enclosure in which I’ll put it is quite thick. This would result in the micro-USB being too deep for some cables/chargers. Furthermore, my experience is that it is not so easy to mount the ESP8266 board firmly enough to prevent it from moving when connecting/disconnecting the cable. Hence I opted for a 5.5 x 2.1 mm panel mount DC jack connector to provide 5V power. Since there are power adapters (wall warts) with 9 and 12 Volt, I included a 2-24V to 5V DC-DC power converter.
The source code is available from github. It is based on the code for my Artnet Neopixel controller. It was especially convenient to reuse the part for initially configuring the wifi, for configuring the settings, and for over-the-air updating.
The repository on github includes the details on how to wire the components.
Update 26 May 2017
Per Huttner asked me to make one for the next EEGsynth performance. The only change compared to the first one (see above) is that I used a 3-pin XLR connector.
Here you can see the web interface upon initial startup (while connected to the ARTNET access point). As access point it sends this “captive” configuration screen automatically, just like a login screen on a public wifi network. The wifi configuration is based on WiFiManager.
Following WiFi setup it resets and after some 10 seconds the led shoudl turn green. At that point you can connect to the web interface. If you are using OS X with bonjour or Linux with zeroconf, you can connect to http://artnet.local. If your computer does not support zeroconf (e.g. on windows) you will have to log in on your router to look up the IP address that your router has assigned to it.
In the settings you can configure the universe that is to be forwarded from Art-Net to DMX512 and the number of channels. Specifying fewer channels makes the DMX message shorter and hence allows for more frequent (and smoother) updates. The delay is the (approximate) time between DMX packets. The default is 25ms, i.e. 40 packets per second, which is approximately fastest that you can transmit with the full 512 channels.
The monitor window shows the firmware version, the uptime in seconds, the number of Art-Net packets received and the frame refresh. The frame refresh is actually not accurate, since reading from the web interface shuts down the refreshing. You can read more accurate numbers from http://artnet.local/json.
HI,
I get DNSServer.h: No such file or directory error when compiling on IDE version 1.6.5 and esp8266 core version 3,tried older rc ESP8266 core with same result.
Can you tell me how to fix this error so code will compile please ?
Hi Dave,
I am using the Arduino version 1.8.3 and the ESP8266 board libraries version 2.3.0. In my case (on Mac OS) the file is in ./Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/DNSServer/src/DNSServer.h
Looking at the ESP8266 core for Arduino on github, I see that the library and header still exists in the latest version at https://github.com/esp8266/Arduino/tree/master/libraries.
However, I also see that 2.3.0 is the latest release. So I don’t know where you got “version 3” from.
best
Robert
HI Robert
i sea you heve Experience on ES28266 microcontroller and dmx protocols. i am a new user in stm32f103cb and arduino .
i need a sample code or a library that Receive dmx data on usart pin and for example control led light by a PWM .
in avr arduino i use this library [ https://github.com/mathertel/DMXSerial ]
it work whit atmega168 very good. how i can convert this library for stm32f103cb ?
can you help me ?
thank
Hi Dehghan,
I don’t know anything about the STM32 micro controllers or about receiving DMX signals, only about sending it. But the general idea would be that you would connect a RS-485 controller such as the MAX485 to an input pin of the STM32. I suggest you check on the STM32 support site.
good luck,
Robert
Hello, I need to solve a doubt, after the first connection, I set up for the wifi and everything happens correctly.
When I try to access the address: http: //artnet.local/ or by the ip assigned by the router I get the message that the file does not exist – File Not found …
On the first connection everything happens fine, after that it does not allow me to connect to change configuration information
Hi Alex,
Did you write the files that are in the “data” directory to the SPIFFS filesystem? If not, please google for “write data to spiffs using arduino”.
best,
Robert
Tks!
Here the solution : https://github.com/esp8266/Arduino/blob/master/doc/filesystem.rst#uploading-files-to-file-system
ESP8266FS is a tool which integrates into the Arduino IDE. It adds a menu item to Tools menu for uploading the contents of sketch data directory into ESP8266 flash file system.
Download the tool: https://github.com/esp8266/arduino-esp8266fs-plugin/releases/download/0.3.0/ESP8266FS-0.3.0.zip.
In your Arduino sketchbook directory, create tools directory if it doesn’t exist yet
Unpack the tool into tools directory (the path will look like /Arduino/tools/ESP8266FS/tool/esp8266fs.jar)
Restart Arduino IDE
Open a sketch (or create a new one and save it)
Go to sketch directory (choose Sketch > Show Sketch Folder)
Create a directory named data and any files you want in the file system there
Make sure you have selected a board, port, and closed Serial Monitor
Select Tools > ESP8266 Sketch Data Upload. This should start uploading the files into ESP8266 flash file system. When done, IDE status bar will display SPIFFS Image Uploaded message.
It’s works for me ! Wifi, ArtNet, DMX output !
I have only a problem with the website pages… Files not found 🙁
It works only for Artnet.local/json
I’m using it with Photon for iPad : http://photon-ios.com
You should write the content of the “data” directory as a SPIFFS filesystem to the ESP8266. See the details of the solution that is described in other comments.
Hi, thank you for sharing your project.
Is it possible to use it as access point , without using an existing network ?
Tks.
In the current implementation that is not possible. It uses https://github.com/tzapu/WiFiManager to do the initial connection to an existing WiFi network, as long as it is not connected to WiFi it will not get to the main code that deals with the Artnet and DMX. If you were to remove that from the code and instead start the ESP8266 in AP mode, the subsequent code should just work fine.
Hi,
I can’t connect to my Wemos D1.
In the Serial monitor there are these line:
setup starting
loadConfig
Failed to open config file
*WM:
*WM: AutoConnect
*WM: Connecting as wifi client…
*WM: Already connected. Bailing out.
*WM: IP Address:
*WM: 192.168.1.6
connected
setup done
*WM: freeing allocated params!
Can you help me?
it seems that your Wemos is connecting just fine to your WiFi network. You should be able to connect at http://192.168.1.6. Did you write the content of the “data” directory as a SPIFFS filesystem to the ESP8266? You may want to try a simple http server example in combination with WiFi first.
Hi Robert,
I’ve got a problem: I tested your project with QLC+ and also one of my Stairville LED Flood Panel.
The serial output shows that the wemos d1 mini receives packages, but the flood panel doesn’t react.
I’m not sure whether the MAX485 is broken, I tried several.
I tested the wiring from the image of your prototype (with the NodeMCU) and the DI LED glows much brighter.
Do you have any advices for further testing/debugging? Thanks in advance! Bernhard
Hi Bernhard,
It is important to use a proper termination connector at the end of the DMS bus, for example this https://www.thomann.de/gb/stairville_dmx_endstecker_xlr_3pol.htm.
I only have a few DMX fixtures to test with, and so far realized three Artnet adapters. I occasionally also had problems with getting DMX devices to work. I tried both with 5V and with 3.3V, but did not notice a difference in robustness. I remember that I had the plus and minus wire swapped on the XLR connector at a certain point, so you may want to check the polarity.
If you have access to an oscilloscope, please use it to verify the shape of the analog signal on the DMX cable. I have a mini DS203 oscilloscope, it has helped me on multiple occasions to identify poor solder joints and weird (analog) signal shapes that mess up the digital communication.
Someone else who built my design used another (more low-level) method to time the breaks. Please search for SERIAL_BREAK in the code to see the two options.
You may also want to follow up on https://github.com/robertoostenveld/arduino/issues/5
Good luck,
Robert
Hi Robert,
I’ve set up my NodeMCU, AP cobnfiguration went fine, here’s the log:
loadConfig
Failed to open config file
*WM:
*WM: AutoConnect
*WM: Connecting as wifi client…
*WM: Already connected. Bailing out.
*WM: IP Address:
*WM: 10.0.0.138
connected
setup done
I can ping the NodeMCU but I can’t access the website, I get “file not found”, though I’ve uploaded the data directory twice (according to cclleemm’s instruction). Any idea?
Hi Andreas, you should use the Arduino IDE to write the data (i.e. all the html, css and javascript files in the data directory) to the SPIFFS filesystem on the ESP8266. Please look at the other comments. Best regards, Robert
Hello
I have installed the (wemos D1pro) as described below, but unfortunately I do not see it in the DMX Workshop App. Led turns green and the webserver is perfect.
Hi LM, The hardware is only a receiver of UDP packets over wifi, which are translated into DMX signals on the cable. It does not send anything over wifi, so it cannot be detected by any software running on a computer. You should configure the DMX-Workshop software to send DMX signals in the right channels to the right universe. Best regards, Robert
Hi.
This is great. I have built one unit to have a go but for some reason when i am sending artnet from qlc it doesn’t correspond to the channels. The light is channel 1.2.3 but i can control it with channel 2 4 6 from qlc. I wonder what am i doing wrong. Any advice will be appreciated. Thank you.
Keep up good work.
The channels in DMX space (cable) being shifted by one compared to Artnet (wifi) suggests that there is an offset issue. Some programming languages start counting at 0, some at 1. However, I have never observed this problem myself.
Could you try with other software than QLC? Or perhaps look into QLC forums whether this has been reported before?
Could you try to confirm the issue with another DMX fixture?
For debugging the firmware, I suggest you connect the ESP8266 over a serial interface and that you increase the debug info that is printed in the onDmxPacket function in esp8266_artnet_dmx512.ino. In that function you see that incoming “data” is copied to “global.data”, which is regularly transmitted over the DMX cable. You can also change the code so that “data” gets shifted when copied into “global.data”.
thank you very much for your reply.
I did try few fixtures and other softwares and got the same issue.I have tried debugging and printed : “universe”; “length”;”sequence”; and ” *data “;
but couldn’t print “data” or “global.data” (was getting error overloaded ‘print(uint8_t*&)’ is ambiguous)
At the end i noticed u updated the project and i have downloaded ur new compilation and this worked!!!!
I am very pleased but still dont understand what was the issue which bugs me a bit.
how would i print the full artnet msg recieved?
I really appreciate your time.
Thank you.
data is a C array with bytes (i.e. values between 0 and 255). You should loop over the array and print each value separately.
Hey
Great project. Can i have let say 4 of those on the same network set all as universe 1 and control from one artnet software. Will more of those work together?
Thanks.
Yes, that should work. ArtNet works by broadcasting UDP packets. These will be received by multiple ESP8266’s, which each individually forward it onto their DMX cable.
Hello. when I make the uplod flash in the arduino IDE the error message appears:
Arduino: 1.8.5 (Windows 7), Card: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)”
C: \ Users \ Willians \ Documents \ AUTOMATION \ Robert Oostenveld-arduino Blog Projects \ esp8266_artnet_dmx512 \ esp8266_artnet_dmx512.ino: In lambda function:
esp8266_artnet_dmx512: 206: Error: ‘StaticJsonBuffer’ was not declared in this scope
esp8266_artnet_dmx512: 206: Error: ‘jsonBuffer’ was not declared in this scope
esp8266_artnet_dmx512: 216: error: ‘class ArduinoJson650_0_0 :: JsonObject’ has not member named ‘printTo’
exit status 1
‘StaticJsonBuffer’ was not declared in this scope
This report would have more information
“Show detailed output during compilation”
option can be activated under “File -> Preferences”
…
Do I need to install any library (ArduinoJson.h, FS.h, Ardino.h or another)?
Yes you have to install libraries, including (but not limited to) https://github.com/bblanchon/ArduinoJson. See the “include” directives in the source code files. If you cannot figure it out, please ask on the Arduino forum.
I installed the library “ArduinoJson.h” but it presents this error:
Arduino: 1.8.5 (Windows 7), Card: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)”
C: \ Users \ Willians \ Documents \ AUTOMATION \ Robert Oostenveld-arduino Blog Projects \ esp8266_artnet_dmx512 \ esp8266_artnet_dmx512.ino: In lambda function:
esp8266_artnet_dmx512: 206: Error: ‘StaticJsonBuffer’ was not declared in this scope
esp8266_artnet_dmx512: 206: Error: ‘jsonBuffer’ was not declared in this scope
esp8266_artnet_dmx512: 216: error: ‘class ArduinoJson650_0_0 :: JsonObject’ has not member named ‘printTo’
exit status 1
‘StaticJsonBuffer’ was not declared in this scope
For ArduinoJson > Version 6 there are some adaptions in the code required: https://arduinojson.org/v6/doc/upgrade/
Rolling back to v5 solved the issue
i have built a unit, it appears to work ok, LEDS work, it is joined to the Wifi ok, checks out on serial monitor and web interface. I am using an Android App called AuroraDMX, which is set to the IP of the ESP, and if I slide up/down the DMX values on the APP, then the serial monitor pumps out an increase in packed monitor, and the “Packets received:” number goes up, but nothing happens to my light, I have checked on a Scope and there appears to be a 5v signal coming out the board, what could be wrong? what can I check? I have tried 2 lights, both on channel 1
Happy New Year!
Please check that you have wired the + and – signal of the MAX485 module are connected properly to the XLR plug. Note that there should not be a 0 and 5V, but an (approximate) +2.5 and a -2.5 signal that alternate upon transmission. See https://en.wikipedia.org/wiki/RS-485#Waveform_example. You should be able to confirm this pattern on your scope.
You may want to try the firmware without SERIAL_BREAK defined. That causes sendBreak() to be used instead.
You should also check that you have the correct configuration (universe and start channel) of your DMX fixture.
Hi,
Yes, this fixed it:-
“You may want to try the firmware without SERIAL_BREAK defined. That causes sendBreak() to be used instead.”
That should be the default code really?
Thanks, great project.
Matthew
Hi Matthew,
there’s another reason, which yo can check in the examples of the ArtnetWifi, or ArtnetNodeWifi library. There has to be a delay:
//Line299…303
#ifdef SERIAL_BREAK
Serial1.begin(56700, SERIAL_8N2);
Serial1.write(0);
delayMicroseconds(220); //ABSOLUTELY NESSESARY!!! No working DMX output otherwise
Serial1.begin(250000, SERIAL_8N2);
This worked for me perpectly!
Hello to all !
Can someone help me with a ready HEX file for this project? I have difficulty compiling, I checked a lot of options (now – IDE 1.8.7, json 5.10.0 , ESP- 2.3.0-rc2) , there is no “scarlet flower”
I am building this Artnet node with a Wemos D1 Pro Mini. I use a TTL to RS485 module from ebay, but this module does not have a DE nor a RE…what do I do about this?
The MAX485 chip has a “driver enable” (DE) and “receiver enable” (RE) pin, see the datasheet. If those are not broken out on your module, then I think it is quite likely that both are enabled by default (pulled high). In that case you don’t have to do anything.
Thanks, i´ll put it under the microscope and check if they are tied up or down 🙂
Or try to connect with a multimeter to the corresponding pins of the chip to see whether they are high or low.
Hello again Robert, everything sees to be Ok now, Wifi setup is Ok, LED turns green, but web interface is not connecting when i try http://artnet.local and when i Login to the Wifi router, it does not seem to have been assigned an ip address?
Did you already connect for the first time to configure the WiFi network that it should connect to? If not: if you scan your network with your computer or phone, you should see a SSID with the name “ARTNET”. Connect to that, and you should automatically be redirected to the WiFi setup page. Select your (regular) wifi network, give the password, and it will restart and connect to your regular network (and ARTNET will disappear).
Not directly related to this, but nevertheless relevant: last week I made a change to the firmware which should make the web interface more stable and faster. You may want to update to the latest version of the firmware and install the latest web server data to the SPIFFS filesystem.
You also might want to use the Serial Monitor (using 115200 bps) of your Arduino IDE, while connected to the ESP8266 with a micro-USB cable . The firmware will print debug information over the serial port. When connected, you might have to reboot using the small button on the side of the ESP8266 to see the WiFi setup which is done at the start of the debug stream.
I got the web interface working…had to upload all files to spiffs again. Now the only thing left is making it react on dmx messages. The LED turns blue for a spilt second after finishing the web interface, but Else i cannot seem to send ant dmx messages to it. What lighting Software is best for testing this thing
The LED is blue for 5 seconds following any interaction with the web interface. See https://github.com/robertoostenveld/arduino/blob/d43ea81bf7089b554e5758ef0130333cdc4651b5/esp8266_artnet_dmx512/esp8266_artnet_dmx512.ino#L256. The LED does not show the Artnet or DMX activity. You can use the monitor page in the web interface and occasionally refresh to see what is happening.
I am on a mac and have mainly been testing with https://lightning-dmxcontrol.com. It has a simple interface. You should enable “force artnet output” under utility. I also tried QLC+, but that was too complex for me. There are also some simple-to-use Python packages (in case you are a Python programmer).
Thanks for your time, and for responding Robert 🙂
I checked the code and saw where you set the LED blue for 5 seconds. I downloaded the Lightning DMX software and will try it when I get home from work and can test it. Didn’t find any place to set IP address of the Artnet interface though…will check more after work.
Another thing that is odd, the interface does not show up on my router as a client…but the LED is still green…
Art-Net uses USP packets that are broadcasted, i.e. all computers on the local network receive them. This is different from OSC, where you explicitly have to specify the address of the receiver.
I sometimes use Bonjour Browser (now called Discovery) to see what hosts are available on the local network. The artnet.local host is visible through bonjour/zeroconf as it uses MDNS in the firmware.
Hello again Robert,
I just tested some more. Still no luck. This is a long post, please bear with me. Here is what I did:
I set up everything, connects to the wifi router, gets the green light on the LED, checks Discovery (Bonjour Browser) and router client listing, no sign of the artnet client anywhere, connects to 192.168.1.2 (found this by trial and error knowing that the router is 192.168.1.1), web interface comes up (see result of monitor below).
I also tried several different artnet softwares both on my macbook pro and iphone without getting anything anywhere, also no reaction on Supernova (artnet monitor).
btw. I have a Wemos D1 Mini Pro 16Gb.
Here is what comes up on the serial interface after pressing the reset button on the Wemos D1 Mini Pro:
—>PRESSING RESET BUTTON:
rll⸮⸮|⸮l⸮|⸮l⸮b|⸮⸮⸮⸮r⸮b⸮b⸮⸮nn⸮lnn⸮⸮⸮bp⸮⸮lrlrlp⸮n⸮⸮l⸮⸮bn⸮|l⸮⸮b⸮⸮nn⸮l⸮⸮l`⸮nnl`nr⸮⸮⸮nb⸮lr⸮⸮nb⸮l⸮l⸮p⸮⸮⸮⸮`⸮⸮n⸮setup starting
loadConfig
Failed to open config file
*WM:
*WM: AutoConnect
*WM: Connecting as wifi client…
*WM: Using last saved values, should be faster
*WM: Connection result:
*WM: 3
*WM: IP Address:
*WM: 192.168.1.2
connected
setup done
*WM: freeing allocated params!
—>Accessing IP adress 192.168.1.2 (artnet.local is not working):
handleStaticFile
handleNotFound
handleStaticFile
handleNotFound
handleStaticFile
handleNotFound
handleStaticFile
handleStaticFile
handleNotFound
handleStaticFile
handleNotFound
handleStaticFile
handleNotFound
handleStaticFile
handleNotFound
handleStaticFile
handleNotFound
handleStaticFile
handleNotFound
handleStaticFile
—>Monitor choice on web interface says:
Monitor
Firmware version:
Feb 24 2019 / 20:22:26
Uptime:
1046
Packets received:
0
Frames per second:
0
The “artnet.local” address not working suggests that mDNS does not work for you. I now remember that it is not available on Windows, and on Linux only after installing Avahi. In that case it would also not show in Bonjour Browser. This cannot be fixed in the firmware, it might be a (lack of) feature of your router or desktop computer.
That the monitor page works is a good sign. The “handleNotFound” shows as consequence of this line in the firmware and happens when reading a html/css/js file from SPIFFS. So I would say that all is good so far.
Great project, thank you for sharing, and thank you for your help in advanced.
Please could you help, I have read the comment below and as far as I know I have uploaded the SPIFFS.
SPIFFS] data : C:\Users\*\Arduino\esp8266_artnet_dmx512\data
[SPIFFS] size : 3052
[SPIFFS] page : 256
[SPIFFS] block : 8192
/dog.jpg
/favicon.ico
/hello.html
/index.html
/jquery-3.1.1.min.js
/monitor.html
/monitor.js
/reload_failure.html
/reload_success.html
/settings.html
/settings.js
/style.css
/update.html
[SPIFFS] upload : C:\Users\TIMMAS~1\AppData\Local\Temp\build9256632f4e667cb638a4ee0f0e3880ee.spiffs/esp8266_artnet_dmx512.spiffs.bin
[SPIFFS] reset : nodemcu
[SPIFFS] port : COM14
[SPIFFS] speed : 115200
[SPIFFS] address: 0x100000
Uploading 3125248 bytes from C:\Users\TIMMAS~1\AppData\Local\Temp\build9256632f4e667cb638a4ee0f0e3880ee.spiffs/esp8266_artnet_dmx512.spiffs.bin to flash at 0x00100000
………… [ 100% ]
When I reset the NodeMCU with the serial monitor open and I get
setup starting
loadConfig
Failed to open config file
*WM:
15:47:55.718 -> *WM: AutoConnect
15:47:55.718 -> *WM: Connecting as wifi client…
15:47:55.718 -> *WM: Using last saved values, should be faster
*WM: Connection result:
15:48:02.829 -> *WM: 3
15:48:02.829 -> *WM: IP Address:
15:48:02.829 -> *WM: 192.168.1.149
15:48:02.829 -> connected
15:48:02.829 -> setup done
15:48:02.829 -> *WM: freeing allocated params!
then when I go to the ESP web page and the navagate to change seeting and try to save I get the file not found error
handleRedirect
handleStaticFile
handleNotFound
15:55:25.652 -> handleStaticFile
handleStaticFile
handleNotFound
15:55:29.668 -> handleStaticFile
handleNotFound
handleStaticFile
handleNotFound
15:55:31.234 -> handleStaticFile
handleJSON
15:55:33.538 -> HTTP Request
15:55:33.538 ->
15:55:33.538 -> URI: /json
15:55:33.538 -> Method: POST
15:55:33.538 -> Arguments: 4
15:55:33.538 -> universe: 1
15:55:33.538 -> channels: 512
15:55:33.538 -> delay: 25
15:55:33.538 -> plain: universe=1&channels=512&delay=25
15:55:33.538 ->
15:55:33.538 -> handleStaticFile
File Not Found
Thank you in advanced any help would be very much appreciated.
Looking at the code, I see that the “File Not Found” message in the console is probably an incorrect error. On [this line](https://github.com/robertoostenveld/arduino/blob/d43ea81bf7089b554e5758ef0130333cdc4651b5/esp8266_artnet_dmx512/setup_ota.cpp#L184) it is always printed (and the function always returns false). There is an “else” clause missing in that code. I would appreciate it if you could fix this, test it, and send me a PR.
Robert
Thank you for your quick reply, if this is a “false positive” for want of a better term is there any reason that I am getting bad DMX, I have wired it as per the picture and swapped all components out
I will look at the code but it might be beyond my skills
Thank you again
Tim
Sorry second query, the only way I can get some form of DMX my Swisson likes is the change the settings for Serial1.begin(250000, SERIAL_8N1); and remove the SERIAL_8N1, my swisson still thinks it bad DMX but with the SERIAL_8N1, it does not see it as DMX.
Any thoughts would be gratefully received
Thank you
DMX512 is very picky about timing. If you search in the code for SERIAL_BREAK, you will see that there are two options for the break between messages. For me (only tested with a few DMX fixtures) both work, for others not. Please try out both.
I also suggest you check the polarity of the two signal wires: those are easy to mix up.
thank you unfortunately still can get it to be happy, will keep digging
Hi,
I am building this Artnet node with a Wemos D1 Mini, and a TTL to RS485. It only have RXD and TXD. Should I connect RX to TXD, and TX to TXD?
The instruction on github is to connect D4 tp DI.
Thanks
Just give it a try. If it does not work, connect it the other way around.
Hi Robert,
Thanks for this project.
I can send DMX after adding “delayMicroseconds(220);” but when I try to login on the webserver after it’s been assigned to a network, I get “ERR_EMPTY_RESPONSE” in chrome als the blue led is constantly on except when reloading the webpage “192.168.#.##/index” it turns off and the DMX stalls for +-2/3 seconds but no webpage.
I need to recompile / upload the software to be able to connect to a new network using “ARTNET”, any idea what could be going wrong?
I would love to have a button to the wemos d1 to be able to reset the settings make switching network’s more easy, would something like this be possible with a simple line of code?
where are you doing the “delayMicroseconds(220)”? Although I don’t seem to need it, others (see comments) have reported DMX troubles that might benefit from this.
A reset button would indeed be nice, feel free to implement this and send me a PR with the required code changes.
The error you report seems a time-out. Please do make sure you have the firmware version after 18 Fen 2019, when I fixed a bug that could cause timeouts. And of course make sure you don’t forget to upload the SPIFFS data. You can operate it while connected with a USB cable to your computer and use the Arduino IDE serial monitor for debugging.
Please note that I wrote a follow up post on the timing and jitter in DMX512 signals and identified and fixed a bug in the firmware. See https://robertoostenveld.nl/timing-and-jitter-in-dmx512-signals/
Hi Robert,I solve my last problem due a bad electri connector.I’ve a little problem in save procedure. If I change any set (universe for ex) and press send button,it not save anything with a screen message of lost connection. Have you any idea?
Thank’s in advance
Mario
First check that the SPIFFS data is correctly written to the EEPROM. I think it should be possible to red the json file with http://artnet.local/config.json. Second, check that you have the latest firmware from github. There was an issue with the jquery.js not loading completely in case the ESP was not connected to the internet. You can diagnose this using the developer tools of your browser (F12 in chrome).
Thak’s Robert. Solved > roll down ESP8266 Board from last downloaded defaut ver 2.5, to 2.4 (not beta ,not 2.x.x) . Nice proget!!! 😉
Hi Robert…one simple question.
Is not possible use a static Ip instead of a DHCP ip, to reload it at the next power on?This only for use unicast,to avid an overload in the net when use a broadcast tx.
Yes, you can change the code to configure a fixed WiFi network and to specify a fixed IP address. Have a look here and here.
hay.
can you add, DMx to artnet?
to receive dmx and send artnet over wifi hotspot.
In principle yes, but I have not implemented it, and also do not have a need for it. You would have to connect the RO pin of the MAX485 module to one of the input pins of the ESP8266 module. And you would have to update the firmware to receive DMX (probably best done w.r.t. timing using an interrupt) and send complete universes as UDP packets. Good luck!
Hi Robert
I tried to compile your source
No erros but device not visible in PC-dimmer and no frames recived in device 🙁
Arduino IDE1.89 ESPCore2.4
System Windos 10
DMX Software PC-Dimmer
In PC -Dimmer there is an Option where i can scan my network for artnetnodes.
iI got 3 running in my smarthome
one by an mega using software from Ulrich Radig
two are running an esp8266 with Sotware from Matthew Tong
what try is an modifiying an H801 (esp8266) module to an Artnetreciver with 5 PWM Channels
I read som Postings and tryed to compile your source under espcore2.3.0 with mutible errors .
Hi ZW_Eagle,
The firmware of my device is not sending anything, only receiving simple UDP packets. So it makes sense that your PC-dimmer cannot detect its presence. The code from https://github.com/mtongnz sounds very interesting, it is for sure more sophisticated than my code. To debug your setup, I suggest you keep the esp8266 connected over a serial interface and that you add some “Serial.println” commands to the Arduino code.
best regards,
Robert
Hi,
Thank you very much for all the efforts you have made for this project, and thank you for sharing it with us.
I would like to ask you a few questions, please.
1) Why did you replace the NodeMCU Lua ESP8266 development board with another module?
2) I notice that there is a part that does not appear in the list of used parts. The one on the wall pointing to the exit. On top are connected two wires.
Thank you again and I look forward to your answer.
Hi Aurelien,
1) I replaced the NodeMCU board with an Wemos D1 Mini because it is smaller and I don’t need the additional pins.
2) I am not sure 🤔; do you mean the “2.1 mm dc barrel jack”? It connects to the Boost-Buck converter, which allows me to plug in any standard wall-wart (e.g. 5V, 9V, 12V) that I happen to have around. I realize that also the XLR connector is not listed. I just added both connectors to the list.
best regards,
Robert
Pingback: Arduino DMX – Make!
I’ve got this working but I’m curious as to why there is a delay of about 3-4seconds before the light responds. I’m using Q Light Controller Plus and just using Simple desk with a single DRGB light.
I have not experienced such long delays. I do see some lag, especially when I have configured a full universe (512 values). Although that still fits within a single TCP packet, the transmission over the serial DMX interface does take notably longer. This is something I manly notice when doing rapid changes with a slider. But it is not directly obvious; I only notice it myself because I control the slider and see the effect just a fraction later.
With regard to hardware, the only thing I can imagine is that improper termination or so would affect the light responding too late, or detecting too late that the DMX packet is complete. That could be specific to your DMX light. You won’t have such a delay in the wifi, but the software might also be a possible cause. To diagnose whether it is in the DMX hardware side, or somewhere on the software side, you could modify the ESP8266 firmware such that it does not use wifi/artnet. For example make a simple blink-like sketch using DMX, which alternates between two states (on/off or red/green) and simultaneously prints the switches on the serial interface.
Hi there, First, thanks for this nice project. Running very smoothly.!
But i have one odd problem: I experience a very slow behaviour of the nodemcu every exact 60 seconds. Do you know of some timeout or smth. else which may cause this problem?
If i am for example running a fade on some led-stripes (via dmx-to-ws2812 adapter) the animation stucks at exactly 60 seconds for like 2-3 seconds an then runs smoothly again until the next slowdown happens a minute after.
Hi Paul,
Various others that duplicated my design have regretfully reported issues w.r.t. the timing of ESP8266-controlled lightning.
In part that seems to cause the DMX serial protocol (i.e. the precise sequence of high-low signals) protocol to sometimes fail. Some fixtures are more robust in deciphering the sloppy DMX high-low sequence than others. That is something I tried to follow up with https://robertoostenveld.nl/timing-and-jitter-in-dmx512-signals/, but I have actually not tested the devices with many DMX fixtures, only with a few simple ones that I have available.
A second issue (and the underlying cause for the first) is that the ESP8266 cannot multitask. Incoming wifi requests have to be processed by the MCU, even when not relevant. At that time, the MCU will shortly stop with the serial RS485 low-high sequence. I realize that I have always been using a dedicated “art” wifi network with only few devices on it. I always use a https://www.tp-link.com/us/home-networking/wifi-router/tl-wr802n/ to make sure that I have the wifi network at places where we perform (and where I use my device) under my own control. I suspect that my sparse wifi setup causes relatively little interruptions, whereas on a more busy wifi network there might be more disturbances. Also, my home/neighbourhood wifi is relatively empty; in a more dense urban environment I can imagine that also causing more issues. All wifi traffic basically consists of radio signals on the specific 2.4GHz sub-band that somehow need to be processed by the ESP8266 MCU (and by all other wifi devces on the same sub-band); only after some processing it will be able to determine that a certain wifi packet is not intended for the ESP8266 and hence can be dropped. Perhaps something like this https://www.instructables.com/id/ESP8266-WiFi-Analyzer/ (either the android app or the HW solution) might provide diagnostics.
A general way of debugging is to keep the ESP8266 connected to your computer (over USB) and see what happens on the serial console; you can always add more Serial.println commands. One feature that I already added to the sketch for debugging purposes is that the RGB status led turns blue upon incoming http traffic, since that clearly disturbs the smooth flow of the serial output. See https://github.com/robertoostenveld/arduino/blob/4198d29ec6704811150cc132255c8378f7dde8fe/esp8266_artnet_dmx512/esp8266_artnet_dmx512.ino#L255
If you have anything running on your active network that somehow “scans” the different ports (including the http port) of all connected wifi devices, I can imagine that causing interruptions. You should be able to see the http requests by the blue LED. What I probably would add to the sketch is that the web server switches off after some time (say 60 seconds). So after initial startup there is 60 seconds to configure over the http interface (port 80) interface, and after that port 80 closes down. Perhaps also close the MDNS responder.
I recently got started with https://github.com/arendst/Tasmota for home automation, also using ESP8266 modules. I am really surprised how smooth its webinterface is (and also much more complex), and I still plan to look into how that it implemented. The webinterface of my own firmware is always slow to start and rather unresponsive.
I hope this helps.
Hi, just want to say thanks very much for putting this library together. Flashed my ESP no problem and instead of making a stand alone unit I removed the XLR sockets inside my LED moving head to make space and fitted the ESP and Max module inside the unit. Now I have a WiFi controlled mini moving head and teaching my daughter how to construct ‘scenes’ to playback with music.
The only stumbling block for me was the app I’m using, Osram DMX Controller, outputs on Universe 0 as default. So I changed the ESP node to 0 to suit (after half hour of troubleshooting!!). Thanks again, I’ll follow up with some photos once I have everything packaged up.
Thanks! I look forward to seeing some photos or perhaps a short youtube video.
Hi Robert,
I made this project. I think it works? At this moment, I connected a P36 lamp to this controller and hooked it up to Home Assistant through the art-net plugin. But it doesn’t works always. Or I think this…. Is there a way to test it from the device itself if the lamp is connected to it? So I can locate the problem? I want to shut it down with Home Assisant but at this moment, this isn’t possible.
Hi Joey,
It is not possible to detect from the ESP8266 whether a DMX fixture is attached since DMX is uni-directional. For that, you would need RDM which does allow bi-directional communication. If you are not sure whether the communication problem is between Home Assistant and the ESP8266-based DMX controller, or between the DMX controller and the DMX fixture, you could modify the firmware ESP8266 firmware to allow you to check what the values are in the
global.data
array; the (occasionally) incoming ArtNet packets are stored in there and are regularly (at about 40Hz) sent over the serial interface to the DMX fixtures. For example, you could use theSerial
interface to print the data values every second in the main loop. Or in theonDmxPacket
you could print them whenever new values are received.I hope this helps, good luck.
Robert
Hi Robert, I have managed to get the nodemcu to connect to the network correctly and manage to connect through a call and send packets, when I update the monitor on the server I can see that the sent packets are read by the hardware, but I do not see results in my light DMX. Any suggestion? It is worth clarifying that everything is very well connected as indicated in the diagrams.
I have read out there that you need a DMX terminator.
Could through an app send dmx packages and communicate it to the lights through this hardware?
Hi Bruno,
You can modify the firmware by adding some
Serial.println
statements to see what is happening, or use an oscilloscope, or test another DMX fixture, or test your DMX fixture with another DMX controller. Please look at the other suggestions that have been posted here as comments.good luck,
Robert
Hi Robert,
thanks you for sharing this great project!
Would it be possible to use a MAX13487 board instead of the MAX485 board?
I am wondering if this board would provide the over-voltage protection between the ESP8266 and DMX output?
Link to MAX13487 board:
https://www.amazon.de/dp/B07B667STP/ref=cm_sw_em_r_mt_dp_e.ZCFbE52VKH3
Cheers
Matthias
Hi Matthias,
I think that the MAX13477 should communication-wise just work fine. However, I am not sure whether it would offer the protection that you expect. Looking at Maxim search, I see others that have explicit galvanic isolation. The ESD protection of the MAX13477 is better than of the MAX485 but other than that I don’t see an advantage.
cheers
Robert
Having trouble with the reconnect wifi it goes into host mode and then it doesn’t do the “captive” configuration screen or serve anything if I go to 192.168.1.1.
BTW I’m adding a tiny OLED screen to mine. It’s pretty neat I don’t have the DMX hardware yet to see how it affects it yet.
Hi Greg, initially I thought that the configuration screen would appear on 192.168.4.1 (which I believe to be the default) but on this line I see that I changed that to 192.168.1.1. I don’t know what could cause your problem. Have you checked an example directly from https://github.com/tzapu/WiFiManager?
I know what the problem is now but after a couple hours I’m not sure how to fix it yet. You can get the AP config mode to work at setup() because it’s running before the web server and DNS are started. If you try to change into AP config mode after the server and DNS starts, there is now a conflict and nothing happens. There is no way to stop the server class once it starts without a reset. A way around this is to use a different port for the server. Not ideal but it works 🙁 It seems there may be a way to use the WIFIManager as a server or something. I saw something about being able to change the port in the alpha. It would be more ideal to change the config server port to something else. Would be even more ideal to be able to stop the server once started. Not sure how the devs missed that one.
Happy new year!
Great project, this looks very beginner friendly!
I have one question which was a bit difficult to figure out during my online research.
I have a led strip that uses the UCS512B3 chip, and the input on the led strip is 24V, PO/PI, dai and GND.
The UCS chip is supporting the MAX512 protocol.
How should I connect the MAX485 module to the led strip? (Thinking about the data transmission, power connectors are ok)
I could not find any information about what the PO/PI and dai actually are. (Can guess but not confirm)
Hi Thor,
The MAX485 module is a serial interface that implements the RS‑485 standard which is used by DMX512 to control stage- and theater-lights. See here and here on Sparkfun for some background. DMX works with consumer/professional lights like these. You can compare Art-Net to DMX, except that Art-Net uses UDP packets over a network (wifi in this case), whereas DMX uses RS‑485 messages over a wire.
The device that I explain in this specific blog post converts Art-Net to DMX. It is not designed to control a LED strip directly, but could be used in combination with a DMX LED strip controller. But that kind of defeats the purpose, as in that case you could also get yourself an Art-Net LED strip controller and skip DMX, i.e., rather than software - artnet - dmx - light you could do software - artnet - light.
You may want to have a look at this blog post instead, which explains how to use an ESP8266 as an Art-Net LED strip controller.
Hi Robert,
Thank you for your reply.
I think I explained in a difficult way.
The led-strip I have is a DMX512 capable light strip. (Since the UCS512B3 is DMX512 capable)
So if I understood your post (and other information), it should be possible to control my led strip using the MAX485 module.
My question was just if you recognized the “PO/PI” and “dai” naming and if you knew which would connect to A and B on the MAX485 module?
Or maybe I am still misunderstanding and there is a need for a device between the MAX485 module and the DMX512 led-strip?
Oh, sorry: my fault. I thought it was a bare strip, similar to one that has 5050 RGB LEDs that are individually addressable with a WS2812b. But here I now see that DMX512 is mentioned, also on the UCS512B3 datasheet.
RS-485 uses signal lines “A” and “B” (see wikipedia). In figure 2 on page 6 of the UCS512B3 datasheet I also see A and B mentioned. But there is “something” in between, with a “PO” output that connects over a resistor to the “PI” input. Subsequently, the “PO” of each RGB led connects to the “PI” of the next one. The “something” in the schedule also has a “DAI” output. However, what the “something” is, I don’t know…
No worries, I understand the confusion.
Thank you for checking, I think that this confirms that it could be possible.
I will test it when I get the MAX485 module and let you know here in a comment.
Thanks again!
No luck.
I tested with Resolume Arena, I saw that the packages were coming to the esp8266, but no response on the led strip.
Tried to alternate between A and B.
I don’t have an oscilloscope so can’t do proper testing.
Do you think a k-1000c or a XIEMA_V6.0 would work? Or do you have any other cheap suggestions? (I only have a few meters so I don’t want to put to much money in this)
I suggest that you ditch the poorly specified UCS512B3 LED strip and instead buy a RGB LED strip with WS2812 or similar controller ICs. Then you can use the implementation described here, which goes from Art-Net directly to digital signals for the WS2812 without DMX in-between. The WS2812 addressable LED strips are explained very well here on Adafruit.
Or you can combine such a strip with a ready-made WS2812 dmx decoder. and use that with the artnet-to-dmx controller that is described in this post.
Yeah I’m starting to think the same. To much trouble with this. And when I only want it to change colors every now and then like a “normal” in-house led strip.
Using https://github.com/Aircoookie/WLED for many other projects and that works perfectly.
Thanks for your help and input!
Thank you for all the work you have done on this project. I’ve searched through the posts as best I can for my issue and didn’t see anything, so I apologize if I’m asking something that has already been answered.
I have constructed two artnet to dmx devices as you have shown. However, I’m only using some very basic coding. (I don’t need all the bells and whistles for what I’m doing. These are not end user.) They both work, however, the DMX fixtures don’t seem to recognize a signal if addressed past channel 11 on one transmitter and channel 17 on the other transmitter. I’m assuming its a timing issue, but I’m so new to all this, I’m not sure where to begin. I don’t have an oscilloscope to view the output signal with.
Any and all help/recommendations would be appreciated. I’ve been working on trying to figure this out for 2 weeks with no luck. Thanks in advance for the help.
The later channels not being recognized could indeed be caused by the DMX signal train getting more-and-more out of sync. When possible, you may want to test it with as little other wifi signals as possible. Each wifi packet – also when it is not meant for the ESP8266 – will shortly interrupt the microcontroller and thereby cause the soft-serial DMX sequence to be slightly jittered.
Something else you could try is whether it improves when you use another type of “break”. In https://github.com/robertoostenveld/arduino/blob/master/esp8266_artnet_dmx512/send_break.cpp there are two implemented; for me it does not seem to matter, but for someone else the low-level break worked, whereas the high-level (serial) break did not.
Good day,
I have a question and that is: we have built it on the plug-in board as in your picture. We use the ESP 8266 and the MAX485. Now we have to write the program, and we want to control the spotlight, so that we can change the colors on the one hand and the direction or the movement on the other hand (we have the Colorstage 300 as spotlight). We want to control the whole thing via an app on the cell phone, but first we make that we can control the lights and the movement. Do you have a you a program for it or a program where it is described, so that I get an approach- I have no plan how to start, do not know well with programming.
It would be very nice if you could help me.
With kind regards
Katrin
Dear Katrin,
I would recommend to use general-purpose lighting control software for testing. I have a MacBook and use JV Lightning DmxControl which is free and simple, but just has enough features for me to test. There is similar software for Windows and iOS and Android. See for other suggestions the list on DMX-King or search on Google. The important feature of course is that it can output to Artnet. Some of the softwares are very sophisticated and allow for programming and driving complete light shows, but I recommend that you start with a simple one that only has a few sliders. Moving one slider in the software should then cause the spotlight to make a specific movement, or change one color.
best regards,
Robert
hi,
the project is perfect, I use iPad with photon and it work great. Il possible add an http page to set static ip after configure wifi , so is possible to change ip quickly?
Second question, is possible store some “data Artnet string” to SPIFF file, so via web interface is possible to launch specific preset to use it standalone?
Thank’s
Giovanni
Hi Giovanni,
Thanks for the suggestion, both ideas make a lot of sense!
I have used the devices in a network where I control the wifi router, so I have always assigned them a permanent DHCP lease on the router. Also the mDNS helps to connect to “artnet.local” rather than the IP address, but I understand that mDNS does not work on Windows (or not that well).
It now by default starts with DMX values that are all zero, so black/dark. If another string is configured in the web interface, it would start with that; and if there are no ArtNet packets it would stay at that.
I am not actively working on the firmware myself. It would be great if you could propose improvements as a pull request on github.
best regards,
Robert
Great project, Robert! I was able to get this this working quite easily with one exception that was unrelated to your code/instruction. For anyone using QLC+; ArtNet Universe is offset from QLC Universe by -1 as described here https://www.qlcplus.org/docs/html_en_EN/artnetplugin.html
Again, thanks so much for sharing your hard work!
Hi Robert,
Is there a way to change the data pin from the NodeMCU to the MAX485 from GPIO2 (D4) to another? I can’t see where it is defined in the sketch.
Thanks!
Hi Aaron,
It uses the second hardware serial port, aka “Serial1”. See https://github.com/robertoostenveld/arduino/blob/1c4f1a4fc31d6a538edcc08b8c285e03c8da18c0/esp8266_artnet_dmx512/esp8266_artnet_dmx512.ino#L78. Looking at http://arduino.esp8266.com/Arduino/versions/2.3.0/doc/reference.html it appears that it cannot be changed. You could try whether you can get it to work with SoftwareSerial on another pin.
best regards
Robert
OK, I see. Thanks for the information!