The Green LED Bug

  • Thought I’d create a thread especially for the green LED bug, the more knowledge we can collect about it in one place the better the chance of a fix being created. The bug has been around since probably the beginning and occasionally people still ask about it.


    What is it?

    The LED strip will randomly light just one green LED, its always the same LED, the closest one to the power plug.




    Once the bug appears the only way to clear it is to unplug the power, rebooting does not clear the bug. the green LED will stay until a reboot.


    What we do know

    Writing RGB values directly to the WS2812 device will only temporarily clear it before the green LED bleeds back in.


    Playing LED patterns while the bug is present causes the whole LED strip to flicker as it plays.


    The fact that you can stop Kodi with “systemctl stop kodi” and the bug still continues until power off tells me that the bug is low level? Possibly kernel level, and probably in the WS2812 device driver? Alternatively it could also be caused by the hardware?


    The source code to the ws2812 driver is here slice-drivers/ws2812.c at master · LibreELEC/slice-drivers · GitHub


    What next?

    If you spot something about this bug that nobody else has mentioned or have spotted wrong information please leave a comment below, also if anyone has worked out how to make this bug repeatable please comment as it could go a long way in helping to work out what’s happening.


    Edited once, last by F1Fanb0y ().

  • From ghollingworth via email:


    "That's weird, will have a chat with James to see if we can work out what it might be.. is it always green?

    Has anyone tried writing directly to the /dev/ws2812 when it happens? I don't think I've seen the problem on my box which is still running strong!"


    I confirmed the always-green, i've seen it plenty of times while testing.

  • That's awesome, thanks chewitt and ghollingworth !


    I've written directly to /dev/ws2812 while its happening, using a python script based off the libreelec slice addon, and whether you clear them or change their colour the one (same) led will turn back to green in a gradual change of colour and brightness, all other leds stay at what state they were set to.


    From my experience it can be weeks or months from seeing it and then it can happen every single day, its really unpredictable and so far I haven't worked out how to trigger it into happening.


    If there's anything I can do to help, just let me know.

    Edited once, last by F1Fanb0y ().

  • From my experience it can be weeks or months from seeing it and then it can happen every single day

    F1Fanb0y


    I have seen it, but not often. Both my Slices are usually powered up and only tend to get rebooted (other than main electric supply failure) when there is a software update or the hard drive hangs up. It only seems to happen after a reboot, and I think (not proven) only after a non-update reboot. Sometimes the Slice hangs and needs a power off reset (no gui / keybaord responds). It is after an unscheduled event when I have noticed the green LED issue. Several power off reboots (I.E. removing the power supply plug) seems to correct the condition. Does not always fix it at the first power off reset. A reboot without removing the power plug does not seem to fix the condition.


    As you mention, it does not seem to happen often enough to be able to trace the events leading up to it. However I will take note next time it happens.


    Hope that helps.


    Regards

    Roger

  • Whilst you've got the problem, try copying raspi-gpio from a Raspbian build an do:


    raspi-gpio set 43 dl

    raspi-gpio set 43 dh


    See if that fixes it!

  • Tried a test.


    Slice CM3 headless with hard drive, controlled by VNC. Reboot via GUI not ssh.


    1) Reboot while music (flac) playing (power plug NOT removed)

    2) after reboot green LED on

    leave overnight (just because it was bed time)

    .... later, the following morning...

    3) Green LED still on

    4) reboot (power plug NOT removed)

    5) Green LED is off

    6) play music as 1) and reboot

    7) Green LED is off after reboot

    8) play music as 1) and reboot

    9) Green LED off after reboot


    So that blows my idea about needing to remove the power plug every time. Maybe it was just luck that the Green LED came on the first time.


    I will leave it a few days and repeat to see if that makes a difference.


    EDIT: a "8)" changes to a 8) when posted, so read 8 ) for a 8) :):)



    Roger

  • Thanks ghollingworth , have tried to get raspi-gpio to run but its coming back 'file not found', so maybe i'm missing some dependencies.


    what I can use easily though is python, would this code effectively do the same?



    Thanks g7ruh I haven't seen it myself for a couple of months, out of interest is your sound via the optical/analog or HDMI? do you use the wifi dongle or ethernet? Do you use the IR to control it with a remote? These are some of the things I've changed around recently.

  • Thanks g7ruh I haven't seen it myself for a couple of months, out of interest is your sound via the optical/analog or HDMI? do you use the wifi dongle or ethernet? Do you use the IR to control it with a remote? These are some of the things I've changed around recently.

    F1Fanb0y


    Sound out via optical. I have seen the Green LED problem using optical and analog. Swapped to optical when I upgraded the amp which has a good DAC.

    Ethernet used

    No IR used. Just use VNC to select media and use a separate amp to play music so volume controlled via the amplifier remote.

    If I need remote control while computer is off (no VNC immediatley available) I use Kore on my Android phone.


    This setup has been in place for a year or so, so no recent changes.


    I have another one which uses the supplied remote, also ethernet connected. I use that for music and some video. That device also acts as a wifi hotspot via a dongle.


    Frequency of "Green LED Syndrome" is about the same on both units. Quite infrequent but not as rare as rocking horse manure!


    Roger

  • Just confirming that running the above python script removes the green led only while it is set to low. When you set it to high again the green returns.


    I can also confirm that by writing some extra logging into the ws2812 source code and building a slice image, that the device's 'ws2812_write' function is not called at any point and both of its internal buffers (rgba & pwm) do not show any green values, but only the pattern that was last sent (off or red).


    So could some other process be directly accessing the PWM pin?

    Edited once, last by F1Fanb0y ().