Où sommes nous ?

Retour

BananaLEDd

3 LEDs are managed by BananaPI's NIC interface : Yellow, Green (on the Ethernet connector) and the Blue one (close to it).
By default, the Yellow LED lights when it receiving the carrier from the network (network links) whereas the Green and Blue one are flashing simultaneously as per network activities ... a bit useless to have the same function isn't it. Fortunately, RTL8211E, which is driving NIC interface can be programmed thru MII/MDIO-Interface.

BananaLEDd is a daemon being able to :

Installation

Get the archive at the bottom of this page, extract if somewhere then compile the source code

gcc -Wall -O2 -o BananaLEDd BananaLEDd.c

I suggest to put the generated binary in /usr/local/sbin

Known options

    -h : this online help
    -d : enable debug messages
    -f<file> : read <file> for configuration
        (if not provided looks for '/usr/local/etc/BananaLEDd.conf')

Understood configuration keywords are

The following keywords are understood from configuration file

Blue=<opts>     : behaviors of the blue led
Yellow=<opts>   : idem for the Yellow one
Green=<opts>    : and the Green one

LED=<device>=<opt> : idem for an user servicable LED that is exposed on sysFS
(i.e. green:ph24:led1)

Where opts can be

10 - Linked to a 10Mb network
100 - Linked to a 100Mb network
1000 - Linked to a 1Gb network
LINKED - Linked to any type of network (equal to "10 100 1000")
NETWORK - blinks as per network activities

SATA - Follows as per disk activities
LOAD - reflect System load

SATA and LOAD are the only options that have to be specified alone.

10, 100, 1000, LINKED and NETWORK can't work on SysFS LEDs

SATA and LOAD can work only if a network cable is connected (LEDs won't bright without network carrier)

Other configuration keywords are :

LEDDevice=   - whitch device to use to access to LEDs (eth0)
Disk=        - disk to monitor (sda)
Sample=     - Delay b/w 2 sample (default : 100ms)
MinBlink=    - Minimum load to reflect (defaut 2)
MultBlink= - Blink multiplier (default 100)

Minimum blink result is (MultBlink/2) / (MinBlink * Sample)

Comments start by a dash #

startup script

BananaLEDd needs to be launch as root.

The simpliest way is

./BananaLEDd -d -fBananaLEDd.conf

Here the startup script I'm using :

#!/sbin/runscript
# Copyright Laurent Faillie 2014
#
# Start/Stop BananaLEDd daemon on OpenRC system (tested on Gentoo)

depend() {
    need net
}

DMKDEM_BIN=${DMKDEM_BIN:-/usr/local/sbin/BananaLEDd}
DMKDEM_PID=${DMKDEM_PID:-/var/run/BananaLEDd.pid}

start() {
    ebegin "Starting BananaLEDd's daemon"
    start-stop-daemon --start --exec ${DMKDEM_BIN}
        --interpreted
        --background --make-pidfile --pidfile ${DMKDEM_PID}
    eend $?
}

stop() {
    ebegin "Stopping BananaLEDd's daemon"
    start-stop-daemon --stop --exec ${DMKDEM_BIN}
        --pidfile ${DMKDEM_PID}
    eend $?
}

History


BananaLEDd_1.2.tar.bz2

BananaLEDd_1.1.tar.bz2

Visitez :
La liste de nos voyages
Nos sorties Ski et rando
Copyright Laurent Faillie 2001-2017
N'oubliez pas d'entrer le mot de passe pour voir aussi les photos perso.
Contactez moi si vous souhaitez réutiliser ces photos et pour les obtenir avec une plus grande résolution.
Visites durant les 7 derniers jours Nombre de visites au total.

Vous pouvez laissez un commentaire sur cette page.

  Le Mercredi 11 Novembre 2015,"anon" a écrit à propos de cette page  

Hello!
Could you please write the program so that the minimum load LED blink "MinBlink" per second, and at the maximum "MultBlink" per second from the configuration file?
Thank you!