Hi,
I've got an Arduino mega as well as an ethernet and a dmx shield to go on top. I'm wanting to have qlc+ send the dmx output over my wifi/ethernet network to my arduino which will then convert the signal into dmx and go off to my lighting rig. I'm having some issues though. I don't know if it's a problem with my code or the way i'm setting up qlc+ with the output. The Arduino Mega board is at the bottom with the ethernet shield on top and then the dmx shield on top of the ethernet shield. My code on the arduino is:
----------------------
#include <Ethernet.h>
#include <DmxSimple.h>
#define UNIVERSE 1
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; // Replace with your Ethernet shield MAC address
IPAddress ip(192, 168, 1, 100); // Replace with desired IP address
EthernetServer server(23); // Port 23 for Art-Net
void setup() {
Ethernet.begin(mac, ip);
DmxSimple.usePin(3);
server.begin();
}
void loop() {
EthernetClient client = server.available();
if (client) {
if (client.connected()) {
while (client.available()) {
// Read incoming data byte by byte
byte data[512];
for (int i = 0; i < 512; i++) {
data = client.read();
}
// Output the received data to DMX
for (int i = 0; i < 512; i++) {
DmxSimple.write(i + 1, data);
}
}
}
client.stop();
}
}
-------------------------------
I've been trying to set up qlc with an artnet thing as the output and i've just changed the ip address to 192.168.1.100 as in the code. I imagine i'm doing something completely wrong but if anyone knows how to get this working, It would be much appreciated.
Arduino Artnet Signal
-
- Posts: 1325
- Joined: Mon Apr 13, 2015 7:05 am
- Location: Bratislava, Slovakia
- Real Name: Jano Svitok
- Contact:
Hello,
I guess you should read https://www.artisticlicence.com/WebSite ... rt-net.pdf
I've noticed few things about your code:
1. Artnet is UDP protocol. Instead of EthernetServer you should use EthernetUDP: https://reference.arduino.cc/reference/ ... udp.begin/
2. The packet has header that you have to decode, and variable data (see spec above). You also have to register with the server so that it knows about you (see spec)
I think there are many more issues. I guess you should search for a ready made artnet library and adjust it for your needs (e.g. different DMX output). Google showed me https://www.instructables.com/Arduino-Artnet-Node/
Jano
I guess you should read https://www.artisticlicence.com/WebSite ... rt-net.pdf
I've noticed few things about your code:
1. Artnet is UDP protocol. Instead of EthernetServer you should use EthernetUDP: https://reference.arduino.cc/reference/ ... udp.begin/
2. The packet has header that you have to decode, and variable data (see spec above). You also have to register with the server so that it knows about you (see spec)
I think there are many more issues. I guess you should search for a ready made artnet library and adjust it for your needs (e.g. different DMX output). Google showed me https://www.instructables.com/Arduino-Artnet-Node/
Jano
-
- Posts: 4
- Joined: Mon May 15, 2023 7:00 pm
- Real Name: Bennn
Hi, wondering if anyone can help me -
The project from the link https://www.instructables.com/Arduino-Artnet-Node/
Uses a max485 chip and a dmx port but I’ve got a dmx shield to go on top of the Arduino. How would I change the code to suit this (possibly making use of a different library e.g DMXSimple or DMXSerial)?
The project from the link https://www.instructables.com/Arduino-Artnet-Node/
Uses a max485 chip and a dmx port but I’ve got a dmx shield to go on top of the Arduino. How would I change the code to suit this (possibly making use of a different library e.g DMXSimple or DMXSerial)?