[BPI-R2] Control On-board LEDs

can blinking disabled? i have echoed timer to trigger, now the delay_on and delay_off node are visible, but i see no difference when i change the values. if i enable these noedes first the green led flickers strange with different times

green is brighter that the other 2

@frank-w In which of your kernel version these system LEDs are supported?

as i wrote above…4.14.34…should be supported also in earlier 4.14.x

Thanks @frank-w and sorry, but I’m not catched this detail. Could you share the link for the sources of this kernel(s)?

blinking can be disabled by echo 0 > /sys/class/leds/bpi-r2:isink:green/brightness

frequency can changes, you can try

echo 100 > /sys/class/leds/bpi-r2:isink:green/delay_on

echo 100 > /sys/class/leds/bpi-r2:isink:green/delay_off

and

echo 1000 > /sys/class/leds/bpi-r2:isink:green/delay_on

echo 100 > /sys/class/leds/bpi-r2:isink:green/delay_off

and compare what diffrences between the two set of commands

It seems hardware characteristics. i have checked the hardware value written by the driver, it indeed to writing the same value to their leds registers but there’s brightness differences

:stuck_out_tongue: then the led is off :wink: i want a steady-on

with 100/1000 i see no difference…tried with 10/1000 …there is a difference

echo 1 > /sys/class/leds/bpi-r2:isink:green/brightness

it is steady on on my setup …

[11:45] root@bpi-r2:~# L=/sys/class/leds/bpi-r2\:isink
[12:05] root@bpi-r2:~# echo 0 > $L:green/brightness                 #goes off 
[12:05] root@bpi-r2:~# echo 1 > $L:green/brightness                 #starts blinking

weird. it is different with my test.

echo 0 (to cancel blinking), and then echo 1 , i can get a always steady on

how about the other two leds ?

driver should use the same programming to those leds

the other 2 (red/blue) go on (1) and off (0), no blinking

timing with delay-nodes ist strange anyway…hard to describe

i see no difference between red,blue and green: https://github.com/frank-w/BPI-R2-4.14/blob/b80a9345899842733507fe40decec0ab7f0ba3cd/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts#L72

btw. i have HW rev 1.1 (if it matters), running debian 8 on my test-system with kernel 4.14.34

LEDs in /sys/class/leds/bpi-r2:pio (next to gpio40-header) are also strange:

  • red cannot be set
  • blue and green are swapped
  • 0/1 is swapped (1 turnes off, 0 turns on)

it looks like gpio problem

it can be solved by change properties such as label and low or high-active in gpio leds nodes in dts. Could you help to try which one is good setting?

where are the pio-leds defined? i lokked in bananapi.dts and mt7623.dtsi…found only the isink leds

how about the blinking of green isink-led? any idea? which HW-revision/kernel do you use?

compatible string is gpio-led, see

https://elixir.bootlin.com/linux/v4.17-rc1/source/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts#L87

it looks like board issue, I am using v1.1 with v4.16 rc5 and code is almost same between 4.14 you used and 4.16.

1 Like

ok, found it, thank you…in dts the are defined as high-active…in shematics they look low-active (led between vcc and gpio)…thats the first problem…to bad that in shematics the colors are not described…so we can only swap green&blue but have no clue whats up with red

fixed green and blue: https://github.com/frank-w/BPI-R2-4.14/commit/5da2e20c279ae77f13ea92d11f2e4c8c17ab0ce2 working now as expected and do not light the entire time (only red is always on).

in shematics the leds are named

led0=239 (r)
led1=241 (b)
led2=240 (g)

as you see by reading gpio-order you get r-g-b, with led-numbers you get r-b-g…seems like thats the reason for swapped green/blue

1 Like

xbgmsharp tested also the green-led-behaviour: green light is only blinking

On my board, the resistors R303 and R239-R240 are not populated, so the red LED can not be controlled. It is used only as a power indicator.

then i need to disable blinking of green isink led

@frank-w I clonned your git repo for kernel 4.14-main, configure it to have built in SATA and RAID support and then compile it using your build.sh script: build.sh build and then build.sh pack. I got an archive bpi-r2_4.14.34_main.tar.gz which I extract to SDCard to root. Now, when I try to boot from this kernel, it hangs on “Starting kernel…”. How can I debug what is wrong?

Part    Start Sector    Num Sectors     UUID            Type
  1     204800          524288          03ecee97-01     0c
  2     729088          14211072        03ecee97-02     83
mmc0 is available
reading bananapi/bpi-r2/linux/uEnv.txt
811 bytes read in 5 ms (158.2 KiB/s)
Loaded environment from uEnv.txt
Banana Pi bpi-r2 chip: mt7623n Service: linux
reading bananapi/bpi-r2/linux/uImage
8895605 bytes read in 544 ms (15.6 MiB/s)
reading bananapi/berryboot.img
** Unable to read file bananapi/berryboot.img **
bootm flag=0, states=70f
## Booting kernel from Legacy Image at 84000000 ...
   Image Name:   Linux Kernel 4.14.34-main
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    8895541 Bytes = 8.5 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...