mathertel / DMXSerial

An Arduino library for sending and receiving DMX packets.
BSD 3-Clause "New" or "Revised" License
336 stars 79 forks source link

Simultaneous sending and receiving DMX? #48

Closed chendy closed 3 years ago

chendy commented 4 years ago

Will this library support 'simultaneous' sending and receiving? I want to receive DMX, remap/reprocess some values, then send DMX - in realtime. Assuming the processing is very lightweight, will this library support this?

Thanks for your amazing work.

mathertel commented 4 years ago

I am not sure what you want so let's clarify the use-cases:

chendy commented 4 years ago

Thanks @mathertel

In addition to the serial port used for the DMX by this library, would there be a spare serial port that I could use? So I could have 2x Arduinos, one set up as a DMX controller and one as a DMX slave. And say use UART for communication between these two devices if using a Mega. Or use say SPI to connect two ATmega328s?

mathertel commented 4 years ago

That seems complex and may work but I never did it.

willwatson27 commented 3 years ago

Thanks @mathertel

In addition to the serial port used for the DMX by this library, would there be a spare serial port that I could use? So I could have 2x Arduinos, one set up as a DMX controller and one as a DMX slave. And say use UART for communication between these two devices if using a Mega. Or use say SPI to connect two ATmega328s?

Have you had any luck with this? I'm trying to forward DMX from a grandma2 with some extra interbyte delay to fix jitter issues on some Chinese fixtures.

chendy commented 3 years ago

Hello @willwatson27

I didn't try this approach but instead used this with success https://github.com/ssilverman/TeensyDMX

willwatson27 commented 3 years ago

Thanks for the lead @chendy. That definitely looks like what I'm after.

mathertel commented 3 years ago

I cannot recommend using an Arduino UNO or ATMega as there are restrictions on the available Serial ports and also the processor may not handle all the load running multiple lines because of the slow speed. The Teensy or ESP32 is a better and faster processor that may fit.

ChetNocatee commented 1 year ago

I am currently using the DMXSerial library, version 1.5.3, with an Arduino Uno R3 to use DMXSerial.init(DMXReceiver) and DMXSerial.read in the setup() function where I try to write an incoming DMX packet , the first 45 channels, to a byte array IChannel[k]. I then execute DMXSerial.init(DMXController) and DMXSerial.write as the last step in setup(). In the loop() function I try to augment 4 of the 45 channels in IChannel[k] through A0 and A1 with a potentiometric joystick. The joystick adjustment passes through to TX (D1), but not the originalDMXSerial.write input from the setup() function. I am reading both inputs and outputs with PicoScope 2206B MSO oscilloscope. If I load IChannel[k], as shown in the attached file, the loaded array elements show up in the output, along with any joystick adjustments. Why can I not load an array with DMXSerial.write and subsequently get it out from TX with DMXSerial.read. I can make a schematic of the circuitry used if anyone is interested Manual_Spotlight_Control_2.txt