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-2024
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 Jeudi 01 Avril 2021,"Berbigou" a écrit à propos de cette page  

Bonjour,


et merci pour l'utilitaire BananapiLEDd ! Mon BananaPi ne ressemble plus à un sapin de Noel !


pour le démarrer au boot avec systemd sur armbian 21.02.3:


(to start it as a service at boot: )


sudo su


nano /etc/systemd/system/LED_start.service


  [Unit]
  Description=LEDs start service

  [Service]
  Type=forking
  ExecStart=/usr/local/sbin/BananaLEDd

  [Install]
  WantedBy=multi-user.target


systemctl enable LED_start


systemctl start LED_start


exit



  Le Samedi 18 Mars 2017,"Thomas" a écrit à propos de cette page  

Hello! Pretty brief for non programmers :) After installing GCC and fighting a "stdio.h not found" error, compilation was succesfull. I still can't find that damn compiled program is saved but it runs if typing ./BananaLEDd


Unfortunately it ends with "segmentation fault (core dumped)"


For simplicity sake, the config file contains only one line "Green=LOAD"


BananaLEDd (1.2) starting ...
Reading configuration file '/usr/local/etc/BananaLEDd.conf'
Green mode : 20
[1]    3279 segmentation fault (core dumped)  ./BananaLEDd -d


running on bananian 3.4.108


  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!