## apu-led-button

Linux kernel module for PC Engine's APU system board to add heartbeat and timer trigger to the three front LEDs. Originally published [here](https://github.com/trick77/apu-led-button) and slightly modified for Kali 2023 (Kernel 6.5.0.-kali2-amd64) and newer. 

After the installation, the first LED will indicate if the system is up using ledtrig-timer. You could also use ledtrig-heartbeat instead if you prefer a more active status LED. The second and third LED will act as RX/TX indicators for the network port of your choice. The configuration sample below uses eth1 because it's the WAN port in my setup.

See [here for more trips and tricks for the APU](https://github.com/trick77/apu-led-button).

## Installation

```
# sudo apt-get install linux-headers-$(uname -r) build-essential
# git clone https://github.com/trick77/apu-led-button
# cd apu-led-button
# make && sudo make install
```

(as root)
```
# echo "ledtrig-timer" >> /etc/modules
# echo "ledtrig-heartbeat" >> /etc/modules
```

## Sample configuration

Insert these lines to any start script:

```
echo "timer" > /sys/class/leds/apu\:1/trigger
echo "1750" > /sys/class/leds/apu:\1/delay_on
echo "250" > /sys/class/leds/apu\:1/delay_off
/usr/local/sbin/apuled eth1 -c nrt -f
```

...and reboot.

The LEDs trigger capabilities are listed in <code>/sys/class/leds/apu\:1/trigger</code> with the currently active trigger marked in brackets.

<pre>
# cat /sys/class/leds/apu\:1/trigger
none usb-gadget usb-host cpu0 cpu1 [timer] rfkill0 phy0rx phy0tx phy0assoc phy0radio phy0tpt heartbeat
</pre>

## License
* Copyright &copy; 2014, Mark Schank
* Copyright &copy; 2013, Christian Herzog
modified by Tim Brockmann (University of Rostock)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.