HELP DMX Signal via ESP32 Wifi and Artnet

AvionIO
Posts: 1
Joined: Thu Dec 08, 2022 7:29 pm

HELP DMX Signal via ESP32 Wifi and Artnet

Postby AvionIO » 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

Image
Image
Image

Residentec1988
Posts: 1
Joined: Fri Aug 18, 2023 2:47 am

Re: HELP DMX Signal via ESP32 Wifi and Artnet

Postby Residentec1988 » Fri Aug 18, 2023 3:01 am

Hi my Friend.
I am trying to solve a situation with my ESP-WROOM-32 and I came across your post.
I am currently developing an artnet node and using the "jinx" software which allows me to send packets to the ip configured in my code.

I am using a steren com-818 modem configured via ethernet (connected to my pc) configuring the ipv4 with its own ip and I can see the values or artnet packets (0-255) sent in the serial monitor of the Arduino IDE.

I share the code, if you need more details you can send me an email to: "residentecnologico88@gmail.com"

#include <ArtnetWifi.h>
#include <Arduino.h>
// Configuración de red
const char* ssid = "AAAAAAAAA";
const char* password = "BBBBBBBBB";

const IPAddress ip(192, 168, YY, XXX); // Cambia la dirección IP según tu red
const IPAddress gateway(192, 168, YY, 254);
const IPAddress subnet(255, 255, 255, 0);
int artnetPort = 6454;
//int myNet = 0; // Cambia este valor si es necesario
//int mySubnet = 0; // Cambia este valor si es necesario

// Configuración del nodo Artnet
char shortName[] = "MiNodoArtnet";
int univ = 1; // Cambia este valor si es necesario

ArtnetWifi artnet;

void setup() {
Serial.begin(115200);
// Set the Net and Subnet
//artnet.begin(10, 5);

// Subscribe to universe 0
//artnet.subscribe(0);

WiFi.begin(ssid, password);
WiFi.config(ip, gateway, subnet);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println("Conectando a WiFi...");
}

Serial.println("Conectado a WiFi");

artnet.begin(shortName);
artnet.setArtDmxCallback(onDmxFrame);

Serial.println("Nodo Artnet configurado");
}

void loop() {
artnet.read();
}

void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data) {
Serial.println("Valores de los canales para el universo 0:");
for (int i = 0; i < length; i++) {
Serial.print("Canal ");
Serial.print(i);
Serial.print(": ");
Serial.println(data);
}
}

IMPORTANT ANNOUNCEMENT:
I clarify that the following parameters do not work for me in the code, that is, even if I modify them, I still receive jinx packets no matter what Net, Subnet and universe I place in the jinx configuration, the only parameter that is respected is the jinx ipAddress, it is that is, if it does not match the code of the arduino IDE it is the only occasion that it does not receive the artnet packets

Who is online

Users browsing this forum: No registered users and 34 guests