HELP DMX Signal via ESP32 Wifi and Artnet
Posted: Thu Dec 08, 2022 7:43 pm
Hi there, I have been banging my head for two weeks at this and I can not figure it out. I lack the basics I assume.
For an art-installation I want to an ESP32 controller with wifi (This one [AZ Delivery Node MCU CP2102](https://www.amazon.de/AZDelivery-NodeMC ... 104&sr=8-3)
[TTL zu RS-485] with this TTL to RS485 module (https://www.amazon.de/gp/product/B07DK4 ... UTF8&psc=1)
to listen to DMX data on the wifi and send it into the [DMX decoder](https://www.amazon.de/Channel-Controlle ... C85&sr=8-9)
I am trying and trying different libraries etc. etc. but can not get anything to work.
i.e. I used this library [Artnet wifi](https://github.com/rstephan/ArtnetWifi) and tested the debug examples to see if any signal was getting through AND to test if any signal is beeing received via wifi. But no matter what I try, the just confirmes the connection to wifi and then nothing.
To generate the DMX signal I am using Resolume Arena. I would be open to use anything else if that is the issue of course... I can not even test if there is data beeing streamed as I don't know how. But it is so simple to setup that I highly doubt that it is the issue. (I have set resolume to use just one LED with three channels and to send to a specific ip adress. "Subnet 0, Universe 0)
Maybe my issue is so fundamental that I can not even get to the signal part yet. ...
The wireing:
**ESP32 controller**
5v --> RS485 VCC
GND --> RS485 Ground
G12 --> RS485 Data Input !!! <-- was in a tutorial, but I don't know how to check if the pin is even right?
**RS485 controller**
RE and DE are wired to VCC to set the module to send the data
DE pin to ESP32 --> possibly wrong pin
VCC --> ESP32 5V
B --> DMX decoder D-
A --> DMX decoder D+
GND --> DMX Decoder GND and ESP32 GND
Code on the ESP32 (i tried all examples etc.)
```
/*
Example, transmit all received ArtNet messages (DMX) out of the serial port in plain text.
Stephan Ruloff 2016,2019
https://github.com/rstephan
*/
#include <ArtnetWifi.h>
#include <Arduino.h>
//Wifi settings
const char* ssid = "XXXX";
const char* password = "XXXX";
WiFiUDP UdpSend;
ArtnetWifi artnet;
// connect to wifi – returns true if successful or false if not
bool ConnectWifi(void)
{
bool state = true;
int i = 0;
WiFi.begin(ssid, password);
Serial.println("");
Serial.println("Connecting to WiFi");
// Wait for connection
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
if (i > 20){
state = false;
break;
}
i++;
}
if (state) {
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(IPAddress(WiFi.localIP()));
} else {
Serial.println("");
Serial.println("Connection failed.");
}
return state;
}
void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data)
{
bool tail = false;
Serial.print("DMX: Univ: ");
Serial.print(universe, DEC);
Serial.print(", Seq: ");
Serial.print(sequence, DEC);
Serial.print(", Data (");
Serial.print(length, DEC);
Serial.print("): ");
if (length > 16) {
length = 16;
tail = true;
}
// send out the buffer
for (int i = 0; i < length; i++)
{
Serial.print(data, HEX);
Serial.print(" ");
}
if (tail) {
Serial.print("...");
}
Serial.println();
}
void setup()
{
// set-up serial for debug output
Serial.begin(115200);
ConnectWifi();
// this will be called for each packet received
artnet.setArtDmxCallback(onDmxFrame);
artnet.begin();
}
void loop()
{
// we call the read function inside the loop
artnet.read();
}
```
**Any help is extremely greatly appreciated.**
* My main goal is to get at least ANY DMX signal from the ESP32. (can even be manual at this point)
* Secondary of course is to see that it receives DMX signals over wifi ... but let us start simple
For an art-installation I want to an ESP32 controller with wifi (This one [AZ Delivery Node MCU CP2102](https://www.amazon.de/AZDelivery-NodeMC ... 104&sr=8-3)
[TTL zu RS-485] with this TTL to RS485 module (https://www.amazon.de/gp/product/B07DK4 ... UTF8&psc=1)
to listen to DMX data on the wifi and send it into the [DMX decoder](https://www.amazon.de/Channel-Controlle ... C85&sr=8-9)
I am trying and trying different libraries etc. etc. but can not get anything to work.
i.e. I used this library [Artnet wifi](https://github.com/rstephan/ArtnetWifi) and tested the debug examples to see if any signal was getting through AND to test if any signal is beeing received via wifi. But no matter what I try, the just confirmes the connection to wifi and then nothing.
To generate the DMX signal I am using Resolume Arena. I would be open to use anything else if that is the issue of course... I can not even test if there is data beeing streamed as I don't know how. But it is so simple to setup that I highly doubt that it is the issue. (I have set resolume to use just one LED with three channels and to send to a specific ip adress. "Subnet 0, Universe 0)
Maybe my issue is so fundamental that I can not even get to the signal part yet. ...
The wireing:
**ESP32 controller**
5v --> RS485 VCC
GND --> RS485 Ground
G12 --> RS485 Data Input !!! <-- was in a tutorial, but I don't know how to check if the pin is even right?
**RS485 controller**
RE and DE are wired to VCC to set the module to send the data
DE pin to ESP32 --> possibly wrong pin
VCC --> ESP32 5V
B --> DMX decoder D-
A --> DMX decoder D+
GND --> DMX Decoder GND and ESP32 GND
Code on the ESP32 (i tried all examples etc.)
```
/*
Example, transmit all received ArtNet messages (DMX) out of the serial port in plain text.
Stephan Ruloff 2016,2019
https://github.com/rstephan
*/
#include <ArtnetWifi.h>
#include <Arduino.h>
//Wifi settings
const char* ssid = "XXXX";
const char* password = "XXXX";
WiFiUDP UdpSend;
ArtnetWifi artnet;
// connect to wifi – returns true if successful or false if not
bool ConnectWifi(void)
{
bool state = true;
int i = 0;
WiFi.begin(ssid, password);
Serial.println("");
Serial.println("Connecting to WiFi");
// Wait for connection
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
if (i > 20){
state = false;
break;
}
i++;
}
if (state) {
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(IPAddress(WiFi.localIP()));
} else {
Serial.println("");
Serial.println("Connection failed.");
}
return state;
}
void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data)
{
bool tail = false;
Serial.print("DMX: Univ: ");
Serial.print(universe, DEC);
Serial.print(", Seq: ");
Serial.print(sequence, DEC);
Serial.print(", Data (");
Serial.print(length, DEC);
Serial.print("): ");
if (length > 16) {
length = 16;
tail = true;
}
// send out the buffer
for (int i = 0; i < length; i++)
{
Serial.print(data, HEX);
Serial.print(" ");
}
if (tail) {
Serial.print("...");
}
Serial.println();
}
void setup()
{
// set-up serial for debug output
Serial.begin(115200);
ConnectWifi();
// this will be called for each packet received
artnet.setArtDmxCallback(onDmxFrame);
artnet.begin();
}
void loop()
{
// we call the read function inside the loop
artnet.read();
}
```
**Any help is extremely greatly appreciated.**
* My main goal is to get at least ANY DMX signal from the ESP32. (can even be manual at this point)
* Secondary of course is to see that it receives DMX signals over wifi ... but let us start simple