Status and RGB LED control

Hi,

I have the RGB LED changing colour using the guide however when I supply brightness 0 to all leds the LED goes red and doesn’t turn off. Is this correct behavior?

Also the commands to disable the status leds is not working. Any ideas on this one too?

I have a raspbian image with the balena-fin overlay added.

Thanks,

Rick.

Hi there @rickster, we are testing this for you to try to reproduce, but in the mean time could you confirm the following:

  • balenaFin version (1.0 or 1.1)
  • Raspberry Pi OS / Raspbian version
  • What overlay are you using (the one that’s included with Raspberry Pi OS or the one from the balenaFin repo)
  • What commands you’re using to control the LEDs

The reason I ask this is because the LED control is one of the things that differs between versions.

To answer your question though, if you turn all three (R, G, B) channels off, the RGB LED should not still be on.

Hi,

My balenaFin is a v1.1

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch

My overlay is called balenafin-updated not sure of its origin.

Kernel : 4.19.66-v7+

And the command I’m using are the ones in the documentation.
I mean the RGB led changes colour it just doesn’t turn off.

Cheers,

Rick.

@rickster thanks for that! I’ll set up a test device and try to reproduce. It’s important to share the commands though as there are different versions of the documentation. I assume that since you said a Fin v1.1 and the colour is changing you’re using something like echo $BRIGHTNESS > /sys/class/leds/pca963x\:$COLOR/brightness?

What about for disabling the status LEDs? What have you tried there?

For the status LEDs:

def on():
os.popen(“sudo sh -c "echo 1 > /sys/class/gpio/gpio511/value"”)

def off():
os.popen(“sudo sh -c "echo 0 > /sys/class/gpio/gpio511/value"”)

os.popen(“sudo sh -c "echo 511 > /sys/class/gpio/export"”)
os.popen(“sudo sh -c "echo "out" > /sys/class/gpio/gpio511/direction"”)

For the RGB

def rgb(red, green, blue):
os.popen(“sudo sh -c "echo " + str(red) + " > /sys/class/leds/pca963x:red/brightness"”)
os.popen(“sudo sh -c "echo " + str(green) + " > /sys/class/leds/pca963x:green/brightness"”)
os.popen(“sudo sh -c "echo " + str(blue) + " > /sys/class/leds/pca963x:blue/brightness"”)

Cheers,

Rick

Thanks Rick. I set up some test devices here and I was able to reproduce the issue where I cannot switch the status LEDs on and off. For that we have an open issue that we’re working on here: add PCA953X support · Issue #6 · balena-os/pi-gen · GitHub

As for the red part of the RGB led though, one of my colleagues suggested that perhaps you may have added a trigger to the LED (intentionally or not), as that would definitely do it. One clarification point though, is the red part of the RGB staying on full brightness or is it lit very dimly?

I see add PCA953X support · Issue #6 · balena-os/pi-gen · GitHub has been open since 25 Sep 2019. Does that mean it isn’t going to be fixed?

I see

  • Turn off HDMI when not required
  • Turn off the STATUS LEDs bank
  • Programmatically disable RF activity on mPCIe when not required (assumes a cellular modem is being used)

all use that gpio chip therefore I’m unable to reduce power consumption?

That is pretty bad news for us as we need the board to be in as low power state as possible.

Any ideas when it might be fixed?

Cheers,

Rick.

As for the RGB LED I flashed another new balenafin and the ability to turn off the red element still doesn’t turn off completely.

Not sure what to try next.

Hey Rick

Thanks for all the info. I’m going to ask someone from the Fin team to look into this for you, hopefully they’ll have some ideas on how to resolve the issues you’ve come across.

Hi there, member of the balenaFin team here :slight_smile:

The issue is by no means abandoned and work is being put to solve it. To give you some context, the pi-gen tool we forked from the rpi foundation does only userspace manipulation, so we had to figure out on our own how to handle kernel modules manipulation (and our own pipeline for balenaOS is so architecturally different that atm is of no use for raspbian, althought there are plans to investigate how to share more of that pipeline for the fin raspbian releases in the future). While I can’t share a precise ETA, I can assure you we are actively working on this and we expect to have at least draft release images in the upcoming couple of weeks.

the dimmed red light on the RGB led is a separate issue that is related to the specific driver configuration and is shared between balenaOS and raspbian. It looks like a regression and I’m personally the team member that is investigating it atm. I will make sure to keep this thread up to date on both topics.

Hi,

I have worked through this and have now managed to turn off the status leds and also turn the rgb led completely off. By updating to buster using this Buster update · Issue #3 · balena-os/balenafin-raspbian · GitHub and using a slightly modified balenafin-raspbian/balenafin-ify.sh at master · balena-os/balenafin-raspbian · GitHub I was able to get the board under control.

When will the Buster image be officially supported?

Cheers,

Rick.

Hello @rickster ,

We’ve been investigating this (not being able to turn the status LEDs off) and turns out the way the kernel enumerates the IO expander changed in version 2.38. We’ve updated our docs here with the latest instructions on how to do it properly regardless of the OS version.

Cheers,