(ArtNet node) - Multiple arduinos sharing ethernet shield data

I hope I picked the right room for this topic...

Hi all.

So, as the title says, I'm interested in creating ArtNet (network DMX protocol by artistic license) to DMX (serial protocol, via Arduino->MAX485 signal conversion) nodes...

So, to cover the quick basics for those unfamiliar:
-> DMX is protocol to control variuous (mostly lighting) devices in entertainment industry, together: 512 bytes of data at 44Hz framerate
-> ArtNet is protocol created by Artistic License, which transfers this DMX data in packets of size 530bytes at same framerate 44Hz (packet consists of 18 bytes ArtNet header + 512 bytes of data which is then translated directly to/from DMX serial protocol)
-> There can be multiple universes (each set of uniquely addressed 512 bytes is one universe) sent over ArtNet, however only one over each serial line. Thus, ArtNet could transfer 200 universes, but the receiver would need to have 200 UART TX ports to translate them back to the serial line.

Therefore, as one universe (one serial set of 512 channels) nowadays is really low, using the 328 ICs with single UART is pointless if I need to have Ethernet board for each of them, as this results in having 1 IP per universe in the network, therefore making transmissions hard to set up.

Instead, Arduino MEGA is used, as it has 4 UARTs. And a cool guy called Tony Merino wrote a library called "Arduino 4 universes DMX library v0.3" which can translate the receiver ArtNet data for four universes, aka for all 4 UARTs on the MEGA board.

HOWEVER, the MEGA processor is slow, and low-power, and loves to get overwhelmed with the received packets and make a private party out of it instead of sharing, so often resets are needed, + the refresh framerate hugely drops! :frowning:

Now, the question:

If I have an arduino MEGA with ethernet shield, receiving this packets of 530 bytes of data ->
How to share them to other boards, to pass the CPU load onto the other boards?
The idea is, that I'm suspecting that the transmission of bytes to the UART causes the troubles;
Therefore, my idea is to do the following:

  • Receive the data of multiple universes onto the MEGA board;

  • pass this data forward to 328 boards, (pass only the necessary 512 bytes of data), which then take care of translating that to UART serial DMX data

  • since each artnet packet has the universe number in the header, I'd like to do like this: if universe 1 -> pass the 512b data to 328 1; if universe 2 -> pass to 328 2.. etc.

Would that way the number of possible receiving data be increased? Would this way the CPU load actually be any lower?

Im asking this, because 1) the 328 are cheap enough that having one per output is fine
2) because this way I use one ethernet board, which is vital not for the price, but more for addressing; as it only uses 1 IP address for more outputs;

Hope I was clear enough. Thanks! :))

PS: I paypal the beer to the solver! :stuck_out_tongue:

The idea is, that I’m suspecting that the transmission of bytes to the UART causes the troubles;

And I think it is your code that causes troubles. What is the ethernet shield doing? The ArtNet data doesn’t come via it, does it?

PaulS:
And I think it is your code that causes troubles. What is the ethernet shield doing? The ArtNet data doesn't come via it, does it?

Basically, as said - it's not my code I'm using, but rather the library that is available online (the only one that can do more than one universe). Unfortunately, I'm not acknowledged enough to work with low-level arduino stuff, like UARTs etc.. :frowning:

Now, I don't totally get your question; If youre asking if the ArtNet data is coming through ethernet shield -> yes, it is.
If you're asking if at the time of freeze the data is coming through ethernet shield to the arduino itself or not - that I do not know and have no idea how to check... It surely reaches the ethernet shield on the network, but I don't know how to check and see if it goes forward from there... :confused:

but I don't know how to check and see if it goes forward from there...

How do you KNOW that the data gets to the Ethernet shield?

Enough with the too-subtle hints. Where IS your code?

http://www.deskontrol.net/blog/arduino-four-universes-dmx-512-library/

That's it. just as is, only thing moded is commented/uncommented UARTs in use (universes in use), the rest is uploaded as-is.

I don't intend to guess what you changed. Since you don't seem inclined to post YOUR code, I'm done.

PaulS:
I don’t intend to guess what you changed. Since you don’t seem inclined to post YOUR code, I’m done.

I just told you! I haven’t changed a thing from the code (except for the IP, which is completely irrelevant to the case).

Why to double copy the code? That code is the original.
No changes were made. I was posting this question to find out HOW and WHAT to change, in order to get that data to be shared with other 328 driven boards, instead of just setting UART DMX outputs.

“MY” code is the one I gave you link to…

That's it. just as is, only thing moded is commented/uncommented UARTs in use (universes in use), the rest is uploaded as-is.

I haven't changed a thing from the code (except for the IP

They can't both be true.

PaulS:
They can't both be true.

Now this is a bit silly already, but yeah, I walked into this one by myself.

Commenting/uncommenting "UART0", "UART1", "UART2" and "UART3" tells how many and which incoming packets to listen and process (based on 14th byte of the packet if I'm correct, which defines universe number), and which ones to simply ignore. That's the princip of the work at least.

Changing IP is necessary in order to make arduino compatible and talkative with existing network.

With "I haven't changed a thing from the code" I meant that except for the variables, which are MEANT to be changed by the end user, and are even documented this way, + really made no changes to the functioning of the whole code itself (IP...), I didn't change any procedure or function that is written in the library above, thus posting "my" code here would be just duplicating something that already exists.

Now to be really precise, in my code I use either only UART1 (others commented), or for two I use UART1 and UART2 (other commented). I don't start with UART0 simply because it's easier to program it without removing the MAX485 from the TX pin to upload sketch... I avoid them whenever I can with MEGAs...

Now, I'd be really happy and grateful if your time and effort would be used to think and give some ideas to the starting question instead, so that we could actually talk about something that can be discussed... If possible... :))

I have been working on something similar.. I think I might have a really good 4 universe out version for the Mega that doesnt involve using multiple Uart interrupts

Once my code has been tested i shall post it here

I have also been doing some artnet projects, if I can squeeze two universes of WS2812 (Pixel LED) data out of a UNO, im sure 4 DMX universes can be done on a MEGA !

I am wondering if a MEGA can do 4 DMX universes AND 4 WS2812 universes, or just 8 WS2812 universes

:slight_smile: