Update 3 Sept 2022 – the code has moved to its own esp8266_artnet_dmx512 repository to improve the timing and jitter with I2S (following this comment).
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 also 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 UDP 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!
Hello, could you help me with this error when I want to compile the code: C: \ Users \ PCESCR ~ 1 \ AppData \ Local \ Temp \ arduino_modified_sketch_473262 \ artNet.ino: In function ‘void sendArtNetReply ()’:
artNet: 125: 36: error: ambiguous overload for ‘operator +’ (operand types are ‘IPAddress’ and ‘int’)
replyBuffer [18] = highByte (subnet + 1); // subnet hi-lo
Hi Sebastian,
The function
void sendArtNetReply()
and the source code fileartNet.ino
in which you encounter the error is not mine. It seems to come from https://github.com/mtongnz/ESP8266_ArtNetNode_DMX and I suggest you to ask there.good luck,
Robert
Hi,
Have been very happily using this code (with some additions for some time …Many Thanks. However I need to move it over to an ESP32 (I need I2C which is not bitblatted). I foolishly thought it would be an easy job. I was wrong. Has anybody attempted the migration?
Hi, i like this project and uploaded it successfully to the wemos. Its getting a signal, the webinterface does work but the dmx output is weird. I have 2 different led-pars, the one is not doing anything, the other one is freaking out. I tried switching the A, B cables on the dmx connection but it didnt fix it.
Do you have any idea what the problem could be?
No sorry, I have no idea what could cause those issues. DMX is sensitive to timing, and the ESP8266 chip is not the most consistent w.r.t. timing, since it also needs to respond to wifi requests (even requests that it receives over the radio and that are not targeting the device itself). I recommend that you use an oscilloscope (like the https://www.seeedstudio.com/DSO-Nano-v3.html) to check whether the timing of the DMX signals is correct.
You could also implement a DMX-only test with the wifi switched off. For that you could use https://github.com/Rickgg/ESP-Dmx. This would allow you to test whether the wiring is correct and, with the wifi switched off, you should have more consistent timing of the DMX.
Hi Robert, still using your code on my ESP8266 WEMOS. I have a question, does your code respond to a ArtPoll request with a ArtPollReply? The reason I ask is that when using software to discover DMX nodes the software cannot find the ESP8266 so the only option is to use broadcast mode instead of unicast. Thanks
Hi Alex,
Until you mentioned it here, I was not aware of discovery packets. That means that the firmware on my GitHub repository does not support it. Note that it makes use of rstephan/ArtnetWifi and in that code I do see
ART_POLL
being defined, but I don’t see it explicitly used. On this line you see that the DmxCallback is executed, which isonDmxPacket
in my code. But upon aART_POLL
it does nothing.It would be possible to implement it, preferably with an extra callback in the upstream rstephan/ArtnetWifi repository. But figuring out how the ArtPollReply packet would have to be constructed is quite a puzzle. The reply not only contains “I exist and this is where you can find me”, but also details on supported functionality of the DMX device.
So in short: Writing the code does not seem too difficult, but figuring out how to make it work does.
cheers, Robert
Robert,
Thanks for the quick reply. I just took a look at that repo on git and interestingly there is an issue open which asks about polling:
https://github.com/rstephan/ArtnetWifi/issues/19
The answer is to use the ArtnetNodeWifi project by rstephan:
https://github.com/rstephan/ArtnetnodeWifi
I haven’t taken a good look at that repo but hopefully the hard work is done 🙂
Thanks
Alex
–UPDATE–
I was able to use the ArtnetnodeWifi library to make the code reply to discovery packets. I’ve not used git to push/pull etc. so excuse the crudeness below, these are the only changes I made to file esp8266_artnet_dmx512.ino
Line 14: #include
Line 35: ArtnetnodeWifi artnet;
Replace
Line 235 and Line 236 with:
artnet.setName(“ESP8266 – Art-Net”);
artnet.setNumPorts(1);
artnet.setStartingUniverse(config.universe);
artnet.enableDMXOutput(0);
artnet.begin();
artnet.setArtDmxCallback(onDmxPacket);
EDIT-
My changes for line 14
Line 14: change ArtnetWifi.h to ArtnetnodeWifi.h
Hi Robert,
I’m happely using this converter to control my lights in the garden. Really thanks for that!!
Unfortunately when I have a power-failure or other loss of power to the converter, it doesn’t automatically reconnect to the WIFI. the status-led keeps red. When I take out the power supply, and put it in again, the converter successfully restarts and reconnects with WIFI (status-led blue).
Do you have any idea to solve this issue?
Best regards,
Geert-Jan
Hi Geert-Jan,
I don’t understand why the reboot upon power loss does not work (red), whereas taking out the power supply does result in a clean reboot and reconnect (green). The wifi credentials are stored in EEPROM, so as such it should know the network to connect. If you look at https://github.com/robertoostenveld/arduino/blob/master/esp8266_artnet_dmx512/esp8266_artnet_dmx512.ino, this all happens between lines 109 and 119. I don’t know whether it is feasible to connect the ESP8266 to a serial interface to see what happens when it goes wrong. You could also add some extra
Serial.println()
commands to see where it is; if it goes past line 119 withoutWL_CONNECTED
, you could consider adding anESP.restart()
to start the boot cycle once more. Or perhaps you could check https://github.com/tzapu/WiFiManager for a solution.Good luck,
Robert
Hi Robert,
thanks for your work. Trying to do a node by my own. Setup works very well, also sending Data to the D1 Mini, WebGui started, Wifi is set but sadfully i can’t find the node in my Lighkey-App on Mac. Is there a mode i have to put the node in?
Many thanks and happy christmas days
Hi Fabian,
The Art-Net to DMX node does not transmit anything on the network (except for mDNS), it only listens passively for UDP broadcast packets. On macOS I use JV Lightning DmxControl for testing.
I just tried, on my Art-Net node I have configured universe=1, channels=16, delay=25, and in the DmxControl app preferences I have specified “Forced ArtNet Settings (uni:sub:net)” as 1:0:0. That combination allows me to control a DMX light using the sliders of the DmxControl app.
I hope this helps,
Robert
Hi, great and simple idea! Thanks for sharing! Does someone have long-term
experiences with the box?
Greetings
Hi Lars,
My experience is that when rapidly changing DMX values (sending lots of Art-Net messages) such as smoothly changing colors AND being in a busy wifi environment (which distracts the microcontroller) results in some choppy or stuttering behaviour. For that case it would be better to have a dedicated microcontroller for receiving Art-Net over wifi and another one for sending the timing-sensitive DMX messages.
best
Robert
Thx. for this information. I will try to build it anyway next week and see how it works.
Hi Robert,
Thanks for your good work and tutorial! I build my own in the last to days. See here https://www.dropbox.com/s/fx3gd8b8a8i8f74/Foto%2009.03.22%2C%2019%2020%2049.jpg?dl=0 and it works great!
Cheers lars
👍🏻
Hi Guys. My mind is exploing 😉 Since days i try to make my own, without any success. I really have no idea where is my mistake. I dont get any DMX Signal out. My project is actually to use WLED DMX Out. On the Website is written to use that hardware from this project and software from WLED. Actually it dosnt matter for me if i use later WLED or this in complete with Artnet2DMX. My “signal” comes over artnet (vixen lights).
However. What is wrong with my wiring. For test i dont have LEDs connected and just a simple DMX PAR Spot. Even there the DMX Led is not blinking.
I took a picture here from the breadboard and tryed to wired same. Just one thing i didnt understood, VIN is a + Voltage Input or am i wrong? Cause at that picture it goes to ground. Here on the picture you can see my wiring. Please give me a hint..
https://marko-knoche.com/esp8266/esp8266-max485.jpg
Hi Marko,
Since you are using hardware from one project and the firmware/software for another, it is hard to tell where it goes wrong; the two might simply be incompatible. I am not in depth familiar with the WLED project (although I must say that it looks great). It might be that there is a mismatch between the pins that WLED assumes and that my design uses, or that there is a mismatch between protocols. Have you tried using my own firmware on my hardware design?
The pin “Vin” can be used to feed in the supply voltage prior to the regulator. You can connect for example a 4.2-3.7V LiPo battery, which is then down-regulated to 3.3V. That also happens to the 5V that the board can receive over the USB connector. The ESP8266 itself is a 3.3V device.
best regards,
Robert
Hi Robert,
thanks for your answer. I know is not easy, but i was trying everything. Your Software and the WLED Software, both are not working. i was trying two different ESP8266 and 3 different MAX 485. All are not working. i guess i have a wiring problem.
Did you watched the picture? You can see what i make maybe wrong ?
The Pin should be right. I had to reconfig WLED and there is also written D4 (GPIO 02) for the MAX..
By da way. WLED recoment you 😉
======================================================
hardware setup
The DMX output uses a MAX485 transceiver connected to the TX-pin of the ESP8266.
I am currently working on an open source PCB design to go along with this feature.
Until then, i can recommend this tutorial by Robert Oostenveld. Only the hardware side, of course.
======================================================
Hi Marko,
Your schema and wiring look correct and consistent with each other and my notes. A difference is that I used a Wemos D1 mini board, whereas you seem to be using a larger NodeMCU board.
I just looked at one of my originals and opened the enclosure, it looks similar as the photos in the blog post above, but not 100% the same. The board does not say “Wemos”, but other than that it looks the same. I see that the pins on the side without the reset switch are labeled 5V,G,D4,D3,D2,D1,Rx,Tx. The board looks like this https://www.mischianti.org/2019/09/19/wemos-d1-mini-esp8266-debug-on-secondary-uart-part-3/, which also lists D4 as the “TXD1” pin which I am using with Serial1.
If I look at another that I have recently built, I see the labels 5V,GND,2,0,4,5,RX,TX. That board looks like this https://www.wemos.cc/en/latest/d1/d1_mini.html, which also has the 3rd pin from the bottom (left side in right figure) labeled as “2”.
So comparing these two, the silkscreen specifies “D4” for one and “2” for another. However, searching further, I see https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/ of which the NodeMCU also appears to be the basis for your schematic. There it is again consistent, also with the Wemos shown on the same page. So I thought I found something, but apparently not…
I guess you don’t have an oscilloscope. Can you attach a LED to GPIO02 aka D4 and see whether you can get that to blink?
best
Robert
Hi Marko,
I miss the GND to RE on the MAX485. Could that be the problem?
You can see it in this schema. https://github.com/robertoostenveld/esp8266_artnet_dmx512
Hi Robert,
First of all, thank you for publishing this code and maintaining it so well with your great support. I tried to rebuild your project and got to a point where it is now working, but with a latency of round about 35 seconds and very choppy animations. I measured my art net signal with “The ArtNetominator” and my network and signal don’t seem to be the problem. Do you have any idea what could introduce such kind of lag into the system?
Best regards,
Lewin
Hi Lewin,
I cannot imagine the 35s delay being caused by the firmware running on the ESP8266. I suggest you connect the ESP8266 over the serial interface and – if needed – add some extra print statements, so that you can look in the debugger when the ArtNet UDP packet arrives and when the DMX signal is being updated. Compare that to the time when the software on your computer sends out the ArtNet message. A good comparison might be between an all-white and an all-black message, as it is easy to check in the .ino script. For example at the end of the onDmxpacket function:
int allWhite = 1, allBlack = 1;
for (int i = 0; i < global.length; i++) { allWhite = allWhite && (data[i]!=0); allBlack = allBlack && (data[i]==0); } if (allWhite) Serial.println('all white\n'); if (allBlack) Serial.println('all black\n');
best regards,
Robert
hola! soy novato y queria saber si tienes alguna version actualizada del codigo .ino para descargarlo? ya que la que bajo de aqui no me coincide con las modificaciones que aqui se proponen. saludos y gracias
Google translate: “hello! I am a newbie and I wanted to know if you have any updated version of the .ino code to download it? since the one that I download from here does not coincide with the modifications that are proposed here. greetings and thanks”
Hi Maxi, The most recent .ino code can be found on https://github.com/robertoostenveld/esp8266_artnet_dmx512.
Sehr geil
Leider komm ich nur zum Webserver.
Bitte um hilfe
lg
Google translate: “very cool. Unfortunately I can only get to the web server. Please help. lg”
Dear Julian,
If you connect a USB cable and open the Arduino serial port monitor, you can see during startup which IP address the ESP8266 receives. You can also connect to your wifi router prior to starting up the ESP8266, find in its web interface the list of IP addresses managed by your DHCP server, start the ESP8266, and look at the new (or most recent) address that gets added to the DHCP table. That will be the one on which the ESP8266 web server is running. Most diagnostic information however is available if you connect not with a cable and look at the serial port monitor.
best regards,
Robert
Hi Robert,
Very interesting because I want to control the pool lighning, which has an DMX input, by a Wemos and WLED.
But I’m a little bit confused about the circuit.
At the Github circuit is the “receiver enable” pin connected to GND.
Why? I thought it must be tied to Vcc. At your schematic it’s open, at the MAX485 it should be tied to Vcc, so your circuit must be correct, github’s not.
Another point is, why have you connected “DE” to VCC? At Github circuit it’s open. At the Max485 board it must be tied to Vcc as well.
At the source code I set the sendpin to “4” = GPIO4 = D” at Wemos.
src/dependencies/dmx/ESPDMX.cpp
It is ok, or is a TX pin necessary or GPIO2
At https://kno.wled.ge/interfaces/dmx-output/ is written that sendpin 2 is in conflict with LEDPin
Regards
Guido
Hi Guido,
Let me review the datasheet:
I agree with the information being confusing; it is the result of multiple revisions over the years, while I am not actively using it myself any more.
My analysis is that with Receiver Enable (RE) connected to ground it could receive DMX, which it does not have to (i.e., the functionality is not implemented in firmware, and RO was not wired up). With RE connected to VCC it cannot receive DMX. In my photo with the breadboard it was left open, which worked for me. If we would want to receive, both RE and DE should be low, and RO should be connected.
In the schematic that was courtesy from a GitHub user who submitted it as pull request, RE is connected to GND and DE is open/floating, which I guess worked for them. In my opinion it would be better to connect both DE and RE to Vcc for transmit operation (which we need for the intended purpose), and connect them both to GND for receive operation. If I now were to reimplement it, I would connect DE and RE both to a single data out pin of the ESP8288, so that I could control transmit/receive operation through the firmware.
Thanks for bringing this to my attention and sharing it here with others that might run into this.
Regarding the send pin on the Wemos D1 conflicting with the LED: I used pin D4 aka TX1 and coded it in the Arduino sketch as Serial1. I am not using the LED on the ESP8266 module itself, but use the separately wired RGB led to convey status information. With appropriate changes to the firmware, something else might work as well.
If you don’t want to have to fiddle with these issues, please do consider using the https://kno.wled.ge/interfaces/dmx-output/ project: it has more functionality and better documentation, it is actively maintained and comes with better support.
best regards
Robert
Hi Robert!
Thank you for your response.
RE/DE/RO is clear so far. I left all open and at DE I can measure a high, because of the 10k PullUp.
But, what I did not understand is the Software config.
As I mentioned, I connected the signal at the Wemos at D2 (=GPIO4) to the Max485.
Is it enough to config in Software sendPin in src/dependencies/dmx/ESPDMX.cpp or is in necessary to config it to a serial TX? And where it has to be coded?
Thx
Hi Guido,
In the Arduino sketch you have to define either ENABLE_UART or ENABLE_I2S. Or you can define both, in which case it will send it with both methods over both pins; this allows a hardware switch to toggle between them to determine with your specific DMX fixture which one works best.
As you express interest in the serial/UART interface rather than the I2S, you should look in the code for the sections that are conditional on ENABLE_UART. On line 260 you see that a Serial1 object is constructed, see here for the reference. To use a serial interface on another (non-standard) pin, you might be able to use SoftwareSerial and replace all “Serial1” occurrences ins the code with the corresponding “SoftwareSerial” counterpart. However, I have not tested that and given that DMX is very picky on precise timing, I would also not recommend it.
If you want to keep the LED of the ESP8266 module functional and under your control for status messages (which my code does not use), I recommend that you use the I2S interface and disable (aka not define) ENABLE_UART.
best regards
Robert
Hi Robert,
Thank you for your amazing project!
Do you have a link for the ABS Enclosure?
Thank you!
best regards
Simone
Hi Simone,
Thanks! These ABS enclosures are easy to find in many different sizes and versions on Ebay or AliExpress if you search for “project enclosure”, for example this one here. The one I used is about 8.0 x 5.6 x 3.3 cm.
best regards,
Robert
Thank you very much!
Complete beginner here (my last play with uCs was in the PIC days!) …I got this to webserver running stage but I’ve yet to get the hardware to test on DMX lighting (ordered: 3 weeks+..sigh) but packets are being received!. A few traps I hit as a complete newbie:
a) I had no idea how WifiManager worked so I spent hours hunting for where you put in the SSID & Password until I realised the sketch creates a whole NEW ACCESS POINT (yes…I’m clearly lacking reading skills) you connect to in order to enter those details.
b) Uploading the files: I followed this kind of guide https://youtu.be/4r6YZlLfKfw?t=573
BUT…Arduino v2+ (I had 2.0.4) no longer allows you to add items to the tools menu . This has been an issue on their Github since v2 came out so I doubt they’ll fix it. I had to revert to an older version (I went to 1.8.19) to see “ESP8266 Sketch Data Upload” appear in the tools menu.
Thanks for a great tool and guide…cheers!
Hi Justin,
Thanks for the useful comments and link to the youtube video. I happen to have Arduino version 1.8.19 installed and tend not to update frequently (“if it ain’t broke, don’t fix it”) and am using this method. I indeed see that SPIFFS file upload appears to be problematic for Arduino 2.0. Nothing I can fix at the moment, but posting this here might help people figure out a solution or work-around.
Good luck and have fun when your DMX lights arrive!
best
Robert
Good policy. The method you link to looks like the one I used too but yep, IDE v2+ is apparently a problem.
*paces waiting for hardware*…Cheers…Justin
Hey, just a final thank-you. I finally got all the parts & put together the circuit and it’s all working perfectly. I’m intending to install this into a PAR can so the rest of the DMX fixtures can daisy-chain off that. I gather this should be no problem. Cheers!
Thanks Justin, much appreciated. Installing this in the first of a daisy-chain of DMX lights is a cool idea! The only problem I might anticipate is the enclosure being made of metal and therefore potentially blocking the wifi too much. But there are ESP8266 and Wemos modules with an external antenna like this that should solve that.
da pra fazer com o esp32?
Google translate -> “can you do it with esp32?”
Although I have not tried it myself, I suspect that it is not trivial to port it from the ESP8266 to the ESP32.
Good morning.
After several problems programming the Arduino, I managed to program it.
Now I have the node working and it works with the QLC+ software for Mac but I can’t get it to work with the Luminair software.
Could you help me, see if it is compatible or what problem I may have.
Because I need it to work from an iPad.
Thank you so much
Greetings
Dear Martin,
If it works from QLC+ but not from Luminar, I would say that it is a problem with the control software, not the device. Is the iPad on the same network, i.e., can you open the web interface of the ESP8266 from the iPad? In the monitor page you can see how many packets it has received. For a continuous control stream this should increase with 10-210 packets per second.
Perhaps it helps to set up a mock ArtNet receiver with the https://artnetview.com software, to see whether the expected ArtNet messages are sent by your iPad.
best regards,
Robert
Hello
I downloaded the project files, but there is an error when compiling from ArduinoJson
I wanted to know the exact version of the library you used
Dear Nowfal,
I have not compiled it for quite some years, as I am not actively developing it any more. But when I try compiling it now, it still works fine.
This is on a MacBook with macOS 14.0 (Sonoma), Arduino IDE 1.8.19, and the following libraries:
Using library ESP8266WiFi at version 1.0 in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi
Using library ESP8266WebServer at version 1.0 in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer
Using library ESP8266mDNS at version 1.2 in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266mDNS
Using library WiFiManager at version 2.0.13-beta in folder: /Users/roboos/Documents/Arduino/libraries/WiFiManager
Using library DNSServer at version 1.1.1 in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/DNSServer
Using library ArtnetWifi at version 1.5.0 in folder: /Users/roboos/Documents/Arduino/libraries/ArtnetWifi
Using library ArduinoJson at version 6.19.4 in folder: /Users/roboos/Documents/Arduino/libraries/ArduinoJson
Using library I2S at version 1.0 in folder: /Users/roboos/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/I2S
I hope this helps.
best regards,
Robert
Hello
I used the project according to the instructions
But when compiling the project, an error occurs from line 598 and the project does not compile
I will send you the error line
i2s_write_buffer((int16_t*) &global.i2s_data, sizeof(global.i2s_data) / 4);
Arduino: 1.8.18 (Windows 10), Board: "Generic ESP8266 Module, 160 MHz, 80MHz, DIO, 115200, 1M (256K SPIFFS), ck, Disabled, None"
C:\Users\ProBook\Desktop\esp8266_artnet_dmx512-main\esp8266_artnet_dmx512\esp8266_artnet_dmx512.ino: In function 'void loop()':
esp8266_artnet_dmx512:598:80: error: 'i2s_write_buffer' was not declared in this scope
i2s_write_buffer((int16_t*) &global.i2s_data, sizeof(global.i2s_data) / 4);
^
exit status 1
'i2s_write_buffer' was not declared in this scope
Dear Sami,
Note that in my previous reply to Nowfal (which I also posted just now) I included details on my Arduino version and libraries. Your Arduino version is a bit behind mine, but I don’t think that is the cause.
On line 92 and 93 of esp8266_artnet_dmx512.ino it states
With the error that you get, I suspect that those includes somehow failed. I do recall that at a certain point I had issues with a library (don’t know whether it was this “I2s” one or another) which had mixed upper- and lower-case in the directory name and in the actual file names.
When I search for “I2S.h” and “i2s.h” on my computer (and online), I see that both the upper-case and lower-case versions exist for different hardwares. On my macOS computer the file system is case-sensitive and the sketch won’t compile for the esp8266 platform if I change the include to lower-case. You seem to be working on a Windows computer. I don’t know how case-sensitivity of the file system plays a role there, but I recommend you first look in this direction.
Specifically, on this line in the esp8266 code the actual header gets included that should define the i2s_write_buffer function. Please confirm that that line has effect in your code. One way of doing that (a bit as a hack) is to edit the file and include an #error directive on that line and see whether the compiler stops. If not, then the line is apparently not reached.
I hope this gives some pointers for you to solve it.
best regards,
Robert
Hello
Thank you very much for your help
I was able to upload the project well
Just one thing
The web files are not complete for me and I am very surprised that you can see the photo in the link below
https://imgtr.ee/images/2023/10/11/cd16fdbbb6fb9a4a0de072b4a0369cd4.jpeg
The next thing, because I didn’t have access to the universe settings, I had to change my universe from within the project
And the last thing, I use esp8266 and I want the output base of my universe to be TX, which is the first base, The default base is RX
Regards
Sami
Hi Sami,
You write that the web files are not complete. Which ones are missing? Can you report that at https://github.com/robertoostenveld/esp8266_artnet_dmx512/issues? I think that is a better place to discuss technical details.
best regards,
Robert
Great project, Robert! Found it recently and I now own 3 of these converters. 🙂
Even made a custom 3d printable case which directly screws onto an XLR connector. I did not connect the RGB led (I do not really see a purpose here) and power everything directly via the USB connector of the Wemos. Footprint of that adapter is VERY small! I can post some pictures and the STL/F3D file on Github if you want.
Hi Matthias,
Thanks, nice to hear! I agree that the RGB led is not strictly needed and quite some hassle to incorporate. And powering it through USB makes sense.
It would be nice if you could share your 3D design, for example in the https://github.com/robertoostenveld/esp8266_artnet_dmx512 under an “enclosure” directory or so. Feel free to send me a pull request on GitHub with the 3D design files and photos, and if possible a short README.
thanks,
Robert
Hi Robert,
Thx for this great Project. Since I only want to Control a few simple RGB Lights in our Drums-room, I don’t need an expensive DMX solution so an ESP artnode would be enough.
I have my ESP running with your build now.
However i am facing some challenges:
– should serial Monitor in Arduino IDE Show sth? I cant get anything monitored to See whether Signals are bringt sent
– I understand as Long the two Status LEDs dont Flicker there is No artnet/DMX Signal right?
– I would Like to use an iPad with Vibrio App to Control dMX. Do you know this App? Should it Generally Work? I don’t get any Connection and I cannot figure what i am doing wrong.
An Idea how to proceed to with Analysis?
Thx Thorsten
Hi Thorsten
The serial monitor in the Arduino IDE should indeed show stuff, basically every “Serial.print()” statement in the code. Besides the initial diagnostics about it joining the wifi network (which is required, otherwise it cannot receive the UDP packets), I think that line 183 is an important one: that should show “Received DMX data” once per second. If there is no incoming DMX data over the UDP packets, it won’t send anything on the wired serial interface and nothing will light up.
I don’t recall the exact details of the external status RGB led, but think that green = wifi connected, red = not connected, blue = web interface access (note that this may cause a hiccup in the output). I have no clue what the on-board LEDS will do; I have it built into an enclosure and cannot see them.
I don’t know the iPad Vibrio App, but it looks like an environment to program a whole show. I would recommend starting with a simpler app for initial testing, where you just specify an output for each of the DMX channels. ArtNetView may be a good helper app for testing on the receiving side. I mainly use DmxControl on my MacBook for testing the connection, and subsequently my own Python code for live control.
Hope this helps,
Robert
Hi Robert,
thx for your support.
I am testing now with Photon ipad App. No DMX connected until I get “DMX Received” in Serial Monitor.
My Settings:
ESP/Artnet: Universe 0 / Channels 20 / Delay 25
Photon: one RGB device with 4 channels (1-4) / Universe 0 / Subnet 0 / Unicast
Serial Monitor Output:
packetCounter = 311, FPS = 30.00, length = 512, sequence = 18, universe = 0, config.universe = 0
UART: 30.3 p/s
I2S: 30.3 p/s
There must be some kind of connection between Photon & ArtnetNode, because if I change universe in Photon, its shown correctly in Serial Monitor Output.
Only problem: No “DMX Received” message if I change any color in Photon though.
Only time I get “DMX received” is if I change Protocol-settings in Photon from sACN to Art-Net.
It seems there is sth happening between Photon and Artnet-Node connection.
But No DMX Messages beiing sent.
Any idea how to easily figure out where I have sth. done/configured wrong?
Thx
Thorsten
I think that the serial output you are reporting is from esp8266_artnet_dmx512.ino#L189. So packets are being received. I would also expect that the packetCounter increases over time.
If the universe that is specified in the UDP packets then corresponds to the one configured for the ESP8266 (see line 204), the packet data should also be copied into memory and sent over serial and i2s.
I think you should simply sprinkle more Serial.println() statements throughout the Arduino code to see what is happening where. For example, you could print the value of the data to see whether it changes along with you changing it on the iPad.
On line 558 and 594 the respective sections start for sending the data out over the serial and i2s interfaces. Since you see “UART: 30.3 p/s” and similar for I2S, those sections are apparently executed. The question then is: is the data not correct (for example all zero), or is the hardware connection not correct.
Hope this helps,
Robert
Hi again,
Just a quick question before I dig deeper into the source Code
My ESP artnet node runs in 255.255.255.0 Subnet with a dhcp given IP Adresse (Like 192.168.*.*)
Now I read that each node and device must Run in a 2.x.x.x or 10.x.x.x Subnet.
Could that be why my Setup doesnt Work?
Since I am Not so familiär with all this IP stuff.. what exactly do I need to do?
Do I need to Set Up a Subnet and IP Adress in Arduino source Code?
Does my iPad also need to Run in a different Subnet? (Cause I also use it for other stuff where I need to Connect IT to my Router)
Thx
Thorsten
Hi Thorsten,
There is no requirement for the network for ArtNet, except that the UDP packets sent from the controller (your iPad) must be passed to the receiving ESP module. If the ESP module is on the same private 192.168.x.y network, with only y being different (as in a typical home environment), then it should be fine. The 10.x.x.x subnet that you mention is also a private network and functionally similar to the 192.168.x.x subnet. The 2.x.x.x that you mention is not a private network but a public section of the internet, you are not allowed to use that.
If the network setup in which you are integrating the ArtNet communication is more complex, with multiple subnetworks, routers and possibly even VLANs, then things get more complex. But that is not likely, especially since you have already confirmed with the “packetCounter” increasing over time that the ESP8266 is receiving packets.
So if the iPad and ESP8266 are in the same subnet and UDP packets are received by the ESP8266, you should only ensure that the packet content is correct and that the hardware (serial/UART or I2S) connections work.
best
Robert
Hi Robert,
it works now (not with Photon but with Vibrio App). Just installed the artnet-Debugger-Programme and checked all my apps.
However, thx for your help so far!
One last question:
I will control my lights & ESP via a hardware switch (like a normal lamp).
What I would like to do: Once my light and ESP are turned on the ESP should send default DMX values / code to set white light to 255 and all other colors to 0.
Once I start my ipad with my DMX controller the light should be controllable.
I assume it is possible – may be inside the setup void.(?)
Any idea where to start?
Thx
Thorsten
I have an idea, added following from line 588 on:
Serial1.write(0); // Start-Byte
// send out the value of the selected channels (up to 512)
for (int i = 0; i < MIN(global.length, config.channels); i++) {
if (neustart==true) {
if (i==3) global.uart_data[i] = 255;
else if (i==(MIN(global.length, config.channels)-1)) {global.uart_data[i] = 0; neustart=false; Serial.println("SUCCESS"); }
else global.uart_data[i] = 0;
Serial1.write(global.uart_data[i]);
}
else Serial1.write(global.uart_data[i]);
}
Unfortunately, it seems like the "old" data (from a previous session) is stored somewhere.
If I close app and iPad and then restart the ESP, it uses the "old" data. (for a millisec it shows whats written (neustart==true) and them it shows the old/stored data. After a few minutes it seems like it refreshes and shows what I expected
Question: Is there some kind of ROM you use to store data?
No the data is not stored AFAIK, except in volatile RAM, so a reset of the ESP should case it to start completely fresh.
I don’t understand though why you would add the neustart initialization code around line 588. It makes more sense to do it in the
setup()
function around line 269. I think you can just addglobal.uart_data[3]=255
after the for-loop that sets it to zero.For further debugging: could you disconnect the ESP module from the wifi to make sure that it is not receiving any UDP packet somehow? Or could you add a return at the start of the
onDmxPacket()
function so that it returns immediately and does not update theglobal.uart_data
? That should keep it “frozen” as initialized.You were right, even if I closed the app and iPad it was still sending in the background.
Everything worx fine now. I deactivated I2S though.
However, is it possible when I set in line 269 global.uart_data[3]=255
that this value will be sent right at that moment? What happens now:
– I set value
– WIFI etc. checks run
– after about 5 secs light goes on
I would prefer to immediately send the DMX signal to switch white light on before all other checks run. If its complicated cause I have to change to much code, its ok. If its easy to change, your welcome to help me out.
Thx a lot
Hi Thorsten,
On line 543 in the code it “waits” for 5 seconds with a blue status led to show that there was recent activity on the web interface. That will also be the 5 seconds that you notice at the start.
It is actually silly that the whole if-loop gets blocked upon startup and web access; it would be sufficient if only the blue or green status led were shown and that the remainder of the loop (which sends the data on the serial port) would continue.
I think that the following change to the code would solve your problem:
// give feedback that the webinterface is active
if ((millis() - tic_web) < 5000) { ledBlue(); } else { ledGreen(); } artnet.read(); ...
I am not going to make the change on Github now without actual testing, but please give it a try.
HI Robert,
That code part you put in your last comment
// give feedback that the webinterface is active
if ((millis() – tic_web) < 5000) { ledBlue(); } else { ledGreen(); } artnet.read(); …
was exactly the same as in the github file.
However, I jst changed this delay from 5000 to 100 and also some other delay inside the code.
now it only takes like half a second to start lighting.
Thx
Thorsten
Well, it is not exactly the same: the brackets are different. The original code on github will show blue and won’t execute the remainder of the DMX handling code (deal with incoming UDP packet and send serial command) whereas if you put the if-else closing bracket immediately following the
ledGreen()
command, then it will continue with the remaining DMX handling regardless of whether there was recent activity on the web-interface.But glad to read that you solved it. Have fun with the lighting in your Drums room!
Hoi Robert,
Helaas lukt het me niet om de spiffs te uploaden naar de wemos.. Heb al van alles geprobeerd, zonder een positief resultaat. Downgraden van de Arduine ide heb ik dus ook al geprobeerd, niets werkt helaas. Zou het eventueel mogelijk zijn de spiffs data als .bin in GitHub te zetten ? Alvast bedankt.
Beste Jurgen,
Ik gebruik SPIFFS met de Arduino IDE versie 1.8.19 op macOS. Volgens mij heb ik ooit de instructies op http://esp8266.github.io/Arduino/versions/2.0.0/doc/filesystem.html en https://www.instructables.com/id/Using-ESP8266-SPIFFS gevolgd om het te installeren.
Als ik de “ESP8266 Sketch Data Upload” optie in het menu gebruik, krijg ik dit:
Het bestand esp8266_artnet_dmx512.spiffs.bin heb ik voor je op mijn Dropbox neergezet. Ik hoop dat het daarmee lukt.
vriendelijke groet
Robert
Beste Robert,
Hartelijk dank voor het bestandje te uploaden. Ondertussen heb ik een werkend exemplaar kunnen bouwen dat uit de kunst werkt. Ik ga een paar van deze modules inbouwen in m’n dmx apparaten, dat scheelt weer net wat kabels..
Met vriendelijke groet,
Jurgen
Greetings Robert,
Thanks for the great instructions, but I still cant get it to work.
This is the error message i get
class ArduinoJson::DynamicJsonDocument’ has no member named ‘containsKey
Is there a way to resolve this?
Thanks in advance!
Hi Dejan,
The containsKey function that is used on line 19 and 24 is part of the ArduinoJson library.
I just tried compiling the ino file with ArduinoJson version 6.21.5 and don’t get the error you describe. I also commented out the version check on line 15 and tried it with version 7.2, again no compilation errors.
Do note that it is designed for version 6 of the ArduinoJson library, other versions will give the error “ArduinoJson version 6 is required”. If you comment that out, it may or may not work.
What version of ArduinoJson are you using? Are you sure you have the latest version of the code from my GitHub repository?
best regards,
Robert
Can you provide the .bin code again, because I always fail to upload using the Arduimo Ide software.
I’m begging you
Hi Bagas,
There are different ESP8266 modules with a flash size that varies from 1MB to 16MB. The flash size and partition layout influence the size of the image and to which address it should be written. Assuming that you have a Wemos D1 mini module (or similar) with 4MB version and the default partition layout, you can find a SPIFFS image here.
best regards,
Robert
If I flash the application to Wemis D1, it will immediately run normally, like the code above
hello robert, can artnet from esp8266 be controlled using qlc+ and grandma2 pc software?
thank you
greetings from Indonesia
Hi Bayu,
Yes, I have successfully used QLC+ with the artnet-to-dmx512 converter. I don’t know Grandma2, but if it outputs Art-Net I don’t see a reason why it would not work.
best regards,
Robert
in your circuit on github there is a switch that changes L2S mode and UART mode, but in your circuit on this website why isn’t it there, and if it isn’t there then where do you connect it?
Thank You
The blog post on my website documents with the photos the first version that I built in 2017. In 2022 GitHub user @apdlv72 (Artur) suggested to use I2S instead of UART to improve the precision of the timing of the DMX signal and we implemented that in the code. You can enable or disable either option with the defines ENABLE_UART and ENABLE_I2S in the code. It is possible (and default) to use both at the same time as they operate independently. When both are enabled in the code and compiled firmware, the toggle switch in the GitHub schematic connects either pin Rx or pin D4 from the Wemos to the DI (data in) pin of the MAX485 module. That allows for experimenting and comparing between the two modes without having to desolder/resolder any of the wires. But if you just want to use the UART mode, you connect the MAX485 DI to the Wemos D4, or if you want to use I2S mode, you connect DI to Rx. I am using UART mode, as that works for the DMX controlled RGB LED that I have. I have tested I2S mode and that also works, but never bothered to implement the toggle switch (as that would require drilling a hole in the enclosure) and I have not compared the two precisely using an oscilloscope to determine which has the more accurate timing.
Regarding timing: I suspect that the biggest problem which I occasionally see (“stuttering” of the DMX controlled light) is due to the ESP8266 microcontroller being busy with processing incoming Wifi data and at that time not sending out the serial DMX/RS-485 commands. It also has to inspect and filter out the Wifi signals not meant for the Art-Net module itself, so on a busy Wifi network I suspect that to be a bigger problem. A better design would use two separate microcontrollers: one for processing the incoming Art-Net signals over Wifi, and another one that keeps on sending DMX packets without being interrupted by random incoming Wifi signals. That would require some form of communication between the microcontrollers, perhaps I2C could be used for that. Alternatively another Wifi module (like an ESP32) might do the job better. Since this is not something I am actively using or developing any more, this is something for others to do.
best regards,
Robert
hi robert, do you know how to make this https://youtu.be/dex5qCKcKf8?si=pXOBn13s41XOez7d The problem is, I’ve been looking for a tutorial since yesterday and couldn’t find it I think you can help, thank you
So you want Art-Net over a wired network and then convert that to DMX512 ? The video shows an Arduino Nano with an ethernet shield, which I guess is an ENC28J60 module. The Nano is connected to the same MAX485 module that I used. An example of that is discussed here on the forum.
I don’t have the hardware to try it out completely, but would expect something like this to work as the following Arduino sketch.
This uses the ArtNet and DMXSerial libraries.
For wiring it up to the MAX485 module you would have to look in the details of the schematics posted on the DMXSerial page. Note that you don’t have to build the whole shield, if you just use the MAX485 module without protection like I did, then that needs DE and RE (data and receive enable, although receive is not strictly needed), and furthermore Rx=RO (receive out) and Tx=DI (data in).
I hope this helps.
Robert
I found an error, and I tried to correct it but I couldn’t, even though I had tried several times
statement
template constexpr wchar_t numeric_limits::min() { return WCHAR_MIN; }
^
In file included from /ArtNet/Artnet/Manager.h:5:0,
from /ArtNet/ArtnetEther.h:13,
from /ArtNet/Artnet.h:10,
from sketch_oct16d.ino:4:
/ArtNet/Artnet/Receiver.h: In member function ‘arx::stdx::enable_if_t<arx::stdx::is_same::value> art_net::Receiver_<S>::macAddress(uint8_t*)’:
/ArtNet/Artnet/Receiver.h:481:18: error: ‘class EthernetClass’ has no member named ‘MACAddress’
Ethernet.MACAddress(mac);
^
Return code is not 0
ask for help.
Thank You
Hi Bayu,
This is not an error in my code but in the Artnet that you are including. I cannot help you with this, please consider asking the author of that library.
best regards,
Robert
Does the DE and RE pins need to be connected to vcc/5v?
Thank You
As documented in the data sheet on page 7, the “Driver Output Enable” (DE) pin needs to be pulled high to enable the driver outputs. The “Receiver Output Enable” (RE) should be pulled high as well to disable RO, since there is no DMX signal being received and processed in my design and firmware. But if you would want to receive DMX messages, RE should be low (and RO of course connected to the ESP module).
Hi Robert,
can I change my WifiSettings without uploading the sketch again?
If i connect to my IP of my artnet I just see the Monitor settings etc. I can’t access the Wifi-Monitor…
Thx
Thorsten
Hi Thorsten,
If you open the web interface, there is a “reconnect” link that you can click. The reconnect option executes this section in the code which resets the WiFiManager. You can also directly get
http://192.168.0.xxx/reconnect
in your browser or command line.best regards
Robert
Thx for the hint.
I can See and connect to ArtNet WiFi, however the Monitor Dienst launch (automatically). Even them IPS 192.168.1.100 or 1.1 so Not Work. Any Idea? Tested with three devices
Thx. So far we’re able to reconnect.
However, when I connect ro ArtNet – WiFi, i cant get Access to the wifiMonitor. The Settings Page does not load.
Ist there a specific IP i need to connect to? Thought IT should load automatically, Just as Hotspot-pages do.
Any Idea what I am Missing?
The WiFiManager page and the ARTNET configuration page are mutually exclusive.
When the ESP8266 is not yet connected to your WiFi, it will start as access point with the WiFiManager active. You then connect your computer or phone to the ad-hoc “ARTNET” WiFi network. That will act as Hotspot-page and your computer will show the WiFiManager webpage automatically . You then specify the local (normal) WiFi network that the ESP8266 should connect to; that is implemented with https://github.com/tzapu/WiFiManager, you may want to check examples and tutorials over there.
Once you have configured your ESP8266 to connect to your local WIFI network, the ad-hoc “ARTNET” WiFi network will not show any more and you have to reconnect your computer or phone to your local WiFi network; this usually happens automatically. From this point it will not work as Hotspot-page any more.
You then connect to the ARTNET configuration that is running on a small web server on the ESP8266 module. For that you have to give the ESP8266 IP address in the browser like http://192.168.1.xxx, or you can try http://artnet.local (which may or may not work, depending on whether mDNS is supported on your network). This will open the “index.html” page that is in the data directory under the sketch. If artnet.local does not work (aka mDNS is not supported), you will have to go to the web interface of your WiFi router to figure out which IP address was assigned to the ESP8266 module. The WiFi router is often accessible on http://192.168.1.1.
Note that it is easier to do these first steps with the ESP8266 module still connected to your computer with a USB cable and to follow the progress in the serial monitor in the Arduino IDE. The serial monitor will show what the ESP8266 is doing and will also show its IP address once connected to your WiFi network. When doing that, you don’t need to look up on your WiFi router which IP address was assigned to the ESP8266.