[solved] How to turn off the RGB LEDs?

Is there a way to turn off the RGB LEDs on the board? They are very bright and do not signal anything useful afaik. Would be nice to use them in some way or turn them off altogether.

Edit: I use Arch, so I’m searching for some terminal command or config in some file, maybe. Or is it a bootrom thing?

the gpio pins assigned to the LEDs are:

red - 128 green - 97 blue - 98

so if you drive those gpio pin values high (i believe it’s high), they should turn off the LEDs

Thx! Is there a howto for the GPIO handling on the W2? I tried by installing RPi.GPIO but when I then import RPi.GPIO in a python script it gives me the error:

This module can only be run on a Raspberry Pi!

and I have not figured out yet how else the GPIO is handled. The path from script1 in this R2-GPIO-Howto is not present on my system and script2 gives me the error

No available gpio chip

i’m not sure i’ve seen an explicit howto on accessing the gpio pins on the BPI-W2. i’m pretty sure it’s the same as generic process of accessing gpio pins in linux? what we do is:

  1. export the pin addresses in /sys/class/gpio/export
  2. change the direction in /sys/class/gpio/gpio97, /gpio98, /gpio128 to “out”
  3. change the value in /sys/class/gpio/gpio97, /gpio98, /gpio128 to “1”

you can make a little baby script to do all that, or do it from the command line, any way you want, really.

Thank you for your answer and your time! :beers:

So it’s basically this and it works:

cd /sys/class/gpio
echo 97 > export
echo 98 > export
echo 128 > export

echo "out" > gpio97/direction
echo 1 > gpio97/value

echo "out" > gpio98/direction
echo 1 > gpio98/value

echo "out" > gpio128/direction
echo 1 > gpio128/value

I’m not a disco fan either. Ubuntu is installed on my banana pi bpi-w2 . My solution is a script. It can then be added to autorun.

#!/bin/bash

echo 0 > /sys/class/leds/led1/brightness
echo 0 > /sys/class/leds/led2/brightness
echo 0 > /sys/class/leds/led3/brightness

Useful led shell control script, with monitoring of a RAID state.

#!/bin/sh                                                                       
                                                                                
LED_GREEN=97                                                                    
LED_BLUE=98                                                                     
LED_RED=128                                                                     
                                                                                
# $1 - gpio num                                                                 
export_gpio()                                                                   
{                                                                               
        local gpio_path="/sys/class/gpio/gpio$1"                                
        [ -d "$gpio_path" ] ||                                                  
        {                                                                       
                echo "$1" > /sys/class/gpio/export                              
                #wait                                                           
                [ -d "gpio_path" ] || sleep 1                                   
        }                                                                       
}                                                                               
                                                                                
# $1 gpio_num                                                                   
# S2 value                                                                      
out_gpio()                                                                      
{                                                                               
        local gpio_path="/sys/class/gpio/gpio$1"                                
        export_gpio $1                                                          
        echo "out" > ${gpio_path}/direction                                     
        echo $2 > ${gpio_path}/value                                            
}                                                                               
                                                                                
all_leds_off()                                                                  
{                                                                               
        out_gpio $LED_GREEN 1                                                   
        out_gpio $LED_BLUE  1                                                   
        out_gpio $LED_RED   1                                                   
}                                                                               
                                                                                
all_leds_off                                                                    
out_gpio $LED_BLUE 0                                                            
                                                                                
while [ true ]                                                                  
do                                                                              
        cat /proc/mdstat | grep -q "(F)"                                        
        [ $? -ne 0  ] ||                                                        
        {                                                                       
                while [ true ]                                                  
                do                                                              
                        all_leds_off                                            
                        sleep 1                                                 
                        out_gpio $LED_RED 0                                     
                        sleep 1                                                 
                done                                                            
        }                                                                       
                                                                                
        sleep 60                                                                
        out_gpio $LED_BLUE 1                                                    
        out_gpio $LED_GREEN 0                                                   
        sleep 5                                                                 
        out_gpio $LED_BLUE  0                                                   
        out_gpio $LED_GREEN 1                                                   
done