1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

LEDs leuchten nur beim Start.

Discussion in 'German Talk' started by damienlazareth, 15 September 2018.

  1. damienlazareth

    damienlazareth New Member

    Messages:
    1
    Hardware:
    RPi1/Zero, +Arduino
    Hallo, ich habe jetzt schon viel ausprobiert.
    Vor einem Jahr lief das ganze schon mal... Dann war die SD Karte platt und nu gehts nicht mehr wirklich.
    Setup :
    Raspberry Zero mit libreelec und Arduino Mega & WS2812b.
    Video Grabber läuft und das Bild sieht auch gut aus.
    LEDs leuchten wenn Arduino startet.(Setup Routine)
    Traffic ist auf der Seriellen auch zu sehen.(LEDS auf Mega blinken)
    Nur bleiben die LEDs dunkel.
    Habe es auch schon ohne Arduino probiert(PIN18) = überhaubt keine Reaktion.
    Per SPI habe ich Aussetzer und Blitze.

    Vielleicht kann mir einer auf die Sprünge helfen.

    Code:
    ssh in:     Hyperion Ambilight Deamon (816)
    ssh in:         Version   : V1.03.4 (brindosch-c750c41/dc6a602-1522918225
    ssh in:         Build Time: Apr  5 2018 01:57:25
    ssh in:     INFO: Selected configuration file: /storage/.config/hyperion.config.json
    ssh in:     HYPERION INFO: ColorTransform 'default' => [0; 235]
    ssh in:     HYPERION INFO: ColorCorrection 'default' => [0; 235]
    ssh in:     HYPERION INFO: ColorAdjustment 'default' => [0; 235]
    ssh in:     LEDDEVICE INFO: configuration:
    ssh in:     {
    ssh in:         "colorOrder" : "grb",
    ssh in:         "delayAfterConnect" : 0,
    ssh in:         "name" : "Test1",
    ssh in:         "output" : "/dev/ttyACM0",
    ssh in:         "rate" : 460800,
    ssh in:         "type" : "adalight"
    ssh in:     }
    ssh in:     Opening UART: /dev/ttyACM0
    ssh in:     INFO: Creating linear smoothing
    ssh in:     HYPERION (CS) INFO: Created linear-smoothing(interval_ms=50;settlingTime_ms=200;updateDelay=0
    ssh in:     EFFECTENGINE INFO: 27 effects loaded from directory /storage/hyperion/effects
    ssh in:     EFFECTENGINE INFO: Initializing Python interpreter
    ssh in:     INFO: Hyperion started and initialised
    ssh in:     INFO: Json server created and started on port 19444
    ssh in:     INFO: Proto server created and started on port 19445
    ssh in:     V4L2GRABBER INFO: width=720 height=576
    ssh in:     V4L2GRABBER INFO: pixel format=YUYV
    ssh in:     BLACKBORDER INFO: threshold set to 0.14 (36)
    ssh in:     BLACKBORDER INFO: mode:osd
    ssh in:     V4L2GRABBER INFO: signal threshold set to: {0,0,0}
    ssh in:     V4L2GRABBER INFO: started
    ssh in:     INFO: V4L2 grabber created and started
    ssh in:     BORDER SWITCH REQUIRED!!
    ssh in:     CURRENT BORDER TYPE: unknown=0 hor.size=0 vert.size=0
    Code:
    #include "FastLED.h"
    
    // How many leds in your strip?
    #define NUM_LEDS 236
    // For led chips like Neopixels, which have a data line, ground, and power, you just
    // need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
    // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
    #define DATA_PIN 2
    #define CLOCK_PIN 13
    
    #define COLOR_ORDER GRB
    
    // Adalight sends a "Magic Word" (defined in /etc/boblight.conf) before sending the pixel data
    uint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i;
    
    // Baudrate, higher rate allows faster refresh rate and more LEDs (defined in /etc/boblight.conf)
    #define serialRate 460800
    
    // Define the array of leds
    CRGB leds[NUM_LEDS];
    
    void setup() {
          // Uncomment/edit one of the following lines for your leds arrangement.
          // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
             FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
          // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
        
          // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
    
          // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
        
            // initial RGB flash
            LEDS.showColor(CRGB(255, 0, 0));
            delay(500);
            LEDS.showColor(CRGB(0, 255, 0));
            delay(500);
            LEDS.showColor(CRGB(0, 0, 255));
            delay(500);
            LEDS.showColor(CRGB(0, 0, 0));
          
            Serial.begin(serialRate);
            Serial.print("Ada\n"); // Send "Magic Word" string to host
    
    }
    
    void loop() {
      // wait for first byte of Magic Word
      for(i = 0; i < sizeof prefix; ++i) {
        waitLoop: while (!Serial.available()) ;;
        // Check next byte in Magic Word
        if(prefix[i] == Serial.read()) continue;
        // otherwise, start over
        i = 0;
        goto waitLoop;
      }
    
      // Hi, Lo, Checksum
    
      while (!Serial.available()) ;;
      hi=Serial.read();
      while (!Serial.available()) ;;
      lo=Serial.read();
      while (!Serial.available()) ;;
      chk=Serial.read();
    
      // if checksum does not match go back to wait
      if (chk != (hi ^ lo ^ 0x55))
      {
        i=0;
        goto waitLoop;
      }
    
      memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
      // read the transmission data and set LED values
      for (uint8_t i = 0; i < NUM_LEDS; i++) {
        byte r, g, b;  
        while(!Serial.available());
        r = Serial.read();
        while(!Serial.available());
        g = Serial.read();
        while(!Serial.available());
        b = Serial.read();
        leds[i].r = r;
        leds[i].g = g;
        leds[i].b = b;
      }
      // shows new values
    FastLED.show();
    }
    Code:
    ################################################################################
    #      This file is part of LibreELEC - http://www.libreelec.tv
    #      Copyright (C) 2016 Team LibreELEC
    #
    #  LibreELEC is free software: you can redistribute it and/or modify
    #  it under the terms of the GNU General Public License as published by
    #  the Free Software Foundation, either version 2 of the License, or
    #  (at your option) any later version.
    #
    #  LibreELEC is distributed in the hope that it will be useful,
    #  but WITHOUT ANY WARRANTY; without even the implied warranty of
    #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    #  GNU General Public License for more details.
    #
    #  You should have received a copy of the GNU General Public License
    #  along with LibreELEC.  If not, see <http://www.gnu.org/licenses/>.
    ################################################################################
    # Bootloader configuration - config.txt
    ################################################################################
    
    ################################################################################
    # Memory (System/GPU configuration )
    ################################################################################
    
    # Default GPU memory split (do not change if you do not know what you are doing)
      gpu_mem=128
    
    # Configure GPU memory based on SDRAM size - overrides above setting
      gpu_mem_256=112
      gpu_mem_512=160
      gpu_mem_1024=256
    
    ################################################################################
    # For overclocking and various other settings, see:
    # https://www.raspberrypi.org/documentation/configuration/config-txt.md
    ################################################################################
    # Set 'force_turbo=1' to disable dynamic overclocking and enable overclocking always.
    force_turbo=0
    
    # Make display smaller to stop text spilling off the screen
    #
    # Note that the overscan settings only affect the splash screen and not Kodi.
    #
    # If you experience overscan/underscan issues the best solution is to adjust
    # your TV settings ("full pixel", "1-1 pixel" etc.). Alternatively, there is a
    # calibration menu in the Kodi GUI.
    # disable_overscan=1
    
    # Force HDMI even if unplugged or powered off
    # hdmi_force_hotplug=1
    
    # Doesn't sent initial active source message.
    # Avoids bringing CEC (enabled TV) out of standby and channel switch when
    # rebooting.
    hdmi_ignore_cec_init=1
    
    ################################################################################
    # License keys to enable GPU hardware decoding for various codecs
    # to obtain keys visit the shop at http://www.raspberrypi.com
    ################################################################################
    
    # decode_MPG2=0x00000000
    # decode_WVC1=0x00000000
    
    ################################################################################
    # End of default configuration
    ################################################################################
    
    ################################################################################
    # Include distribution specific config file if it exists.
    ################################################################################
    [all]
    include distroconfig.txt
    dtparam=spi=on
    #Increase UART speed
    init_uart_clock=14745600
    
     
    Last edited: 15 September 2018