Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 33 of 33

Thread: Teensey 3.6 + OctoWS2811 + 50+ WS2812b strips behind wall

  1. #26
    Senior Member crees's Avatar
    Join Date
    Dec 2016
    Location
    Utah
    Posts
    138
    Quote Originally Posted by RyanLED View Post
    Hey Creese.. I saw this post and am in midst of reading through it..
    https://forum.pjrc.com/threads/45760...light=ethernet

    I also see the Video above and am intrigued with how things work.. Are the boards able to accept the Teensey 3.6?

    thanks!
    They should but I have not tested this yet. I noticed you sent me a PM but my inbox was full. Can you send it again?

  2. #27
    So as I'm starting to hook things back up.. Im wondering about these three 1000 ĶF capacitor's I'm putting on as I saw on your (Ghost Toast) and per the AF mans. I'm just looking at it going.. there could be a short if someone ever touched this and bent the capacitor so my question is (before I figure a better way to prevent shorts..)

    do I need one hitting each of the three or is one enough seeing as it's all the same powersupply just across one + and -. You'd think these PSU's would have this already inside the PSU. But just wondering

    thanks!

  3. #28
    Small little success's are all that matter.


    https://ibb.co/bs36DdH



    Finally hooked up the Octo2811 completely with all 8 pairs.. I have

    5x144
    1x60
    2x14 (round)

    which is 808 Pixels.. just running the basic Glediator test.. Next will be to see how many pixels I can hook up to one pair and get decent response times. Once I figure that out then I'll decide either to go big (144 strips) or stay small (60)..

  4. #29
    Little bit of an update... I've been able to do

    Code:
    const int ledsPerStrip = 864;
    const int NUM_LEDS = 6912;
    inside the octo gled sketch and 144x48 inside the Glediator matrix options.. and opened.. the program says I'm getting about 10-20fps.. and when playing with the options it looks and responds quickly which is really all I'm looking for so I think this is going to work out lovely. now the next step is to see about buying the leds & PSU's to actually push forward. But before I do that.. I ordered me a wiz850io to look at how artnet will work. As I'd rather this all be done over network not USB for future use.

    I also need to find a power connector that will allow modular connections.. soldering is not something I want to do over 200x ;p

    But for now I'm happy with the progress.. It looks good on paper.. will it work with all leds hooked up is the question!

    all for now!

  5. #30
    wiz850io has arrived.. I've been able to wire it in.. Get a ping using the basic example on the

    Code:
    // Receive multiple universes via Artnet and control a strip of ws2811 leds via OctoWS2811
    //
    // This example may be copied under the terms of the MIT license, see the LICENSE file for details
    //  https://github.com/natcl/Artnet
    // 
    // http://forum.pjrc.com/threads/24688-Artnet-to-OctoWS2811?p=55589&viewfull=1#post55589
    
    #include <Artnet.h>
    #include <Ethernet.h>
    #include <EthernetUdp.h>
    #include <SPI.h>
    #include <OctoWS2811.h>
    
    // Ideas for improving performance with WIZ820io / WIZ850io Ethernet:
    // https://forum.pjrc.com/threads/45760-E1-31-sACN-Ethernet-DMX-Performance-help-6-Universe-Limit-improvements
    
    // OctoWS2811 settings
    const int ledsPerStrip = 492; // change for your setup
    const byte numStrips= 1; // change for your setup
    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; // CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as zero.
    const int numberOfChannels = ledsPerStrip * numStrips * 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[] = {10, 0 , 0, 77};
    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 < 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 < ledsPerStrip * numStrips; i++)
      {
        leds.setPixel(i, channelBuffer[(i) * 3], channelBuffer[(i * 3) + 1], channelBuffer[(i * 3) + 2]);
      }      
      
      if (sendFrame)
      {
        leds.show();
        // Reset universeReceived to 0
        memset(universesReceived, 0, maxUniverses);
      }
    }
    
    void initTest()
    {
      for (int i = 0 ; i < ledsPerStrip * numStrips ; i++)
        leds.setPixel(i, 127, 0, 0);
      leds.show();
      delay(500);
      for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
        leds.setPixel(i, 0, 127, 0);
      leds.show();
      delay(500);
      for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
        leds.setPixel(i, 0, 0, 127);
      leds.show();
      delay(500);
      for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
        leds.setPixel(i, 0, 0, 0);
      leds.show();
    }
    Example dropdown from OCTO2811 but other than that I have no idea where I'm going next ;p I tried to play with glediator / jinx to see if I could easily add it but nope. This weekend will be some researching on how to do this.. If anyone has any handy links that help guide me in the right direction.. that'd be great.. otherwise I'll report back what I've come up with.

    All for now!

  6. #31
    Trying to get this setup to work on Artnet.. so I figured I'd start as simple as possible. So edited inside the code to use this

    Code:
    // Receive multiple universes via Artnet and control a strip of ws2811 leds via OctoWS2811
    //
    // This example may be copied under the terms of the MIT license, see the LICENSE file for details
    //  https://github.com/natcl/Artnet
    // 
    // http://forum.pjrc.com/threads/24688-Artnet-to-OctoWS2811?p=55589&viewfull=1#post55589
    
    #include <Artnet.h>
    #include <Ethernet.h>
    #include <EthernetUdp.h>
    #include <SPI.h>
    #include <OctoWS2811.h>
    
    // Ideas for improving performance with WIZ820io / WIZ850io Ethernet:
    // https://forum.pjrc.com/threads/45760-E1-31-sACN-Ethernet-DMX-Performance-help-6-Universe-Limit-improvements
    
    // OctoWS2811 settings
    const int ledsPerStrip = 144; // change for your setup
    const byte numStrips= 8; // change for your setup
    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; // CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as zero.
    const int numberOfChannels = ledsPerStrip * numStrips * 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[] = {10, 0, 0, 77};
    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 < 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 < ledsPerStrip * numStrips; i++)
      {
        leds.setPixel(i, channelBuffer[(i) * 3], channelBuffer[(i * 3) + 1], channelBuffer[(i * 3) + 2]);
      }      
      
      if (sendFrame)
      {
        leds.show();
        // Reset universeReceived to 0
        memset(universesReceived, 0, maxUniverses);
      }
    }
    
    void initTest()
    {
      for (int i = 0 ; i < ledsPerStrip * numStrips ; i++)
        leds.setPixel(i, 127, 0, 0);
      leds.show();
      delay(500);
      for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
        leds.setPixel(i, 0, 127, 0);
      leds.show();
      delay(500);
      for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
        leds.setPixel(i, 0, 0, 127);
      leds.show();
      delay(500);
      for (int i = 0 ; i < ledsPerStrip * numStrips  ; i++)
        leds.setPixel(i, 0, 0, 0);
      leds.show();
    }
    which is my 144 led strips 8 strips and the ip of 10.0.0.77

    Opened up Jinx and set up all of the 7 universes (edited from before when I did just 2.. )

    Set the matrix to the size





    Then did the fast patch. I figured out how it was doing this.. going only to 170pixels since that's the 512 size. so this is what that looked like now





    Clicked start output and nothing. I changed to solid color and the other effects that used to work with just Serial / Geldiator.. I fiddled around another sketch and got the leds to flicker but nothing worth posting.. I was able to do the serial print to see that it's getting the data aok just not sure where to go from there. googling around for now.. any help would be great.. otherwise I'll report back if I find anything
    Last edited by RyanLED; 01-21-2019 at 09:49 PM.

  7. #32
    Found this post from you crees https://forum.pjrc.com/threads/45760...l=1#post152091

    And after changing to sACN and patching 1 uni quickly.. started output. it worked. So going to try the other 7 and go from there... then figure out what it all means

  8. #33
    Making progress! So I was able to get three Uni's working.. But 4-7 refuse to light up.

    Code:
    // E1.31 Receiver code base by Andrew Huxtable (andrew@hux.net.au).Adapted and modified by
    // ccr (megapixel.lighting).
    //
    // This code may be freely distributed and used as you see fit for non-profit
    // purposes and as long as the original author is credited and it remains open
    // source
    //
    // Please configure your Lighting product to use Unicast to the IP the device is given from your DHCP server
    // Multicast is not currently supported due to bandwidth/processor limitations
    
    
    // You will need the Ethercard and FastLed Libraries from:
    // https://github.com/FastLED/FastLED/releases
    //
    // The Atmega328 only has 2k of SRAM.  This is a severe limitation to being able to control large
    // numbers of smart pixels due to the pixel data needing to be stored in an array as well as
    // a reserved buffer for receiving Ethernet packets.  This code will allow you to use a maximum of 240 pixels
    // as that just about maxes out the SRAM on the Atmega328.
    
    
    // There is deliberately no serial based reporting from the code to conserve SRAM.  There is a **little**
    // bit available if you need to add some in for debugging but keep it to an absolute minimum for debugging
    // only.
    
    
    #include <SPI.h>
    #include <Ethernet.h>
    #include <EthernetUdp.h>
    #define USE_OCTOWS2811
    #include<OctoWS2811.h>
    #include<FastLED.h>
    
    
    //*********************************************************************************
    
    
    // enter desired universe and subnet  (sACN first universe is 1)
    #define DMX_SUBNET 0
    #define DMX_UNIVERSE 1 //**Start** universe
    
    
    // Set a different MAC address for each...
    byte mac[] = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x15 };
    
    
    // Uncomment if you want to use static IP
    //*******************************************************
    // ethernet interface ip address
    IPAddress ip(10, 0, 0, 77);  //IP address of ethernet shield
    //*******************************************************
    
    
    EthernetUDP Udp;
    
    
    // By sacrificing some of the Ethernet receive buffer, we can allocate more to the LED array
    // but this is **technically** slower because 2 packets must be processed for all 240 pixels.
    
    
    /// DONT CHANGE unless you know the consequences...
     #define ETHERNET_BUFFER 636 //540
     #define CHANNEL_COUNT 3456 //because it divides by 3 nicely
     #define NUM_LEDS 1152 // can not go higher than this - Runs out of SRAM
     #define NUM_LEDS_PER_STRIP 144
     #define NUM_STRIPS 8
     #define UNIVERSE_COUNT 7
     #define LEDS_PER_UNIVERSE 170
     //#define BRIGHTNESS 100
    
    
    
    
    
    //********************************************************************************
    
    
    // Define the array of leds
    CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
    
    // Pin layouts on the teensy 3:
    // OctoWS2811: 2,14,7,8,6,20,21,5
    
    
    unsigned char packetBuffer[ETHERNET_BUFFER];
    int c = 0;
    float fps = 0;
    unsigned long currentMillis = 0;
    unsigned long previousMillis = 0;
    
    void setup() {
    
        pinMode(9, OUTPUT);
      digitalWrite(9, LOW);   // reset the WIZ820io
      delay(10);
       digitalWrite(9, HIGH);   // reset the WIZ820io
      //pinMode(10, OUTPUT);
     // digitalWrite(10, HIGH);  // de-select WIZ820io
      //pinMode(4, OUTPUT);
      //digitalWrite(4, HIGH);   // de-select the SD Card
        Serial.begin(115200);
        delay(10);
      // Using different LEDs or colour order? Change here...
      // ********************************************************
      LEDS.addLeds<OCTOWS2811>(leds, NUM_LEDS_PER_STRIP);
      LEDS.setBrightness(32);
      // ********************************************************
      // ********************************************************   
      Ethernet.begin(mac,ip);
      Udp.begin(5568);
      // ******************************************************** 
    
        Serial.print("server is at ");
        Serial.println(Ethernet.localIP());
    
      //Once the Ethernet is initialised, run a test on the LEDs
      initTest();
    }
    
    void sacnDMXReceived(unsigned char* pbuff, int count, int unicount) {
      if (count > CHANNEL_COUNT) count = CHANNEL_COUNT;
      byte b = pbuff[113]; //DMX Subnet
      if ( b == DMX_SUBNET) {
        b = pbuff[114];  //DMX Universe
        Serial.println(b );
        if ( b >= DMX_UNIVERSE && b <= DMX_UNIVERSE + UNIVERSE_COUNT ) {
        
          if ( pbuff[125] == 0 ) {  //start code must be 0
          int ledNumber = (b - DMX_UNIVERSE) * LEDS_PER_UNIVERSE;
           // sACN packets come in seperate RGB but we have to set each led's RGB value together
           // this 'reads ahead' for all 3 colours before moving to the next led.
           //Serial.println("*");
           for (int i = 126;i < 126+count;i = i + 3){
              byte charValueR = pbuff[i];
              byte charValueG = pbuff[i+1];
              byte charValueB = pbuff[i+2];
              leds[ledNumber] = CRGB(charValueR,charValueG,charValueB);
              //Serial.println(ledNumber);
              ledNumber++;
            }
            
            //Serial.println(unicount);
            if (unicount == 10){
            
            LEDS.show();
            }
          }
        }
      }
    }
    
    
    int checkACNHeaders(unsigned char* messagein, int messagelength) {
      //Do some VERY basic checks to see if it's an E1.31 packet.
      //Bytes 4 to 12 of an E1.31 Packet contain "ACN-E1.17"
      //Only checking for the A and the 7 in the right places as well as 0x10 as the header.
      //Technically this is outside of spec and could cause problems but its enough checks for us
      //to determine if the packet should be tossed or used.
      //This improves the speed of packet processing as well as reducing the memory overhead.
      //On an Isolated network this should never be a problem....
      if ( messagein[1] == 0x10 && messagein[4] == 0x41 && messagein[12] == 0x37) {   
          int addresscount = (byte) messagein[123] * 256 + (byte) messagein[124]; // number of values plus start code
          return addresscount -1; //Return how many values are in the packet.
        }
      return 0;
    }
    
    
    void initTest() //runs at board boot to make sure pixels are working
    {
      LEDS.showColor(CRGB(255, 0, 0)); //turn all pixels on red
       delay(1000);
       LEDS.showColor(CRGB(0, 255, 0)); //turn all pixels on green
       delay(1000);
       LEDS.showColor(CRGB(0, 0, 255)); //turn all pixels on blue
       delay(1000);
       LEDS.showColor(CRGB(0, 0, 0)); //turn all pixels off
    }
    
    void loop() {
       //Process packets
       int packetSize = Udp.parsePacket(); //Read UDP packet count
       if (c >= 10){
       
       c = 0;
       }
       if(packetSize){
        //Serial.println(packetSize);
        Udp.read(packetBuffer,ETHERNET_BUFFER); //read UDP packet
        
        
        int count = checkACNHeaders(packetBuffer, packetSize);
        if (count) {
          
         //Serial.print("packet size first ");
         //Serial.println(packetSize);
    
         c = c + 1;
        // calculate framerate
        currentMillis = millis();
        if(currentMillis > previousMillis){
          fps = 1 / ((currentMillis - previousMillis) * 0.001);
        } else {
          fps = 0;
        }
        previousMillis = currentMillis;
         if (fps > 10 && fps < 500)// don't show numbers below or over given ammount
         Serial.println(fps);
         sacnDMXReceived(packetBuffer, count, c); //process data function
        }  
      }
    }
    to troubleshoot I did Patch first part with Uni 1. tested that lit up. then did uni 4 over same part. Started and nothing lit up.

    when I had all of them in the PATCH (all 7) I uncommented the serial prints and see
    1
    2
    3
    25.00
    1
    2
    3
    25.64

    So it's not even getting uni4+. Wondering if this is a jinx issue? I also tried Glediator and nothing came of it.. Guessing because this ins't Artnet code..

    One other thing I noticed .. the Last Pixel of the Uni or the First pixel of the next uni flashed randomly. Even when I only had 1 Uni on the Path I got 3 random pixels at the end of where a uni would be.

    All for now.. will update more when I have some free time to fiddle with it

Posting Permissions

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