Forum Rule: Always post complete source code & details to reproduce any issue!
Page 19 of 19 FirstFirst ... 9 17 18 19
Results 451 to 472 of 472

Thread: Artnet to OctoWS2811?

  1. #451
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,866
    Quote Originally Posted by devicer View Post
    seems counter intuitive that I can send more packets succesfully when slower!
    Just a blind guess, but maybe the faster speed is causing packet loss?

  2. #452
    So, updating teensyduino seemed to fix the number artnet over 4 universes, which is cool. Then someone mentioned that fastLED can use the octo library but give you improved frame rates, so I've tried to get artnet to work with that.
    I'm having an issue, that is confusing me however when I try and call
    // this will be called for each packet received
    artnet.setArtDmxCallback(onDmxFrame);
    in the void setup() I get
    ParallelOutputDemo:48: error: 'onDmxFrame' was not declared in this scope
    artnet.setArtDmxCallback(onDmxFrame);
    (Im trying Parallel to see if it was any different to the octoWS example, but the error is the same.)
    I don't understand why the error appears, I'm not a proficient coder, so as much as anything, I'd just like to know why it fails to see the routine
    It also fails to see the init routine if try and use that too...
    I've tried to work around it by doing all the code in the loop, but that got me into deeper water where I ran out of RAM, I guess I've incorrectly created the data buffer and had it run away.
    I almost thought I had worked out how the artnet code worked, but no, Im still a fool!



    Code:
    #include<FastLED.h>
    #include <Artnet.h>
    #include <Ethernet.h>
    #include <EthernetUdp.h>
    #include <SPI.h>
    #include <OctoWS2811.h>
    
    #define NUM_LEDS_PER_STRIP 170
    // Note: this can be 12 if you're using a teensy 3 and don't mind soldering the pads on the back
    #define NUM_STRIPS 8
    
    CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
    
    // Pin layouts on the teensy 3/3.1:
    // WS2811_PORTD: 2,14,7,8,6,20,21,5
    // WS2811_PORTC: 15,22,23,9,10,13,11,12,28,27,29,30 (these last 4 are pads on the bottom of the teensy)
    // WS2811_PORTDC: 2,14,7,8,6,20,21,5,15,22,23,9,10,13,11,12 - 16 way parallel
    //
    // Pin layouts on the due
    // WS2811_PORTA: 69,68,61,60,59,100,58,31 (note: pin 100 only available on the digix)
    // WS2811_PORTB: 90,91,92,93,94,95,96,97 (note: only available on the digix)
    // WS2811_PORTD: 25,26,27,28,14,15,29,11
    //
    // Artnet settings
    Artnet artnet;
    const int startUniverse = 0; // CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as zero.
    const int numberOfChannels = NUM_LEDS_PER_STRIP * NUM_STRIPS * 3; // Total number of channels you want to receive (1 led = 3 channels)
    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[] = {192, 168, 0, 4};
    byte mac[] = {0x04, 0xE9, 0xE5, 0x02, 0x69, 0xEC};
    
    
    void setup() {
      // LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
      // LEDS.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
       LEDS.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP).setCorrection(TypicalLEDStrip);
      //LEDS.addLeds<WS2811_PORTDC,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
      LEDS.setBrightness(32);
      artnet.begin(mac, ip);
        // this will be called for each packet received
      artnet.setArtDmxCallback(onDmxFrame);
    }
    
    void loop() {
      artnet.read();
    
    }
    
    void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data)
    {
      sendFrame = 1;
    //Serial.println(universe);
    //Serial.println(byte(data[1]));
    
      // 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)
        {
      //    Serial.println("Broke");
      
          sendFrame = 1;
          break;
        }
      }
    
      // read universe and put into the right part of the display buffer
      for (int i = 0 ; i < length ; i++)
      {
      //  Serial.println("Insert");
        int bufferIndex = i + ((universe - startUniverse) * length);
        if (bufferIndex < numberOfChannels) // to verify
          channelBuffer[bufferIndex] = byte(data[i]);
      }     
    
         for(int i = 0; i < NUM_STRIPS; i++) 
        {
        for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {
    
         leds[(i*NUM_LEDS_PER_STRIP) + j].setRGB(  channelBuffer[(i*NUM_LEDS_PER_STRIP) + j], channelBuffer[(i*NUM_LEDS_PER_STRIP) + j + 1], channelBuffer[(i*NUM_LEDS_PER_STRIP) + j + 2]);
        }
        }
    
    
      LEDS.show();
      LEDS.delay(10);
    
    }
    Last edited by cat; 04-02-2016 at 11:37 AM. Reason: bad english

  3. #453
    Ok, it seems that as soon as I add #include <FastLED.h> to the octows from the library, I get 'initTest' was not declared in this scope, so its something more fundemental than I have a hope a finding, should this got to the fasLED pages?

  4. #454
    So heres a working 4 universe FastLED/OctoWS sketch.
    Not sure why I'm back to only 4 universes...
    Going to check on colour performance later when it gets dark


    Code:
    #define USE_OCTOWS2811
    #include<OctoWS2811.h>
    #include<FastLED.h>
    #include <Artnet.h>
    #include <Ethernet.h>
    #include <EthernetUdp.h>
    #include <SPI.h>
    
    
    #define NUM_LEDS_PER_STRIP 170
    #define NUM_STRIPS 4
    
    
    CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
    
    // Pin layouts on the teensy 3:
    // OctoWS2811: 2,14,7,8,6,20,21,5
    
    // Artnet settings
    
    Artnet artnet;
    const int startUniverse = 0; // CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as zero.
    const int numberOfChannels = NUM_LEDS_PER_STRIP * NUM_STRIPS * 3; // Total number of channels you want to receive (1 led = 3 channels)
    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[] = {192, 168, 0,3};
    byte mac[] = {0x04, 0xE9, 0xE9, 0x09, 0x69, 0xEC};
    //------------------------------------------------------------------------------------------
    void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data)
    {
      sendFrame = 1;
      // Store which universe has got in
      if (universe < maxUniverses)
        universesReceived[universe] = 1;
    
      for (int i = 0 ; i < maxUniverses ; i++)
      {
        if (universesReceived[i] == 0)
        {
          //Serial.println("Broke");
          sendFrame = 0;
          break;
        }
      }
    
      // read universe and put into the right part of the display buffer
      for (int i = 0 ; i < length ; i++)
      {
        int bufferIndex = i + ((universe - startUniverse) * length);
        if (bufferIndex < numberOfChannels) // to verify
          channelBuffer[bufferIndex] = byte(data[i]);
      }      
    
      // send to leds
      for (int i = 0; i < NUM_LEDS_PER_STRIP * NUM_STRIPS; i++)
      {
        leds[i].setRGB(channelBuffer[(i) * 3], channelBuffer[(i * 3) + 1], channelBuffer[(i * 3) + 2]);
      }      
      
      if (sendFrame)
      {
      LEDS.show();
      LEDS.delay(10);
        // Reset universeReceived to 0
        memset(universesReceived, 0, maxUniverses);
      }
    }
    //------------------------------------------------------------------------------------------------------------
    void setup() 
    {
      LEDS.addLeds<OCTOWS2811>(leds, NUM_LEDS_PER_STRIP);
    //  LEDS.setBrightness(64);
      artnet.begin(mac, ip);
    Serial.begin(115200);
      // this will be called for each packet received
      artnet.setArtDmxCallback(onDmxFrame);
    }
    //------------------------------------------------------------------------------------------------------------
    void loop() 
    {
      artnet.read();
    }

  5. #455
    Junior Member
    Join Date
    Sep 2013
    Posts
    13
    i did a small edit to the code. I couldn't send on another start universe than 0. Now i can chose. If i control the leds with my software i send the universes randomly, this code can handle it.

    Code:
    /*
      This example will receive multiple universes via Artnet and control a strip of ws2811 leds via
      Paul Stoffregen's excellent OctoWS2811 library: https://www.pjrc.com/teensy/td_libs_OctoWS2811.html
      This example may be copied under the terms of the MIT license, see the LICENSE file for details
    */
    #include <Artnet.h>
    #include <Ethernet.h>
    #include <EthernetUdp.h>
    #include <SPI.h>
    #include <OctoWS2811.h>
    // OctoWS2811 settings
    const int ledsPerStrip = 22; // change for your setup
    const byte numStrips = 8; // change for your setup
    const int numLeds = ledsPerStrip * numStrips;
    const int numberOfChannels = numLeds * 3; // Total number of channels you want to receive (1 led = 3 channels)
    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 = 40; // 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;
    // Change ip and mac address for your setup
    byte ip[] = {2, 0, 0, 200};
    byte mac[] = {0x04, 0xE9, 0xE5, 0x00, 0x69, 0xEC};
    void setup() {
      //Serial.begin(115200);
      artnet.begin(mac, ip);
      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();
    }
    void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data) {
      sendFrame = 1;
      // Store which universe has got in
      if (universe >= startUniverse && universe < startUniverse + maxUniverses ) {
         // 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.setPixel(led, data[i * 3], data[i * 3 + 1], data[i * 3 + 2]);
        }
        previousDataLength = length;
        if (sendFrame) {
          leds.show();
        }
      }
    }

  6. #456
    Junior Member
    Join Date
    May 2016
    Posts
    12

    LED's shifted by 2 on second universe?

    I thought I was chasing a lag/sync issue, but maybe it's just a math thing. I have a 13x22 array, split into two universes. Top one snake-line from top-left (pin2). Second one snake-line from top right (pin14). Second universe seems to be off by 1 (or two, depending on how you look at it) channel? If I start the second universe with channel 0 being the first addressed, the the first led only shows 2 of 3 colors, the second led showing the "missing" color that should have been on that first LED. And this goes on down the line.

    HOWEVER -- if I shift the start of the second universe to 1 instead of 0, the second LED shows the correct color without the spread of colors to the two LEDS on either side -- problem is that the second universe is off by one pixel then ... and again on down the line.

    I'm using a sketch that Cat posted earlier... Thoughts?

    Click image for larger version. 

Name:	IMG_2100.jpg 
Views:	217 
Size:	93.9 KB 
ID:	7190

    Code:
    #define USE_OCTOWS2811
    #include<OctoWS2811.h>
    #include<FastLED.h>
    #include <Artnet.h>
    #include <Ethernet.h>
    #include <EthernetUdp.h>
    #include <SPI.h>
    
    
    #define NUM_LEDS_PER_STRIP 170
    #define NUM_STRIPS 2
    
    
    CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
    
    // Pin layouts on the teensy 3:
    // OctoWS2811: 2,14,7,8,6,20,21,5
    
    // Artnet settings
    
    Artnet artnet;
    const int startUniverse = 0; // CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as zero.
    const int numberOfChannels = NUM_LEDS_PER_STRIP * NUM_STRIPS * 3; // Total number of channels you want to receive (1 led = 3 channels)
    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[] = {192, 168, 1,231};
    byte mac[] = {0x04, 0xE9, 0xE5, 0x02, 0x9D, 0x17};
    //------------------------------------------------------------------------------------------
    void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data)
    {
      sendFrame = 1;
      // Store which universe has got in
      if (universe < maxUniverses)
        universesReceived[universe] = 1;
    
      for (int i = 0 ; i < maxUniverses ; i++)
      {
        if (universesReceived[i] == 0)
        {
          //Serial.println("Broke");
          sendFrame = 0;
          break;
        }
      }
    
      // read universe and put into the right part of the display buffer
      for (int i = 0 ; i < length ; i++)
      {
        int bufferIndex = i + ((universe - startUniverse) * length);
        if (bufferIndex < numberOfChannels) // to verify
          channelBuffer[bufferIndex] = byte(data[i]);
      }      
    
      // send to leds
      for (int i = 0; i < NUM_LEDS_PER_STRIP * NUM_STRIPS; i++)
      {
        leds[i].setRGB(channelBuffer[(i) * 3], channelBuffer[(i * 3) + 1], channelBuffer[(i * 3) + 2]);
      }      
      
      if (sendFrame)
      {
      LEDS.show();
      LEDS.delay(10);
        // Reset universeReceived to 0
        memset(universesReceived, 0, maxUniverses);
      }
    }
    //------------------------------------------------------------------------------------------------------------
    void setup() 
    {
      LEDS.addLeds<OCTOWS2811>(leds, NUM_LEDS_PER_STRIP);
    //  LEDS.setBrightness(64);
      artnet.begin(mac, ip);
    Serial.begin(115200);
      // this will be called for each packet received
      artnet.setArtDmxCallback(onDmxFrame);
    }
    //------------------------------------------------------------------------------------------------------------
    void loop() 
    {
      artnet.read();
    }
    Last edited by chopperpix; 05-17-2016 at 05:36 PM.

  7. #457
    Junior Member
    Join Date
    May 2016
    Posts
    12
    Ok --- tried a hardware hack since I suck at software. I physically added one pixel to the start of the second universe chain, and changed the patch to be 1 instead of 0. Works perfect now. So apparently there IS something in the code that offset by 2 channels! I COULD just leave it like it is but if someone knows where in the code the problem is, I'd be happy to eliminate this "dead" pixel hanging off then end!

  8. #458
    Senior Member
    Join Date
    Jan 2013
    Posts
    184
    chopperpix, I don't fully understand your description of what you are doing. I think it is the terminology you are using plus when you say "changed the patch to be 1 instead of 0" it's not clear to me if you mean channels or pixels. Let my try to help by stating a few basic things:

    1 DMX (and ArtNet) universe has up to 512 channels (channels 0 - 511)
    1 RGB Pixel uses 3 DMX channels. Not applicable here, but if you were using RGBW pixels they would likely use 4 DMX channels for each pixel.

    Therefor, you can drive up to 177 pixels per universe with 2 channels left over (there's the number 2 that might be a clue). If you start with U0 Ch0, the last pixel will be on U0 Ch507, U0 Ch508, U0 Ch509. Channels 510 and 511 are leftover.

    The 178th pixel could begin at U0 Ch510 and use channels U0 Ch510, U0 Ch511, U1 Ch0 and continue from there. You could also start the 178th pixel at U1 Ch0 and continue from there.

    I suspect the issue is that you don't have your patch configured exactly right and that the "off-by-two" issue is related to the 2 extra channels in universe 0. Your sketch looks ok.

    You've not shown us your patch so I cannot be sure. Please tell or show us exactly how the patch is configure.

    Update: From studying your sketch in more depth, I'm pretty sure the 178th pixel is using data from the channel buffer which corresponds to U0 Ch510, U0 Ch511, U1 Ch0. Note that your DMX controller doesn't necessarily have to send the full 512 channels of each universe (it's not guaranteed as part of the ArtNet spec.). My suggestion is, if your DMX controller patch allows it, start the 178th Pixel at U0 Ch510. Edit for clarity: Hopefully, your controller knows to use U0 Ch510, U0 Ch511, U1 Ch0, for the 178th Pixel.

    Finally to all readers, this is rather complicated, so I might have gotten something wrong. Please correct me.
    Last edited by markonian; 05-17-2016 at 09:52 PM.

  9. #459
    Senior Member
    Join Date
    Jan 2013
    Posts
    184
    Click image for larger version. 

Name:	pixel buffer.png 
Views:	201 
Size:	11.0 KB 
ID:	7192

    chopperpix: I can't seem to leave this alone. The above diagram depicts what underlies the current issue. I hope this help us to visualize what's going on. Note that universe 1 does not start on a pixel boundary. Rather, it starts on the 3rd channel of pixel 177.

    So the answer might be: Get your controller to send the data in a way that matches what your sketch will do. But there are other solutions as well. Btw, what controller (software?) are you using?

    You also might find Wireshark useful to make it easy to see exactly what is being sent by the controller.
    Last edited by markonian; 05-17-2016 at 10:47 PM. Reason: added that there are other solutions too

  10. #460
    Junior Member
    Join Date
    May 2016
    Posts
    12
    See comments below:

    Quote Originally Posted by markonian View Post
    chopperpix, I don't fully understand your description of what you are doing. I think it is the terminology you are using plus when you say "changed the patch to be 1 instead of 0" it's not clear to me if you mean channels or pixels. Let my try to help by stating a few basic things: Yes, I mean channels. I started at channel 1 instead of 0.

    1 DMX (and ArtNet) universe has up to 512 channels (channels 0 - 511)
    1 RGB Pixel uses 3 DMX channels. Not applicable here, but if you were using RGBW pixels they would likely use 4 DMX channels for each pixel.

    Therefor, you can drive up to 177 pixels per universe with 2 channels left over (there's the number 2 that might be a clue). If you start with U0 Ch0, the last pixel will be on U0 Ch507, U0 Ch508, U0 Ch509. Channels 510 and 511 are leftover.

    The 178th pixel could begin at U0 Ch510 and use channels U0 Ch510, U0 Ch511, U1 Ch0 and continue from there. You could also start the 178th pixel at U1 Ch0 and continue from there.

    I suspect the issue is that you don't have your patch configured exactly right and that the "off-by-two" issue is related to the 2 extra channels in universe 0. Your sketch looks ok. Really? I thought it mattered not with OctoWS2811, just was memory inefficient.

    You've not shown us your patch so I cannot be sure. Please tell or show us exactly how the patch is configure.

    Update: From studying your sketch in more depth, I'm pretty sure the 178th pixel is using data from the channel buffer which corresponds to U0 Ch510, U0 Ch511, U1 Ch0. Note that your DMX controller doesn't necessarily have to send the full 512 channels of each universe (it's not guaranteed as part of the ArtNet spec.). My suggestion is, if your DMX controller patch allows it, start the 178th Pixel at U0 Ch510. Edit for clarity: Hopefully, your controller knows to use U0 Ch510, U0 Ch511, U1 Ch0, for the 178th Pixel. Again, if you only use lets say 30 pixels * 3 = 90 channels, you are saying that the LAST channel of U0 has to use up the last 3(or 4 depending on pixel) channels to properly map into U1?

    Finally to all readers, this is rather complicated, so I might have gotten something wrong. Please correct me.
    Last edited by chopperpix; 05-18-2016 at 02:20 AM.

  11. #461
    Junior Member
    Join Date
    May 2016
    Posts
    12
    Interesting .. Why would the pixel I added to the beginning of U0 be completely useless -- it does not light up at all -- and yet still cause the rest of the strip to be in correct sequence? Also, U0 only had 156 pixels on it. That's 468 channels - quite a way from the 512 ceiling for U0.

  12. #462
    Senior Member
    Join Date
    Jan 2013
    Posts
    184
    Quote Originally Posted by chopperpix View Post
    Interesting .. Why would the pixel I added to the beginning of U0 be completely useless -- it does not light up at all -- and yet still cause the rest of the strip to be in correct sequence? Also, U0 only had 156 pixels on it. That's 468 channels - quite a way from the 512 ceiling for U0.
    I think I need to understand what your patch in, I assume, your controller application is doing. What is your controller, btw? Is is an Application? Dedicated hardware? Please tell us the details. How is it configured for your LED matrix? Can you show us your patch settings?

    I'll also repeat my advice about using WireShark for seeing exactly what your controller is sending. That can go a long ways toward understanding what the issue is. If you think WireShark is too complicated, let me know so that I can try to convince you that it is not

  13. #463
    Junior Member
    Join Date
    Jan 2015
    Posts
    5
    Hey everyone,

    I have a question about some lines in the code:
    Code:
    // send to leds
      for (int i = 0; i < NUM_LEDS_PER_STRIP * NUM_STRIPS; i++)
      {
        leds[i].setRGB(channelBuffer[(i) * 3], channelBuffer[(i * 3) + 1], channelBuffer[(i * 3) + 2]);
      }
    In another code snippet, there will be added a channel offset at this point (which I need for my application..)

    See:

    Code:
    // send to leds
    for (int i = 0; i < ledsPerStrip * numStrips; i++)
    {
    leds.setPixel(i, channelBuffer[(i) * 3 + channelOffset], channelBuffer[(i * 3) + 1 + channelOffset], channelBuffer[(i * 3) + 2 + channelOffset]);
    }

    My question:

    Can someone explain this? Because I think at this point of the code, the color values will be set, like some lines below:


    Code:
    void initTest()
    {
    for (int i = 0 ; i < ledsPerStrip * numStrips ; i++)
    leds.setPixel(i, 127, 0, 0);
    leds.show();
    delay(500);
    Now, how does the offset works at this point?

  14. #464
    Junior Member
    Join Date
    Jan 2015
    Posts
    5
    Quote Originally Posted by markonian View Post
    Click image for larger version. 

Name:	pixel buffer.png 
Views:	201 
Size:	11.0 KB 
ID:	7192
    Btw: 511 / 3 = 170 LEDs with 2 unused DMX Channels. So the 171 LED is at U0 C510, U0 C511, U1 C000

    That's exactly my problem. How can I configure the teensy to start the 171 LED at U1 C0?
    Is there anyway to code a offset of 2channels for each universe?

    EDIT: Can someone review my code pls? Maybe thats the way to go?
    Code:
    // send to leds
        /*
         * Added an offset for each universe (e.g. 2 Channels at the end of U0, than 4 Channels at the end of U1.... etc..)
         *
         * */
        int i_universum = 0; // Index for the current universe 
        int tmp_channelOffset = 0; // the amount of the temporary channeloffset..
        for (int i = 0; i < ledsPerStrip * numStrips; i++) {
            if ((i % ledsPerStrip) == 0) {
                if (i == 0) {
                    tmp_channelOffset = 0;
                } else {
                    ++i_universum;
                    tmp_channelOffset = channelOffset * i_universum;
                }
            }
            leds.setPixel(i, channelBuffer[(i) * 3 + tmp_channelOffset], channelBuffer[(i * 3) + 1 + tmp_channelOffset],
                          channelBuffer[(i * 3) + 2 + tmp_channelOffset]);
        }
    Last edited by Immug; 09-17-2016 at 03:22 PM.

  15. #465
    Quote Originally Posted by mortonkopf View Post
    TheDoctorB, you are quite right, and this was mentioned on page16 message #374 to #376 of this artnet thread. I hope that any further dev of the artnet lib should take this into account.
    Recalling this old (but great) thread because I'm working on an artnet project now.
    seems everything works fine here with chamsys outputting multicast at 2.255.255.255 and teensy set at 2.0.0.x with 255.0.0.0 netmask.
    The only difference in my code is the artnet.begin routine, I'm using artnet.begin() and initializing the ethernet communication before in the code, using the "full" init available in the Ethernet library:

    Code:
    Ethernet.begin(mac, ip, dns, gateway, subnet);
    I hope this is helpful for people who want to use teensy with the 2.x.x.x range.
    Unfortunately artnet is a horrible protocol which uses broadcasts / multicast messages when not really needed. The unicast implementation is still not used much on stages...

  16. #466
    Junior Member
    Join Date
    Jul 2017
    Posts
    1
    Quote Originally Posted by lorenzofattori View Post
    Recalling this old (but great) thread because I'm working on an artnet project now.
    seems everything works fine here with chamsys outputting multicast at 2.255.255.255 and teensy set at 2.0.0.x with 255.0.0.0 netmask.
    The only difference in my code is the artnet.begin routine, I'm using artnet.begin() and initializing the ethernet communication before in the code, using the "full" init available in the Ethernet library:

    Code:
    Ethernet.begin(mac, ip, dns, gateway, subnet);
    I hope this is helpful for people who want to use teensy with the 2.x.x.x range.
    Unfortunately artnet is a horrible protocol which uses broadcasts / multicast messages when not really needed. The unicast implementation is still not used much on stages...
    So are you able to get more than 4 universes talking at a reasonable speed? My implementation seems to work up to about 3-ish before the LED outputs of the teensy start spazzing out...

  17. #467
    Member
    Join Date
    Jul 2016
    Location
    Denmark
    Posts
    26
    As per the Art-Net spesification art-net.pdf you can only have 4 universes for every node. if you are using multicast and only have one receiver you don't need to worry about this limit. I am currently able to output 18 universes at about 60fps, but only because i am using a modified version of the ethernet library, https://github.com/alex-Arc/Ethernet/tree/1-socket and i'm running the t_3.2 at 120MHz. I have used it in production for over a year now and it's quite stable.

    For unicast implementation i use madmapper and they support artnet4 witch allows multiple nodes on the same ip offset by the new "bind index" circumventing the 4 univers limit and remaning backward compatible, quite handy

  18. #468
    Quote Originally Posted by Peet View Post
    So are you able to get more than 4 universes talking at a reasonable speed? My implementation seems to work up to about 3-ish before the LED outputs of the teensy start spazzing out...
    Nope, I'm using only one universe for my project (no led driving), but somebody said it was not working with 2.x.x.x range, but it is.

  19. #469
    Hi All,

    Can anyone please give me a rather detailed description or perfectly working code to get 10 universes up and running quickly? I have a friend working on it now but we are only up to 6 working universes and if I can help him in anyway I'd like to as at the moment I pretty much just watch cause I know nothing about coding haha.

    I am running a teensy 3.2 + octo adapter + w5200 Ethernet module running 1,600 LEDs and using Jinx to send data to the matrix.

    I really just need 10 working universes asap if anyone out there has the files/code ready to go.

    Cheers!
    Andrew Gardner

  20. #470
    Senior Member crees's Avatar
    Join Date
    Dec 2016
    Location
    Utah
    Posts
    215
    Quote Originally Posted by andrewgardner View Post
    Hi All,

    Can anyone please give me a rather detailed description or perfectly working code to get 10 universes up and running quickly? I have a friend working on it now but we are only up to 6 working universes and if I can help him in anyway I'd like to as at the moment I pretty much just watch cause I know nothing about coding haha.

    I am running a teensy 3.2 + octo adapter + w5200 Ethernet module running 1,600 LEDs and using Jinx to send data to the matrix.

    I really just need 10 working universes asap if anyone out there has the files/code ready to go.

    Cheers!
    Andrew Gardner
    I am that friend - Here is the link to a new thread on it. The code is for sACN e1.31.

    https://forum.pjrc.com/threads/45760...625#post150625

  21. #471
    My problem is the next:
    I need 1 Teensy 3.6 to get 4 DMX universes of 1 ARTNET IP and that each universe reads 50 pixels per PIN.
    For example:
    PIN 02: Universe 1 - Pixel from 01 to 50
    PIN 03: Universe 1 - Pixel from 51 to 100
    PIN 04: Universe 1 - Pixel from 101 to 150
    PIN 05: Universe 2 - Pixel 01 to 50
    PIN 06: Universe 2 - Pixel 51 to 100
    ...

    I tried with your code with the OCTOWS2811 and only output the 170 pixels in 1 PIN only, but I can not get it to divide into groups of 50 pixels on 3 consecutive pins and I can program in the code which is the first PIXEL for each departure .
    I would like to do it directly on the Teensy pins instead of using the OCTO WS2811, as it only gets 4 led strips per OCTO.

    In Arduino MEGA I could do it with the "Artnet_Node" library from 1 universe, address 3 PMW outputs and start at an "x" pixel. I can not get more than 1 universe.

    I am using MADRIX with 4 Universes enabled by each IP.


    I thank you if you can help me with this.

    Atte
    Last edited by Frank Gaiara; 08-11-2017 at 01:14 PM.

  22. #472
    Quote Originally Posted by crees View Post
    I am that friend - Here is the link to a new thread on it. The code is for sACN e1.31.

    https://forum.pjrc.com/threads/45760...625#post150625
    This is gold mate! haha I was wondering if you would ever stumble past this post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •