Hello,
unfortunatly i have almost zero expierience with arduino or coding whatsoever, but I need this for work.
At theatre I work we have 8 Genuino mkr1000 boards with 2 relays (or dimmers) on pins 2 and 4 programmed to connect to specific wi-fi and recieve artnet from lighting console and work these relays ( or dimmers). Person who programmed these modules is unreachable.
All information I was able to gather so far is for controling adressable pixel strips but not individual pins.
Dream outcome would be these modules connecting to specific wifi keeping static IP running 2 relays with signal from artnet and webserver where we could change universe and starting dmx adress and maybe even SSID and password for WIFI to connect to
If anyone is able and willing to help, it would be highly apriciated
It's not clear what the compensation would be for performing this work. Or, are you looking for a volunteer?
information I was able to gather so far is for controling adressable pixel strips but not individual pins
This is also unclear, first you mention relays, then LED strips, then pins. We know nothing of the details of any of those that you have.
Also you say you were able to gather it, but you didn't post it.
Is this just another way to say, you have no idea how to write a sketch to control the pins that will drive some relays?
The expectation here, is that if you want help to do it yourself, you have to provide adequate details. In reality, even a contractor will need a lot of details.
unfortunaly I am unable to secure monetary compensation - therefore I have to apologize if my choice of words have indicated that there could be any other compansation than gratitude
yeah, sorry, I just dont even know the scope of the things I dont undestand about all of this.
so far I have gotten this far
/*
This example will receive multiple universes via Artnet and control a strip of ws2811 leds via
Adafruit's NeoPixel library: https://github.com/adafruit/Adafruit_NeoPixel
This example may be copied under the terms of the MIT license, see the LICENSE file for details
*/
#include <ArtnetWifi.h>
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
//Wifi settings
const char* ssid = "ithurts";
const char* password = "alusalus";
// OUTPUT PINS
const int ledPin2 = 2;
const int ledPin4 = 4;
// Neopixel settings
const int numLeds = 1; // change for your setup
const int numberOfChannels = numLeds * 1; // Total number of channels you want to receive (1 led = 3 channels)
const byte dataPin = 2;
Adafruit_NeoPixel leds = Adafruit_NeoPixel(numLeds, dataPin, NEO_GRB + NEO_KHZ800);
// Artnet settings
ArtnetWifi artnet;
const int startUniverse = 0; // CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as 0.
// Check if we got all universes
const int maxUniverses = numberOfChannels / 512 + ((numberOfChannels % 512) ? 1 : 0);
bool universesReceived[maxUniverses];
bool sendFrame = 1;
int previousDataLength = 0;
// 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(WiFi.localIP());
} else {
Serial.println("");
Serial.println("Connection failed.");
}
return state;
}
void initTest() {
for (int i = 0; i < numLeds; i++)
// leds.setPixelColor(i, 127, 0, 0);
leds.show();
delay(500);
for (int i = 0; i < numLeds; i++)
// leds.setPixelColor(i, 0, 127, 0);
leds.show();
delay(500);
for (int i = 0; i < numLeds; i++)
// leds.setPixelColor(i, 0, 0, 127);
leds.show();
delay(500);
for (int i = 0; i < numLeds; i++)
// leds.setPixelColor(i, 0, 0, 0);
leds.show();
}
void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data) {
sendFrame = 1;
// set brightness of the whole strip
if (universe == 0) {
leds.setBrightness(data[0]);
leds.show();
}
// Store which universe has got in
if ((universe - startUniverse) < maxUniverses)
universesReceived[universe - startUniverse] = 1;
for (int i = 0; i < maxUniverses; i++) {
if (universesReceived[i] == 0) {
// IF NO DMX RECIEVED OUTPUTS SIGNAL FOR LEDS
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin4, HIGH);
//Serial.println("Broke");
sendFrame = 0;
break;
}
}
// read universe and put into the right part of the display buffer
for (int i = 0; i < length / 3; i++) {
int led = i + (universe - startUniverse) * (previousDataLength / 3);
if (led < numLeds)
leds.setPixelColor(led, data[i * 3], data[i * 3 + 1], data[i * 3 + 2]);
}
previousDataLength = length;
if (sendFrame) {
leds.show();
// Reset universeReceived to 0
memset(universesReceived, 0, maxUniverses);
}
}
void setup() {
pinMode(ledPin2, OUTPUT);
pinMode(ledPin4, OUTPUT);
Serial.begin(115200);
ConnectWifi();
artnet.begin();
leds.begin();
initTest();
// this will be called for each packet received
artnet.setArtDmxCallback(onDmxFrame);
}
void loop() {
// we call the read function inside the loop
artnet.read();
}
artnet side of it all works and I can control LED input from lighting console, but LED output from relay blinks rapidly
How much work do you want done for gratitude? It looks a lot to me like a really big development task that you aren't capable of. You're currently asking for a complete hardware and software solution, since you haven't posted any technical information to speak of.
I'm not saying you can't ask, I'm saying, you won't get that here. Not in a forum thread. I often give free advice on specific matters of limited scope, and even sometimes complete solutions (but only for small problems). What you are asking for, goes way beyond that, and I think beyond what 100% of all the free helpers on this forum would be willing to undertake.
Years ago, I started down a similar path, hoping to get into creating basic DMX devices using an Arduino. However, I ran into a lot of problems very quickly. There were cheap interfaces that could handle the electrical part of connecting to a DMX signal, but there were difficulties with the software. There were conflicts with things called interrupts, etc.
I don't know the difficulties you may encounter with the Artnet. And like you, I found plenty of low-cost interfaces for the addressable pixel LEDs, but the simple control of a DC output, or non-addressable LED strip were all extremely expensive (i.e. hundreds of USD). However, I just now seemed to have found the correct search terms to bring up one product I can afford.
This product is 46 Euros. https://sigma-shop.com/product/152/art-net-dmx-two-relay-controller.html
Another approach may be to give up on the Artnet, and just go wired DMX. There are plenty of relay circuit boards that do this. And many dimmer packs can be set to operate as an on/off relay.