loading

esp8266 artnet to dmx

by:Marslite     2019-10-12
As a lighting technician, I often find myself having to run cables on sidewalks, move props, or just go where it\'s awkward to run wires.
Wouldn\'t it be nice to have a wireless solution?
While there are many commercial units that use various protocols, they are either expensive or unreliable.
When I first saw the cheap ESP8266 module a year ago, I decided to try and build a cheap DIY Artnet for the DMX node.
This structure will take you through your own building. New: v1. 2.
If you have followed this instructions, go to Step 10 for details of the latest stable version: v1. 2. 0.
Note that this construct assumes that you are using v1. 0.
Because this is the current version at the time of writing. v2. 0.
If you are looking for the latest and greatest firmware, please go to step 11 for details on v2. 0.
0 currently under development.
The code is available on my Github and I wrote a new note here explaining how to set the device to ws2812 pixels for amateurs using jinxesp8266
It has a fast processor with more RAM and flash memory than most ardunos and (small)
Support the choice of a variety of different protocols.
It has multiple formats and I prefer the esp826607 model as it has an external antenna.
ESP8266 is also compatible with the Arduino IDE: I use it because it is very familiar and therefore easy.
Artnet and DMXArtnet are protocols that allow DMX to be sent over a standard IP network.
This protocol is supported by almost all modern lighting consoles or software (paid and free).
Read more here.
DMX is the industry standard agreement for controlling professional programming and DJ lighting-
It is based on the RS485 protocol.
Each DMX universe can have a maximum of 512 channels, and the value of each channel is from 0-255.
Read more here.
Lighting (
Move props and trade shows on the sidewalk. . . . )
Christmas lights, DJ lights. . .
Almost anywhere you want to minimize wiring, this unit will come in handy. ESP8266 -
I used models for 07 but they are all very similar
I used a small USB power tile-
2x1 K, 3x390, 1x750 cap-
I used 4 x 100nF despite the 5 schematic.
C1 is not required. 3. 3V Reg -
I don\'t remember what I used here. any 3.
Just 3 v regulator.
ESP8266 needs 3.
3 V but not used in large quantities. Max485 -
These chips generate DMX output (
Can also do input. We need 2 -
One for each universe.
They are 5 v chips, but it seems that ESPs 3 is used.
3 v logic without any problem. There is a 3.
The 3 v version is available, but I have these on hand and it works. . . XLR sockets -
I used 3 needles, but 5 needles are specified by the standard.
As Avolites like to do, you can use a 5 pin for both outputs.
I use 3 needles because I mainly have cheap 3-pin Chinese lights which are easier to store and more sturdy. LEDs -
I have two small blue LEDs, one for each DMX universe to show activity.
They are optional but suggested. Power Lead -
I use the IEC entrance.
They are available at any time and allow the lead to be disconnected for easy storage.
Perf board, connecting wire, head, item box, screw, glue.
I started with the breadboard.
If you are going to modify my schematic, I suggest you do the same.
I haven\'t included a photo yet because I forgot to take one and my breadboard is being used for a new project I\'m working on.
Check out my ESP8266 breadboard instructions for details that make the ESP8266 breadboard friendly and then connect the components according to the schematic diagram.
On the perf board, lay out the components in a way that makes sense for the required cabling, and suit your situation.
I hope the last unit is as small as possible.
This means that I completed this step in combination with the case layout (next step)
To make sure everything is right.
In the image, you can see the 3x 4pin header.
2 at the top is the DMX output and 1 at the bottom is the power supply and LED connection.
The 2 pin black header in the middle is RX/TX for programming esp8266.
Note that the RX pin has a voltage divider (R5 & R6).
This is because I use a 5 v programmer (My Arduino Mega)
So I need to get it down to 3.
So ESP is not fried.
These resistors can be removed if you have a 3. 3V programmer.
To save space, I ignored the include reset or program button and I don\'t have any buttons on hand.
For reset, I just cycle the power supply simply.
To achieve programming, I put a small piece of wire on the reset pin.
I connect the crocodile clip to the wire ring and then ground it to the GND pin of the DMX title.
Although this is painful, I have the OTA update included in the software, so this is just the first time flashing.
I also chose not to isolate the DMX lines as I feel lazy :)
I also want to save space on board and reduce the cost (DC-
DC converters are expensive).
I recommend optical and electronic isolation.
I did this in my DMX led bar structure and the same process works here --
When we output here instead of input, just reverse the optical isolator.
You need a DC-
Each DMX output of DC and a piece of light.
In the previous step, I designed the enclosure along with the board to make sure that all the components fit, but with minimal space.
I want all the connectors to be on one side as it looks better and it\'s easier to manage the cables as well.
Because of this, the connector is the first thing I do.
I drill holes for 2x xl rs, 2x led and antenna.
I cut the IEC hole with a knife.
I used a parent IEC connector stupidly when cutting holes.
It is larger in size than the public.
So all the hot glue around IEC.
Once the hole is cut, I cut the pin on the USB PSU shorter to fit it into the case.
I drill holes in the plug pins and connected wires
Brown is alive, blue is neutral (
New Zealand/Australia Standard).
Cable connectors (Blue cable).
Connect the led and power supply to the 4-pin connector.
The photos are all black cables.
I powered with an old USB cable.
You can find the schematic on Google, but I checked the 5 v and GND wires with a multimeter.
Check LED polarity-the cathode (short pin)
Connected to GND and anode (long pin)
Pins 2 or 3 connected to our connector.
Some heat shrink will make everything look beautiful and stop the shorts.
Screw in the XLRs, glue in the IEC, screw in the antenna, and glue the LEDs to their holes.
Slide the board in place.
I drilled a small hole in the case and board for M4 screws and nuts.
You can stick it with glue if you want.
This ensures that it does not move around.
Finally plug the USB connector into the PSU.
I put some hot glue on it to make sure it stays in place.
Plug in 3 plugs and antennas.
It\'s time to refresh the firmware. . . .
Connect your USB-
> Serial adapter.
I use my Arduino Mega. . .
On Mega, simply reset the GND briefly and connect the megaTX-
> EspTX for MegaRX-
> EspRX for MegaGND-> espGND.
Make sure you have 3. 3V serial -if it\'s 5V (
As with Wan)
Then use the voltage divider as shown on the schematic wiring page.
Hold the flashing pin 0 to GND-
As explained on the building page, I use the crocodile clip. Connect power (or press reset).
Your device should be in flash mode now.
Get the file NeededI uses the Arduino kernel of the Arduino IDE and ESP8266 to encode and flash the firmware.
Install everything according to the instructions on git.
Download my espDMX library to the Arduino IDE Library folder.
I wrote this library to use two universes that interrupt the output of DMX to ensure accurate timing.
The refresh rate of the DMX output is about 44Hz-
With the full 512 channels, you can get the most out of it.
When viewing the output with an oscilloscope, it is perfect on both outputs.
I used the time on the page Ujjal dmx5 12.
The library is largely based on the hardware serial library in the core file linked above.
To do this, the hardware serial Library is a bit bloated with no hardware interruption-
So why do I modify it to fit in.
I may enable receiving DMX in the future, but I doubt that-
I don\'t see this use case.
Download my esp8266_artnetnode_dmx code to your project folder.
You can do the latest update using the bin file provided and flash OTA.
An OTA update means no code need to be compiled.
More content on OTA.
This construct is based on the v1 version. 0.
But I suggest using the latest version.
See the last step for more information.
Flash FirmwareOpen ESP8266_ArtNetNode_DMX.
Ino in Arduino IDE.
In the Tools menu, select General ESP8266 module \".
Set according to the picture above.
Please note that the size of the flash needs to be set according to the size of the chip.
Example using check flashconfig (
File> example> ESP8266 in Arduino IDE)
Check your chip size
The first number is the total size of the flash memory chip.
The SPIFFS number is the number assigned to the file system-
We don\'t use the file system, so it doesn\'t matter what this number is.
If your flash size is less than 1 m then I suggest you make the spires smaller so there is more room for our show.
Select your USB-
> Serial programmer under Port.
Click the upload arrow.
If the library and core files are installed correctly, it should compile and flash, don\'t be too fussed.
Most of the settings are done via a web browser.
I will discuss this in the next step.
LED pins are set in the firmware.
They default to pins 12 and 13, but you can change them if you want.
Troubleshoot esp8266_artnetnode_dmx comments out 2 definition statements at the top.
InoUncomment makes detailed equipment spit out serial0 that knows what\'s happening at any time (
The serial port you have connected via USB-> serial above).
This will disable one of your DMX outputs and display the wifi password in plain text, so make sure to disable it before you deploy!
Uncomment define load_defaults to clear any settings and reload factory defaults.
Make sure you comment this line off and refresh again, otherwise you can\'t change any settings-
It clears everything every time the device starts up.
When you start the device for the first time, it will try to connect to the WiFi network defaultSSID (
I doubt this exists).
If it can\'t connect in 30 seconds, it will start a hotspot.
The hot spot is nodename_xxx (
By default, nodeName is artNetNode and xxx is a random number).
Connect to this hotspot using password artNodeXXXX (
Xxx is the number from the hotspot SSID).
Point your selected browser to the settings page.
If connected via hotspot, the address of the web page will be 2. 0. 0. 1 (or 192. 168. 4.
Old version 1)
But if ESP is already connected to your WiFi then use its IP address (
If the router is assigned DHCP, check it out or use the static address you have assigned).
At the top of this page you will see the MAC address.
Use this option to allow your device on the MAC filtering network (
Highly recommend this).
Next is the node name.
Change this to anything (
Less than 30 characters)
Make the equipment easy to identify in lighting software.
It will also change the WiFi hotspot name-
However, the password remains the same.
Next is your WiFi setup.
Enter the SSID and password for your show network.
Hotspot timeout is a delay before hotspot startup (
When the WiFi network is not connected).
The hotspot will only start when the device is powered on, and if the WiFi connection is interrupted after the connection, it will not start.
It\'s Artnet settings now.
Subnet is your Artnet subnet, do not confuse with your network subnet.
Set the required cosmic address-
These can be the same if you want the two outputs to be the same.
IP settings allow you to view the current IP settings (DHCP by default).
You can set a static address if you want.
The Artnet network should run in 10. 0. 0. 0 or 2. 0. 0.
0 range, but will work for others.
Certain settings can be saved and will take effect immediately, such as changing Artnet settings.
Other settings need to be reset (IP and nodeName).
Do this using the provided buttons.
The last item on this page for firmware updates is the firmware information and update box.
This allows you to easily view the firmware version of the device running and upload the new version via WiFi.
Uploading a new firmware will terminate all DMX output and stop responding to artnet before it\'s done.
Occasionally a fault occurs, so the expected firmware version is checked after the OTA update.
To generate the OTA binary, select export compiled binary from the sketch menu of the Arduino IDE \".
This will create one.
Bin file in Project Directory.
OTA failure if you find that OTA frequently fails, WiFi is not connected or hot spots cannot be started, check the flash memory size settings in the Tools menu.
If this does not match the size of your chip flash memory, it can cause a strange problem.
Example using check flashconfig (
File> example> ESP8266 in Arduino IDE)
Check that you are using the correct settings.
Your device should be connected to your show WiFi network so far, and you should be able to connect to the settings page.
Set up the lighting console/software now. . .
First, make sure that your console is connected to the network with the IP of the artnet device in the same subnet range.
This should be 10. 0. 0. 0 or 2. 0. 0. 0 ranges.
All lighting software differs in the details of implementing these settings, but all follow the same basic principles. . .
Set a universe to output data to an artnet port (
Set by subnet and Universe).
This data can be multicast (
Send to each device on the network)or unicast (
Send to specific device).
I recommend using unicast because it has less network overhead, so performance is better.
If the subnet matches the cosmic settings, our espArtnetNode will receive it.
It responds to the ArtPoll request, so it should be displayed correctly in the lighting software of your choice.
Jands Vista SetupI uses Jands Vista as the console of my choice, so I will show a screenshot of the process and explain where the settings are.
You can download and try Vista for free (Mac and PC)-
But if you don\'t buy a channel dongle, it will lose power at random.
I think you have fixed some lights.
I\'m not going to discuss this because Jands has a lot of great tutorials on their YouTube channel about this and other basics.
On Vista, go to your patch view and select connect universe in the top right corner of the screen \".
There will be a list of available outputs available for any console or wing that can be detected.
Your espArtnetNode should also list two available ports.
Assign the data range to be sent to each port.
This will set up the unicast artnet connection.
Upon completion, the active indicator on the espArtnetNode should start flashing to indicate that the DMX is outputting.
You can also select Add network connection in the lower left corner of the Connect universe dialog box \".
This will allow you to add an artnet broadcast port.
Use subnet and cosmic settings in the device.
The data space is now allocated to the broadcast port.
This will create an artnet broadcast.
Any device on the network can be set to the subnet and universe that receives artnet data.
I\'m pretty sure you \'ve solved the problem. . . .
Insert the DMX output into your light (s)
Select and take its rotation.
I highly recommend these awesome rgb led bar controllers I designed a few years ago.
ShamelessPlugThis outlines what the monthly status indicator does.
Both LEDs light up when powered on, indicating that the device is up.
They remain fully lit when the nodes try to connect to WiFi.
After reaching the hotspot timeout (
Default 30 seconds)
, The Led will alternate twice per second.
This will continue until the client connects to the hotspot.
They are all closed if the client is connected.
If there is no client connection in a minute, the device resets and starts again.
After the WiFi network is connected, both LEDs will be turned off before the artnet data arrives.
When the data starts arriving, the device buffers it.
After the first artnet packet is received, the device will start to output the DMX and the LED will flash to indicate activity.
A healthy artnet stream will keep flashing.
Each output is processed separately. A slow flash (
About once a second)
Indicates no new data was received.
This may indicate that the network is down, that the console has stopped sending data, or that there is no new data at all.
The device will output at least one full DMX universe per second to ensure that the device remains stable, and any new device connected to the DMX chain will get the required data.
I have very few problems.
Let me know if you find out.
ESP8266 is 2 and WiFi will not connect.
4 Ghz B, G, N is supported.
I find it doesn\'t like a network I \'ve tried, but since it was a long time ago, I can\'t remember the specifics.
Triple check SSID and password.
I plan to add the normal view switch for password input in future versions.
Check if your MAC is in the network allow list.
When compiling/flashing the firmware, make sure the flash memory size in the Arduino IDE is correct.
For more details and fixes, see the flash firmware steps.
Check your hotspot timeout settings (
Default to 30 seconds).
If it\'s really high, it may take a few hours for your hotspot to start.
Check if the device is not connected to the WiFi network.
If the WiFi settings on the settings page are available, it will connect to this setting before launching the hotspot.
When compiling/flashing the firmware, make sure the flash memory size in the Arduino IDE is correct.
For more details and fixes, see the flash firmware steps.
OTA is not working make sure the flash memory size in Arduino IDE is correct when compiling/flashing firmware.
For more details and fixes, see the flash firmware steps.
DMX out is output only when connected to WiFi and receive a valid artnet packet.
Once this happens, it will output at least 1 full DMX universe per second of the data received at the end.
Check whether the lighting console and artnet nodes have matching artnet settings.
You can also check the network settings to make sure they can talk to each other.
Also check if you have a license that allows the software to output data.
If you don\'t buy enough channels, Jands Vista will have a random power outage.
If the led shows activity but does not have a DMX output, check if the MaxTron chip has a power supply and if the wiring is correct.
Also check if the LED and DMX output match (i.
E. LED _ a means dmx_a, not dmx_ B).
It\'s easy to poke the LEDs in the wrong hole.
Complete Web setup-
I plan to add the normal view switch for password input in future versions.
I\'m also thinking of using AJAX and JSON to save the settings instead of submitting the entire page.
Standing alone
I plan to add a standalone mode where the hotspot of the device can receive Artnet.
Currently, setting up the correct IP subnet is a challenge.
LCD MenuI is currently developing LCD menus for this device.
It will consist of a small 128x64 LCD and 2 or 3 buttons.
The menu will allow local settings to be changed and key information will be displayed locally without the need to use a laptop or phone.
The main problem I\'m facing right now is giving up the button.
It\'s hard to do this in code because I want to keep the exact DMX time I currently have --
Receiving artnet packets and DMX output is priority.
When I have more time, I will look into the hardware failure.
I\'m thinking of using a small loop that runs with software De-hash and then sending the button status to ESP-
It\'s simple, I have a lot of small AVRs on hand.
I can also use the running LCD to reduce the load on ESP.
Storing scenarios with a lot of flash storage, I think it is a good idea to store scenarios on ESP.
This will allow to run simple scenes or chase without a lighting console.
This will work with the LCD dish single phase, allowing the selection of the scene from the menu or web interface.
A dmx universe is 512 bytes, so it takes 1 k for both universes.
I think I can store 500 scenarios on 1 M flash and more on 4 M version of esp8266.
This will allow to record some cool Chase.
The DMX is 44Hz, so 44 K space is required per second.
This means you can chase around 11. 5s long.
You can also record packets per second or third to allow longer chase.
Captive PortalI plans to add the captive portal code to the hotspot soon.
This means you don\'t need to enter an IP address-
At the beginning of the hotspot, you will automatically send to the settings page.
Obviously this will not work when connected to the WiFi network, as ESP8266 is not a DHCP server.
Please note that I have not fully tested this code yet and it may be wrong.
Please give me feedback on your experience with the code and any suggestions.
How to update this version using a slightly modified version of lwIP.
If you would like to modify/compile/upload this using the Arduino IDE, see the details at the bottom of this page.
The simple option is to download v1. 1. 0.
From the bin on my gitHub, go to the web settings page for your device and do a firmware update from v1. 0.
5 new features for V1. 1.
I finally found a bit of time to implement some of my previous ideas.
In addition to these changes, I made some adjustments behind the scenes.
Please check my gitHub for details.
New features for V1. 2.
After many modifications, I finally implemented the storage and call DMX scene.
This is done by using the spiiffs system to save all Artnet data into a file and access it through the web GUI.
Just set the static look through the lighting console, go to the storage scene page on the web GUI, type the scene name, and click save \".
You can then recall the scene, overwrite the scene with a new value or delete the scene.
This page will also show you the source of art output, whether it\'s Artnet or one of your scenarios.
Depending on the number of channels, you should be able to store about 200 scenarios on 1 M ESP8266, partitioned to 256 k spiffs.
The Web GUI will show you how much space is used.
Packet forwarding in hotspot mode allows you to set up the device once in hotspot mode and have other nodes connect to the device.
This allows you to use multiple nodes without a separate WiFi AP/router.
Use the checkbox on the web UI to open the standalone mode.
It will run only one hotspot, allowing you to connect to the device immediately without waiting for the device to try the WiFi connection.
In this mode, you can send artnet directly to the device without the need for a wifi AP.
The updated web GUI adds options for standalone mode.
It can also view the wifi password, thus reducing the error of entering a new password.
Help information is now hidden by default and can be switched using question mark images.
The IP settings in Hotspot are better and more artnet compliant.
By default, the current IP of the device is 2. 0. 0.
1 when in hot or independent mode.
You can also change IPs to static in standalone mode.
We need to modify a file before opening the IDE.
Go to the folder where your ESP core files are installed and find the files: on my Mac, they are in ~3. 0-
Rc2/modify it according to this request and this request.
Hopefully my submission will be merged into lwIP master soon and posted in the next core file release.
Open the Arduino IDE now.
In the Tools menu, select the motherboard as the core development module.
As we did in step 4, set all settings for flash size and speed.
Make sure to select the lwIP variant: \"Open source (gcc)\".
This option will compile lwIP from source code (
We modified it above. .
You should be able to flash everything as usual now.
I look forward to hearing feedback and suggestions on this new building.
The latest version of this project, I have been working hard.
Check it out on my Github and the new Instructure, detailing how to set up ws2812 pixel mapping using jsrp. What\'s New?
New Library: New firmware has been re-built
Do it from scratch.
I wrote a brand new ArtNet library that contains almost all of the ArtNet v4 features including address and port changes.
The new library also allows for the easy addition of an unlimited number of ports-
Depending on memory usage.
In addition to the ArtNet library, I also re-
Write the espDMX library to add RDM support for the two outputs of the esp8266.
This is very tricky because esp8266 has only one RX pin.
This library automatically tracks the connected device and notifies the ArtNet client of any changes (
Library via ArtNet).
ArtNet v4i has tried to fully comply with the ArtNet v4 specification if possible.
This includes merging data for up to 2 IPs per universe in HTP or LTP and complying with the merge cancellation request.
The status message is also sent with the artPollReply message so that the controller can get some feedback and see the current status of the output.
SACN support ti has many requests for sACN support.
Available now in beta5d.
DMX InI has now added DMX input support.
You can only have one input, but the second port can be a DMX out or a WS2812 control.
When using the DMX in, the RDM does not work on the second port because there is only 1 RX port on the esp8266.
RDM support: RDM is built on top of DMX and works with DMX using the same device.
It represents remote device management, allowing you to monitor and change device settings without physical interaction with the device.
This is great on a large rig or when the fixture is in an awkward position because you can change the address remotely or check the sensor.
Support: There are many uses for addressable led.
With the latest firmware, you can control up to 1360 pixels (680 per output)
Use the same basic hardware.
The output is \"wine switched\", which means that you can immediately change from DMX/RDM to WS2812 and even have each output if you want.
Pixel FX: I have made a basic FX engine that controls up to 1360 pixels with only 12 DMX channels.
Better, Faster Web UI: The Web UI is now richer to better experience stylesheets designed to be easier to use on mobile, tablet and desktop screens.
It also uses AJAX and JSON to handle all requests.
This makes it faster with less network and hardware resources.
Upcoming scenario: this is very popular in my v1. 2.
0 firmware, will enter v2 soon.
Given the chase, the storage of pixel FX, and the choice to use the hardware buttons, it will be greatly improved. Support non
WS2812 pixels: This may or may not happen. WS2812(b)
Is the most common tape.
If you want this feature, consider donating and send me a message so I can buy some to test.
The source code for the latest update of my new firmware is now ready for anyone who wants to try.
It will work with the hardware in this manual, or you can make some minor changes to add RDM support.
I have a schematic on Github.
Make sure to read the README when needed to make sure the correct bin is flashing.
Custom message
Chat Online 编辑模式下无法使用
Leave Your Message inputting...