Discussion

Switch off the leds ?

66 64831
Hi there,

does anybody know, how to disable the heartbeating yellow LED on the network interface?

Thanks in advance

Windwalker-HH

sqr82  
I didn't think about the yellow and green led in the first place, but I can add that to the program as well...

Hey,

is there also an option to switch the green led e.g. to use as "hdd-led" instead of heartbeat?

Greetz

Edited by egamorena at Wed Oct 29, 2014 05:20

I have modified the Roman Reichel's bpi_ledset code to manage the three PHY leds (blue, green and yellow).

I changed the syntax to allow independent led configuration.
The leds are controlled by the PHY.

A PHY led can be configured to any combination of the following rules:
- Switch on when linked at 10Mbps
- Switch on when linked at 100Mbps
- Switch on when linked at 1000Mbps
- Blink when there is activity (Tx/Rx)


To get help on usage call the application with no arguments:
./bpi_ledset

To test the application you can use it with root privileges. For example, to switch off blue, yellow and green leds:
sudo ./bpi_ledset eth0 b y g


For example, to switch off the blue led on startup:

1.- Compile and copy the result to /sbin/bpi_ledset
gcc -o bpi_ledset bpi_ledset.c && sudo cp bpi_ledset /sbin/bpi_ledset

2.- Add the following line to /etc/rc.local, before the last "exit 0" line:
/sbin/bpi_ledset eth0 b

Find attached the source

bpi_ledset.c.gz

2.72 KB, Downloads: 871

Configure PHY leds (blue, yellow, green)

tkaiser  
Thx, works as expected -- no annoying blinking any longer:
  1. root@bananas /tmp # ./bpi_ledset eth0
  2. Phy led configuration:
  3. blue:    10Mbps | 100Mbps | 1000Mbps | Active (Tx/Rx)
  4. yellow:  10Mbps | 100Mbps | 1000Mbps
  5. green:   Active (Tx/Rx)

  6. root@bananas /tmp # echo none > /sys/class/leds/green\:ph24\:led1/trigger
  7. root@bananas /tmp # ./bpi_ledset eth0 y b g
  8. Phy led configuration changed

  9. root@bananas /tmp # ./bpi_ledset eth0            
  10. Phy led configuration:
  11. blue:    disabled
  12. yellow:  disabled
  13. green:   disabled
Copy the Code

tkaiser  
Edited by tkaiser at Wed Oct 29, 2014 06:40

Ahhh! I just realized that one can use the 3 network related LEDs for own/informational use when the Banana Pi is connected via Ethernet. In case it's 1000 MBps I'm able to switch the blue LED on the board and the two on the Ethernet connector statically with
  1. /usr/local/sbin/bpi_ledset eth0 bh gh yh # all on
  2. /usr/local/sbin/bpi_ledset eth0 bh gh y # yellow off, blue/green on
Copy the Code
Nice when combined with fibre optics in an enclosure: three more LEDs available for signaling in addition to the green one on the board

sofax  
egamorena replied at Wed Oct 29, 2014 05:16
I have modified the Roman Reichel's bpi_ledset code to manage the three PHY leds (blue, green and ye ...

thx
Finally, the blue flashing light in the night is gone.

ryad  
Very nice done egamorena! It works like a charm.

Is it okay for you, if I put that code on pastebin and post a small blog article about that?

Thanks in advance,
Ryad

sqr82  
egamorena replied at Wed Oct 29, 2014 05:16
I have modified the Roman Reichel's bpi_ledset code to manage the three PHY leds (blue, green and ye ...

Thanks for adding all the options, I didn't have the time to do it...

Roman

RE: Switch off the leds ?

Edited by destroyedlolo at Fri Oct 31, 2014 13:44

Cool cool cool : Frankly speaking, having both the green and the blue led flashing for the same information is bit useless

I would have another interesting usage :  I have a SunClassic box under NetBSD and its power LED is blinking at a frequency that is related to the system load. Unlike NetBSD, I don't think Linux kernel is able to do that ... so I'm working on a daemon that is doing the same.
A job for the Blue LED.

caldir65 replied at Sat Oct 25, 2014 13:09
Hey,

is there also an option to switch the green led e.g. to use as "hdd-led" instead of heartbeat? ...


I would be happy too to light the green one for disk activities : is it feasible ?

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

Points Rules