Other languages

Signals for on Boad LEDs

2 2419
Edited by balli1187 at Feb 08, 2016 12:41

Hi Forum,

i have some questions about the LEDs on the Banana Pi Pro. There is one for power, one for network and another one i don't know its function.
I have read how they can be disabled and how they can be triggered bei GPIO.

My question is, how can bring the signal to an external LED (via GPIO-Pin). I have build a custom Case with LEDs and i want to bring the network-signal, eg to these external LED.

Has somebody done this before?

Best regards from germany,
There are 3 leds; power, sd card i/o, network i/o

I think you can use signal from kernel:

You can read the status with:
  1. cat /sys/class/leds/led0/brightness
Copy the Code

verify if there is a trigger:
  1. cat /sys/class/leds/led0/trigger
  2. none [mmc0]
Copy the Code

For change value of leds if there is trigger you have to disable it:
  1. echo none >/sys/class/leds/led0/trigger
Copy the Code

Then you can set the power led value:
  1. echo 1 >/sys/class/leds/led0/brightness
  2. echo 0 >/sys/class/leds/led0/brightness
Copy the Code

And status led value:
  1. echo 1 >/sys/class/leds/led1/brightness
  2. echo 0 >/sys/class/leds/led1/brightness
Copy the Code

To return to the trigger function (like a reset):
  1. echo mmc0 >/sys/class/leds/led0/trigger
Copy the Code

Or you can control directly with GPIO:
  1. echo gpio | sudo tee /sys/class/leds/led1/trigger
Copy the Code

Hope it's useful.

I am interested in this, too: I would like to connect external LEDs to the Banana and clone the ones on board.

But it doesn't seem that simple, as this:
cat /sys/class/leds/led0/brightness
cat: /sys/class/leds/led0/brightness: No such file or directory

You have to log in before you can reply Login | Sign Up

Points Rules