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:
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
2.72 KB, Downloads: 872
Configure PHY leds (blue, yellow, green)