Random colors with WS2812 LEDs connected to a RPi

  • Hi!



    I'm building my first setup and I'm completely lost with the problem I'm facing, and even thought it has some similarities with other threads I've found in the forum, to my disgrace, none of the solutions proposed on them have worked for me.


    The TL;DR is: when connecting a WS2812 LED strip to a RPi via GPIO-18, the LEDs light up with random colours, not responding to any configuration I try, or when I test the LEDS with the Effects Configurator using Hyperion Web Interface, or when I set the Idle effect to a solid color.


    In my case I'm using a RPi 3B (although I've tried it also with a RPi 1 B+ with the same results) and a WS2812B LED strip connected to the GPIO port (pin #12).


    My setting is:

    • WS2812 LED strip from Aliexpress (4m, 60 LEDs/m, IP30)
    • 5V - 10A power source
    • RPi 3B (also tested with RPi 1 B+, with the exact same results)
    • RaspBian Lite or HyperBian, both with 2.0.0-alpha.11 version of Hyperion (installed using Raspberry Pi Imager)


    In the beginning I though it could be something with the Hyperion config, so some of the things I tried were:

    • Change the hyperion service to be executed as root. I've done this either by executing the commands in #5 answer in this thread or by executing the command sudo updateHyperionUser -u root commented in the release notes of the last version. Definitely it was a problem as I saw the errors in the log, but after fixing this the log trace was gone but the behavior persists
    • Tried setting the DMA channel to 5 or 10
    • Changing between PWM 0 and 1
    • configuring the LED number to 10 instead of the actual 240 LEDs I have, but it still lights random LEDs along the strip

    At one point, I though that the problem could be the LED stripe and not the RPi and Hyperion config, but I bought a remote controller and used the same power source, but all those shiny bastards worked flawlessly. I didn't even had to change the RGB config.


    Then I tried to install https://github.com/jgarff/rpi_ws281x and run it, but whatever test I run, the LEDs light up randomly. From the README in that repo I also changed in my RPi config:

    • Added in the /boot/config.txt file the values hdmi_force_hotplug=1, hdmi_force_edid_audio=1 and core_freq=250
    • Edited the /etc/modprobe.d/snd-blacklist.conf file to add blacklist snd_bcm2835

    I've even used a node-red flow I found in a Youtube tutorial to test the LEDs one by one, but with the exact same results as in the other attempts.

    At this point I'm kind of desperate because I don't know what else to check or modify to fix it, as I'm no expert on how the connection between the RPi and the LEDs work. So to whomever can help me, thanks!!

    • Hilfreichste Antwort

    put in the config.txt also


    dtparam=audio=off looks like you have still audio interference



    and power the ledstrip at both sides beginning and end with +5 volts and GND.

    make sure you have common GND to every part, so ledstrip to PSU/ PSU to RAspi etc etc.

    use more than one GND PIN on the Raspi

  • Thanks for your help Ambientheater77!


    In fact, after many days struggling with this I had an epiphany precisely with the part that you've pointed out regarding GND pin.

    I had the LED strip connected to the power supply with the 5V and GND, but I was connecting the LEDs to the RPi by only using the DATA cable. At the moment I also connected the GND from the strip to a GND pin in the RPi, everything started to work properly!


    Because in all the videos and blog posts I checked they didn't seem to mention the second GND connection to the RPi, I'll mark your answer as Best Answer, in case anyone else is a total noob as me and faces the same problem.



    Regards.


    Marked as resolved

    Einmal editiert, zuletzt von Criminal () aus folgendem Grund: Merged a post created by Criminal into this post.

Jetzt mitmachen!

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