Teensy 3.6 + Ethernet + Artnet + OctoWS2811, doesn't read more than 3 universes

ominoc

New member
Hi there,

I'm trying to control 1360 pixels (170pix * 8ports) with Teensy 3.6 with one 74HC245 as level shifter; I'm using W5500 as ethernet controller, and Madrix 5 as Artnet generator.

What I already tested:
-read Artnet UDP packages (so the ethernet library https://www.arduino.cc/reference/en/libraries/ethernet/ and Artnet https://github.com/natcl/Artnet it's fine)
-controlling led with OctoWS2811 Led Library (https://www.pjrc.com/teensy/td_libs_OctoWS2811.html)
-output from Madrix 5 or grandMA2 (checked with The ArtNetominator)

Issue:
If I read from the ArtNet 1 or 2 or 3 universes, all works fine!! 170 pixels over 3 output (510 pixel total). Madrix send ArtNet in unicast at 33.3 FPS, optimized frame.

When I try to read 4 universes, all goes wrong... the led update randomly every 10sec (more or less), even if I use 1 FPS in Madrix.
To ensure that Teensy receive all universes, I added a line to print every number of universe that teensy read from artnet... and I found that I can read only the first 3 universes of the total amount that I'm sending to it. When I change "startUniverse", I just move the problem further on...
I mean, startUniverse=0 read universes 0-1-2, startUniverse=1 read universes 1-2-3, startUniverse=10 read universes 10-11-12... not one more...

Does anyone as got an idea or test to run?

This is the basic example from OctoWs2811 library that I'm using:

C++:
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <Artnet.h>
#include <OctoWS2811.h>

// OctoWS2811 settings
const int ledsPerStrip = 170;
const byte numStrips= 3;
DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];
const int config = WS2811_GRB | WS2811_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);


// Artnet settings
Artnet artnet;
const int startUniverse = 0;
const int numberOfChannels = ledsPerStrip * numStrips * 3;
byte channelBuffer[numberOfChannels]; // Combined universes into a single array

// Check if we got all universes
const int maxUniverses = numberOfChannels / 512 + ((numberOfChannels % 512) ? 1 : 0);
bool universesReceived[maxUniverses];
bool sendFrame = 1;

// Change ip and mac address for your setup
byte ip[] = {2, 0, 0, 201};
byte mac[] = {0x04, 0xE9, 0xE5, 0x00, 0x69, 0xEC};

void setup()
{
  Serial.begin(115200);
  artnet.begin(mac, ip);
  leds.begin();
  initTest();

  artnet.setArtDmxCallback(onDmxFrame);
}

void loop()
{
  artnet.read();
}

 void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data) {
  sendFrame = 1;

  //Serial.print("universe:");
  //Serial.println(universe, DEC);

  // Store which universe has got in
  if (universe < maxUniverses) {
    universesReceived[universe] = 1;
  }

  for (int i = 0 ; i < maxUniverses ; i++) {
    if (universesReceived[i] == 0) {
      sendFrame = 0;
      break;
    }
  }

  // read universe and put into the right part of the display buffer
  for (int i = 0 ; i < 510 ; i++) {
    int bufferIndex = i + ((universe - startUniverse) * 510);
    if (bufferIndex < numberOfChannels) // to verify
      channelBuffer[bufferIndex] = byte(data[i]);
  }    

  // send to leds
  for (int i = 0; i < ledsPerStrip * numStrips; i++) {
    leds.setPixel(i, channelBuffer[(i) * 3], channelBuffer[(i * 3) + 1], channelBuffer[(i * 3) + 2]);
  }
 
  if (sendFrame) {
    leds.show();
    memset(universesReceived, 0, maxUniverses);
  }
}

void initTest()
{
  for (int i = 0 ; i < ledsPerStrip * numStrips ; i++)
    leds.setPixel(i, 127, 0, 0);
  leds.show();
  delay(200);
  for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
    leds.setPixel(i, 0, 127, 0);
  leds.show();
  delay(200);
  for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
    leds.setPixel(i, 0, 0, 127);
  leds.show();
  delay(200);
  for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
    leds.setPixel(i, 0, 0, 0);
  leds.show();
}


Thank you all!
(Sorry for my not fluent English, I'm working on it! 🫣)
 
Hi there!
I tested the same code with the new Teensy 4.0, and I have the same problem.
Anyone can help me please?
It's driving me crazy :(
 
Somehow the data which is send from Madrix and how it is receiced / interpreted in the Teensy does not match.
To understand your question:
Do you set numStrips to 4? With the 170pixels per strip you get 4 universes.
The artnet sender (Madrix) has to be configured to send exactly the desired number of pixels in the exactly desired way.
I remember that in some software you can map the color bytes to use the last two bytes of one universe. In this code it is expected that the last two bytes are not used and all universes start the same. I don't know if one of these decision is somehow a defined standard for artnet or not. But that can cause problems if this is done in other ways on the sender and receiver side.
 
Back
Top