Update README.md

This commit is contained in:
manuelkamp 2021-12-21 23:06:34 +01:00 committed by GitHub
parent 7e6d5d0819
commit ef82f924b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 40 deletions

View File

@ -1,5 +1,10 @@
# PiLEDlights
For the Raspberry Pi - Make LEDs blink on network and/or SD card/USB storage activity.
For the Raspberry Pi - Make LEDs blink on SD card/USB storage activity. Also one LED if system is booted and another one to check if processes are running.
## Prerequirements
Install pigpio
sudo apt install pigpio
## Modified to have 3 LEDs
The ssdled was modified to have 3 different LEDs. One for disc activity, one for heartbeat (it checks if processes are running) and one for system readiness (= booted).
@ -7,44 +12,9 @@ The ssdled was modified to have 3 different LEDs. One for disc activity, one for
## Build
gcc -Wall -O3 -o ssdled ssdled.c -lpigpio -lrt -pthread
## Original Modified to use the piGPIO library
I've modified these sources to use the piGPIO library instead of the unsupported wiringPi library.
## Service
gcc -Wall -O3 -o ssdled ssdled.c -lpigpio -lrt -pthread && sudo cp ssdled /usr/bin/ssdled && sudo chmod +x /usr/bin/ssdled && sudo nano /etc/init.d/ssdled
The original README text is here for reference, but the actual parameters and values are now different (netleds, for example now has a distinct tx and rx LED)
and paste content of ssdled.sh script and then execute
## Build
gcc -Wall -03 -o ssdled ssdled.c -lpipgio -lrt -pthread
## Original README
hddledPi blinks a LED connected to a GPIO pin on any mass storage access. Not only on SD card access, but also on USB thumbdrive and hard drive activity.
netledPi blinks a LED connected to a GPIO pin when there is activity on any network interface. Not only the built-in ethernet interface, but also on any other USB ethernet or WiFi interface.
actledPi blinks the Pi's ACT led on all mass storage I/O, i.e. not only the SD card.
netledPi and hddledPi make use of Gordon Henderson's wiringPi library - wiringpi.com - so you have to have that installed in order to build the programs. Current versions of Raspbian come with wiringPi already installed.
**EDIT 2020-05-19: It seems like the Pi 4B needs WiringPi 2.52. At the time of writing this, Raspbian comes with 2.50, i.e. you'll have to update WiringPi if you are on a Pi 4B.** http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/
Building the programs is easy:
gcc -Wall -O3 -o netledPi netledPi.c -lwiringPi
gcc -Wall -O3 -o hddledPi hddledPi.c -lwiringPi
gcc -Wall -O3 -o actledPi actledPi.c
I recommend that you copy the binaries to the /usr/local/bin directory, because the init scripts provided all assume that they reside there.
hddledPi uses wiringPi pin 10 by default. It is BCM_GPIO 8, physical pin 24 on the Pi's P1 header.
netledPi uses wiringPi pin 11 by default. It is BCM_GPIO 7, physical pin 25 on the Pi's P1 header.
Note: These pins are also used for the SPI interface. If you have SPI add-ons connected, you'll have to use the -p option to change to another, unused pin.
Options for netledPi and hddledPi:
-d, --detach Detach from terminal (become a daemon),
-p, --pin=VALUE GPIO pin (using wiringPi numbering scheme) where LED is connected
-r, --refresh=VALUE Refresh interval (default: 20 ms)
Options for actledPi:
-d, --detach Detach from terminal (become a daemon)
-r, --refresh=VALUE Refresh interval (default: 20 ms)
netledPi and hddledPi need super-user privileges, so you have to start them with "sudo", e.g.
sudo netledPi -d -p 29
I have only tested the programs on Raspbian.
cd /etc/init.d/ && sudo chmod 755 ssdled && sudo update-rc.d ssdled defaults && sudo systemctl start ssdled