no signal going to relays

It was making nut go crazy for a year I am new to all this and I am still figuring out how to make all this work together it's a Learning curve through process of illumination for me. Lol
The reason I was going down this path was I used to run vixen and I had arduino controllers running my AC lights, and another set of arduino's running my pixels and I wasn't sure how to hook it up to X lights until now.
There is nothing Out there that I found that was in my realm Whatever I found for arduino controlers and xlights everybody was using pixels and I was trying to control the AC lights this way that's where I had the challenge.

Sent from my SM-N975U using Tapatalk
 
I didn't follow this thread too closely, but what is the outcome? Do we have an Arduino sketch that can read in DMX, break out some GPIO, and forward out DMX?
 
This thread is about data over USB connection rather than DMX. Assuming you want to 'read' DMX data:

Firstly - there is no such thing as the Arduino reading and forwarding out DMX. DMX is essentially serial data transmitted using differential RS485 communication. You will need some extra hardware connected to your Arduino (an RS485 IC or module). There is no 'forwarding' to do as such since the ICs form part of the DMX 'chain'.

Here's an example from the Internet, there are many others:
https://wltd.org/posts/arduino-dmx-to-rgbw-led-with-max485
Although the diagram doesn't show it, DMX 1, 2, 3 wires can be looped from / to other devices in a chain. Remember to add the 120 ohm terminator to the last device in your DMX network.

The example uses the DMXSerial arduino library which takes care of all the tricky parts for you.

To control relays you will need to read DMX channel values and implement logic like the following (put it in a loop to handle all your adjacent channels, arrays will be your friend here)

Code:
if(channelValue == 255){
   digitalWrite(relayPin, HIGH);
}
else
{
   digitalWrite(relayPin, LOW);
}

or you could make values > 127 'on' so:

Code:
if(channelValue > 127){
   digitalWrite(relayPin, HIGH);
}
else
{
   digitalWrite(relayPin, LOW);
}


The sketch in the example uses AnalogWrite() on PWM pins to dim an output - naturally this doesn't apply to relays so the code you need is in ways simpler.
Regarding setting the 'start address' of your Arduino DMX decoder, you can set this in your sketch (so tell it which channels to read) or if you have enough spare GPIO pins you could connect a DIP switch bank and read the start channel in your code. You will see the example above uses 100 as the start channel.

That's more or less all there is to it.

One thing to be aware of (the comments on that page also mention this) is that you probably can't use the Serial monitor for debugging (for example if you want to read DMX values and show them live in the IDE's serial monitor window). This can be super helpful when building/debugging. An option would be to connect an i2C LCD display (using pins A4 and A5 normally) and use that to show whatever you want. Again there's lots of examples on the Internet about how to do that.
 
Last edited:
Yeah, I was hoping on this thread that you had come up with a way to not need that rs485 ic. Reading data over a Mega USB is still useful to know, though. ESPixelstick seems to already have down pretty good how to receive DMX over 2.4ghz, and output Dmx. I'm currently in the market for the best way to integrate ws2811 into DMX stage lighting, in a theater full of people carrying cell phones, all operating on 2.4ghz band. And--of course--get that signal to relays.
 
Lots of terminology is being muddled up there i.e. WS2811/ DMX / wireless DMX / Streaming ACN etc

The example I have outlined above will allow you to read DMX data from existing stage lighting into the Arduino, then do what you wish with that (which I think is what your end game is). If you want to work with wired DMX then you absolutely need the RS485 IC to convert the differential (2-wire / 'balanced') DMX data from your stage lighting into a normal 1 wire logic signal on the serial input of the Arduino which, can then decode that to do whatever (like set a pin on/off for a relay board or set a PWM value on a pin for dimmable devices). No aspect of that is wireless. As you will know, the DMX data contains up to 512 channels each of which is a byte so a number between 0->255. You can program your Arduino sketch with which channel values to respond to.

If you only need to control relays then DMX is probably more than adequate for your needs. Also on the subject of that - you don't necessarily need lots of GPIO pins to achieve that , you can use tricks like shift registers to expand the number of outputs from one microcontroller.

WS2811 is a data protocol for addressable devices connected in a chain(like LED pixels). It has nothing to do with DMX, which is a different protocol.

An RS485 module and an Arduino nano, say, would come in at ?5-?10 all in in my country.
 
I didn't share my endgame yet, for fear of a thread hijack. But if we're done here anyway....

I have existing DMX stage lighting, using $130 Chauvet wireless DMX transceivers. I'm not impressed with their wireless range, given that they're $130. We have 2 wifi hotspots-- one is guest, the other is dedicated A/V. I share the A/V band with video. I want to integrate in ws2811, because that will support Xlights and lots of little lights--not just <512 big ones. One direction I want to go is to use the WLED effects and tie them to specific, predefined DMX values, so that I can just hit a button on my virtual light board and get an WLED effect, or tie them to a specific scene which includes other DMX fixtures in it. The second capability I want is to tie it all to an FSEQ, so I can just pipe the audio to the house mains and play. The challenge is in being able to set it up so I can do both. One or the other I can do, but both...not so much. One possibility is to just abandon wireless wherever I can, and rely on cat5. The light guy sits in the back and the stage is up front, so...painful. Another (and the one I'm most pursuing) is to use wifi repeaters to try and boost the A/V wifi signal. But either way, I still have the problem that the virtual light board is constantly broadcasting an E1.31 signal, even if that value is "all off". If I switch over to bringing up a Kulp's FPP page and hit "Play", I need the light board to be quiet. Ideally, I don't really want to do that, either: I want a button in QLC to fire a script which sends the Kulp a REST API. That would be integrated. But I need the sound booth to talk to the stage, preferably wirelessly. Having the stage talk to other parts of the stage wirelessly is not so bad.
 
Last edited:
FYI: In your situation, where the data points are well known, you can use the same solution I am using for my most distant ESPs. I have a few $35USD directional antennas that I use at the station end of the connection to "point" the WiFi signal at the AP. I had an immediate increase in signal quality from -90dbm (aka almost nothing) to -50dbm (>80%) resulting in a good high speed connection between the ESP and the AP. At that point you can choose a channel not in use by the public WiFi in the theater and make sure your WiFi signal is well encrypted and you should be fine. You do need to get devices that use an external antenna (lots of ESPs come in an external antenna version) and many of the ubiquity APs have an external antenna. FYI: I worked for a company that used Hi Quality directional antennas to get 32km WiFi distance and a high quality omni antenna to get 2km distances so a theater is a fairy trivial distance that can be covered by the cheap antennas you can pick up on amazon.

This is the antenna I like. Getting a signal through three layers of wood/roofing tiles / Metal flashing + 200' down the yard.
https://www.amazon.com/dp/B0B386PY5N?ref=ppx_yo2ov_dt_b_product_details&th=1
 
I have a sample of an ESP32 w/ antenna version. Just to confirm, flashing that with ESPixelStick V4 is not a problem? Since ESPixelStick can take E1.31 and drive both WS2811 and DMX, that solves 75% of my problem, right there. The last bit is how to get both WLED and ESPixelStick to coexist, while at the same time getting the virtual light board and the Kulp to coexist, i.e. only one actually running the lights at a time, but it's easy to switch between them mid-performance. Or it doesn't even have to be a Kulp--an equivalent of simply running Xlights in "Output to Lights" mode on the same laptop that runs the board and hitting "Play" would do.
 
Last edited:
WLEd and ESPixelStick cannot be on the same ESP at the same time. Since you are using E1.31 you can have WLED running in E1.31 mode and ESPixelStick running in E131 mode on different devices. Give them different universes and all is fine. It wont matter what the E1.31 source is. ESPV4 can even take data from your commercial lighting board without a problem.
 
Having twice the pixels simply because I can't have them run both WLED and ESPixelstick in the same show is a compromise I can afford--IF I can't find anything better. Ultimately, I guess i should have said the capability is not so much WLED as it is simply being able to play individual animations on cue, but also be part of some grander orchestration using multiple controllers. Which basically involves each ESPixelStick behaving as both a master AND a remote in the same show.

I can try a directional Wifi extender. Hope it doesn't wait until it's a packed auditorium before it fails. Murphy is not invited to the show. Thanks for the idea. :shock:


p.s. Yes all, I know it is a total thread hijack. I thought we were done with the original relays problem.
 
Back
Top