Only getting yellow startup lights

  • Hi everyone, hoping for a little help.


    I had everything working well when I tested it with 150 LEDs before mounting the strips to the TV. Mounted them on and ended up using 132 so the it want quite aligned.


    I changed the arduino sketch and the hypercon profile for 132 LEDs and now I only get the yellow startup snake. When I right click in hyperion I get the grabber image just fine, but no response from the LEDs. Tried tweaking just about every setting multiple times and can not figure it out.


    Any help would be appreciated. Let me know if there is any more information that could help. Rasp Pi 2, arduino uno, WS2812B LEDs (132 of them).


    Arduino Sketch:

    // LIBRARIES


    #include <Wire.h>
    //#include <LiquidCrystal_I2C.h>
    #include "Adafruit_NeoPixel.h"


    // DEFINITIONS


    #define STARTCOLOR 0xff8000 // LED color at startup 0xff8000 is orange in hex code. pick your own here: http://www.w3schools.com/colors/colors_picker.asp
    #define BLACK 0x000000 // LED color BLACK


    #define DATAPIN 10 // Datapin
    #define LEDCOUNT 132 // Number of LEDs used in your system
    #define SHOWDELAY 20 // Delay in micro seconds before showing
    #define BAUDRATE 500000 // Serial port speed


    #define BRIGHTNESS 100 // Max. brightness in %


    const char prefix[] = {0x41, 0x64, 0x61, 0x00, 0x93, 0xd6}; // Prefix at the start of the transmission
    char buffer[sizeof(prefix)]; // Temporary buffer for receiving the prefix data


    // to calculate your prefix, the first 4 bytes will never change: const char prefix[] = {0x41, 0x64, 0x61, 0x00, this never changes.
    // the next byte is equal to the number of LED - 1 --> (232-1)=231. 231 transformed in HEX. 231 in hex is E7 (use google)
    // the last byte is equal to the XOR value of the calculated value just above and 0x55 (byte just calculated (E7) XORED with 0x55) = B2 use this link http://xor.pw/? and in input 1 put 55 and in input 2 put your HEX value.


    // some precalculated values to save some time: 178 leds gives B1 and E4, 180 B3E6, 181 B4E1, 182 B5E0 232 E7B2 230 E5B0


    Adafruit_NeoPixel strip = Adafruit_NeoPixel(LEDCOUNT, DATAPIN, NEO_GRB + NEO_KHZ800);
    //LiquidCrystal_I2C lcd(0x20,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display


    int state; // Define current state
    #define STATE_WAITING 1 // - Waiting for prefix
    #define STATE_DO_PREFIX 2 // - Processing prefix
    #define STATE_DO_DATA 3 // - Handling incoming LED colors


    int readSerial; // Read Serial data (1)
    int currentLED; // Needed for assigning the color to the right LED
    const int led_button = 11; // ON/OFF button input
    const int status_led = 8; // LED of button
    const int ch_2 = A0; // Inputs from HDMI switcher
    const int ch_3 = A1;
    const int ch_4 = A2;
    const int ch_5 = A3;


    int curr_source = 0; // Used to store which source is currently displayed
    boolean strip_status = true; // Used to chose if the LED strip is ON or OFF (depending on button choice)
    unsigned long timeout = 0; // Timeout used to turn LED strip off if no new data has come thorugh after some time


    void setup()
    {
    pinMode(led_button, INPUT);
    pinMode(ch_2, INPUT);
    pinMode(ch_3, INPUT);
    pinMode(ch_4, INPUT);
    pinMode(ch_5, INPUT);
    pinMode(status_led, OUTPUT);
    digitalWrite(led_button, HIGH);
    digitalWrite(status_led, HIGH);


    delay (15000); // 15 seconds delay at startup to avoid strange behaviours as the PI boots up etc
    strip.begin(); // Init LED strand, set all black, then all to startcolor
    strip.setBrightness( (255 / 100) * 25 );
    setAllLEDs(BLACK, 0);
    setAllLEDs(STARTCOLOR, 10); // Will turn ON all LEDS with a 5ms delay between each turn ON creating a snake increasing pattern
    Serial.begin(BAUDRATE); // Init serial speed
    state = STATE_WAITING; // Initial state: Waiting for prefix
    //lcd.init(); // Initialize the lcd
    //lcd.backlight(); // Turn ON LCD backlight
    //lcd.print(" waiting for PI"); // Wait for PI to boot up for 5 sec (avoids the Arduino rebooting randomly)
    delay(5000);
    //lcd.clear();
    //lcd.print("**** SOURCE ****");
    strip.setBrightness( (255 / 100) * BRIGHTNESS ); // Set the brightness we chose above
    }



    void loop()
    {
    do_strip(); // Main part of the code where we look at the data incoming from the PI
    if (state == STATE_WAITING) // Only if we are in WAITING state we check the source inputs and our ON/OFF button.
    {
    check_source();
    check_button();
    }
    }


    void do_strip(void)
    {
    if (strip_status == true)
    {
    switch(state)
    {
    case STATE_WAITING: // *** Waiting for prefix ***
    if( Serial.available()>0 )
    {
    readSerial = Serial.read(); // Read one character

    if ( readSerial == prefix[0] ) // if this character is 1st prefix char
    { state = STATE_DO_PREFIX; } // then set state to handle prefix
    }
    break;


    case STATE_DO_PREFIX: // *** Processing Prefix ***
    timeout = millis();
    if( Serial.available() > sizeof(prefix) - 2 )
    {
    Serial.readBytes(buffer, sizeof(prefix) - 1);

    for( int Counter = 0; Counter < sizeof(prefix) - 1; Counter++)
    {
    if( buffer[Counter] == prefix[Counter+1] )
    {
    state = STATE_DO_DATA; // Received character is in prefix, continue
    currentLED = 0; // Set current LED to the first one
    }
    else
    {
    state = STATE_WAITING; // Crap, one of the received chars is NOT in the prefix
    break; // Exit, to go back to waiting for the prefix
    } // end if buffer
    } // end for Counter
    } // end if Serial
    break;


    case STATE_DO_DATA: // *** Process incoming color data ***
    if( Serial.available() > 2 ) // if we receive more than 2 chars
    {
    Serial.readBytes( buffer, 3 ); // Abuse buffer to temp store 3 charaters
    strip.setPixelColor( currentLED++, buffer[0], buffer[1], buffer[2]); // and assing to LEDs
    }
    if( currentLED > LEDCOUNT ) // Reached the last LED? Display it!
    {
    strip.show(); // Make colors visible
    delayMicroseconds(SHOWDELAY); // Wait a few micro seconds

    state = STATE_WAITING; // Reset to waiting ...
    currentLED = 0; // and go to LED one

    break; // and exit ... and do it all over again
    }
    break;
    } // switch(state)
    } // if statement
    else
    {setAllLEDs(BLACK, 0);}


    if(millis() > timeout + 5000) // If no new incoming data after 5seconds, turn the strip OFF.
    {setAllLEDs(BLACK, 0);}
    } // do_strip


    void check_source (void)
    {
    if(digitalRead(ch_2) == HIGH)
    {
    if(curr_source != 2)
    {
    //lcd.setCursor(0,1);
    curr_source = 2;
    //lcd.print(" PS_4 "); // Channel 2 of HDMI switcher LCD name
    }
    }
    else if(digitalRead(ch_3) == HIGH)
    {
    if(curr_source != 3)
    {
    //lcd.setCursor(0,1);
    curr_source = 3;
    //lcd.print(" NOT USED"); // Channel 3 of HDMI switcher LCD name
    }
    }
    else if(digitalRead(ch_4) == HIGH)
    {
    if(curr_source != 4)
    {
    //lcd.setCursor(0,1);
    curr_source = 4;
    //lcd.print(" CD/DVD "); // Channel 4 of HDMI switcher LCD name
    }
    }
    else if(digitalRead(ch_5) == HIGH)
    {
    if(curr_source != 5)
    {
    //lcd.setCursor(0,1);
    curr_source = 5;
    //lcd.print(" COMPUTER"); // Channel 5 of HDMI switcher LCD name
    }
    }
    else



    {
    if(curr_source != 1)
    {
    //lcd.setCursor(0,1);
    curr_source = 1;
    //lcd.print(" AV INPUT"); // Channel 1 of HDMI switcher LCD name
    }
    }
    }


    void check_button (void) // ON/OFF button routine
    {
    if(digitalRead(led_button) == LOW)
    {
    if(strip_status == true)
    {
    strip_status = false;
    digitalWrite(status_led, LOW);
    }
    else
    {
    strip_status = true;
    digitalWrite(status_led, HIGH);
    }
    delay(25);
    while(digitalRead(led_button) == LOW)
    {}
    }
    }


    // Sets the color of all LEDs in the strip
    // If 'wait'>0 then it will show a swipe from start to end
    void setAllLEDs(uint32_t color, int wait)
    {
    for ( int Counter=0; Counter < LEDCOUNT; Counter++ ) // For each LED
    {
    strip.setPixelColor( Counter, color ); // .. set the color


    if( wait > 0 ) // if a wait time was set then
    {
    strip.show(); // Show the LED color
    delay(wait); // and wait before we do the next LED
    } // if wait

    } // for Counter
    strip.show(); // Show all LEDs
    } // setAllLEDs



    HYPERION LOG:

    SSH Traffic:
    ssh connected
    ssh out: sudo journalctl -u hyperion.service 2>/dev/null
    ssh in: -- Logs begin at Thu 2016-11-03 17:16:43 UTC, end at Thu 2018-02-15 15:48:05 UTC. --
    ssh in: Feb 15 03:21:16 raspberrypi systemd[1]: Started Hyperion Systemd service.
    ssh in: Feb 15 03:21:17 raspberrypi hyperiond[308]: Hyperion Ambilight Deamon (308)
    ssh in: Feb 15 03:21:17 raspberrypi hyperiond[308]: Version : V1.03.3 (brindosch-2fbbcff/2f01dfa-1495880388
    ssh in: Feb 15 03:21:17 raspberrypi hyperiond[308]: Build Time: Jun 3 2017 02:06:37
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: INFO: Selected configuration file: /etc/hyperion/hyperion.config.json
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: HYPERION INFO: ColorTransform 'default' => [0; 131]
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: HYPERION INFO: ColorCorrection 'default' => [0; 131]
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: HYPERION INFO: ColorAdjustment 'default' => [0; 131]
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: LEDDEVICE INFO: configuration:
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: {
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: "colorOrder" : "rgb",
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: "delayAfterConnect" : 0,
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: "name" : "TV",
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: "output" : "/dev/ttyACM0",
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: "rate" : 500000,
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: "type" : "adalight"
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: }
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: Opening UART: /dev/ttyACM0
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: HYPERION INFO: Json forward to 127.0.0.1:19446
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: HYPERION INFO: Proto forward to 127.0.0.1:19447
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: INFO: Creating linear smoothing
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: HYPERION (CS) INFO: Created linear-smoothing(interval_ms=50;settlingTime_ms=200;updateDelay=0
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: EFFECTENGINE INFO: 27 effects loaded from directory /usr/share/hyperion/effects
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: EFFECTENGINE INFO: Initializing Python interpreter
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: INFO: Hyperion started and initialised
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: KODICHECK ERROR: Kodi Connection error (7)
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: INFO: Kodi checker created and started
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: INFO: Json server created and started on port 19444
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: Connecting to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: INFO: Proto server created and started on port 19445
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: V4L2GRABBER INFO: width=720 height=480
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: V4L2GRABBER INFO: pixel format=YUYV
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: BLACKBORDER INFO: threshold set to 0 (0)
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: BLACKBORDER INFO: mode:default
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: V4L2GRABBER INFO: signal threshold set to: {0,0,0}
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: V4L2GRABBER INFO: started
    ssh in: Feb 15 03:21:18 raspberrypi hyperiond[308]: INFO: V4L2 grabber created and started
    ssh in: Feb 15 03:21:19 raspberrypi hyperiond[308]: BORDER SWITCH REQUIRED!!
    ssh in: Feb 15 03:21:19 raspberrypi hyperiond[308]: CURRENT BORDER TYPE: unknown=0 hor.size=0 vert.size=0
    ssh in: Feb 15 15:06:32 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:07:57 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:09:12 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:17:50 raspberrypi hyperiond[308]: KODICHECK ERROR: Kodi Connection error (5)
    ssh in: Feb 15 15:19:02 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:26:27 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:27:37 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:28:20 raspberrypi hyperiond[308]: KODICHECK ERROR: Kodi Connection error (5)
    ssh in: Feb 15 15:31:17 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:36:12 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:37:27 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447
    ssh in: Feb 15 15:45:02 raspberrypi hyperiond[308]: PROTOCONNECTION INFO: No connection to Hyperion: 127.0.0.1:19447

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!