DietPi
DietPi copied to clipboard
NanoPi R5S | Fix Ethernet LED triggers
Creating a bug report/issue
Required Information
- DietPi version |
cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=7
G_DIETPI_VERSION_RC=1
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
- Distro version |
echo $G_DISTRO_NAME $G_RASPBIAN
bullseye
- Kernel version |
uname -a
Linux DietPi 5.10.110 #81 SMP Mon Jul 4 15:26:21 CST 2022 aarch64 GNU/Linux
- SBC model |
echo $G_HW_MODEL_NAME
or (EG: RPi3)NanoPi R5S (aarch64)
- Power supply used | (EG: 5V 1A RAVpower)
5V 2A
- SD card used | (EG: SanDisk ultra)
None
Additional Information (if applicable)
- Software title | (EG: Nextcloud)
dietpi-config
- Was the software title installed freshly or updated/migrated?
Installed freshly
- Can this issue be replicated on a fresh installation of DietPi?
Yes
Steps to reproduce
-
sudo dietpi-config
- select 14: LED Control
- set [netdev] for LEDs
Expected behaviour
- LEDs should be turn on when ethernet works.
Actual behaviour
- LEDs not turn on at all.
Extra details
- Refering from NanoPi R5S wiki,
trigger
device_name
link
files must be set properly.
echo netdev > /sys/class/leds/wan_led/trigger
echo eth0 > /sys/class/leds/wan_led/device_name
echo 1 > /sys/class/leds/wan_led/link
echo netdev > /sys/class/leds/lan1_led/trigger
echo eth1 > /sys/class/leds/lan1_led/device_name
echo 1 > /sys/class/leds/lan1_led/link
echo netdev > /sys/class/leds/lan2_led/trigger
echo eth2 > /sys/class/leds/lan2_led/device_name
echo 1 > /sys/class/leds/lan2_led/link
- However, dietpi-config set
trigger
file only and LEDs do not work properly.
dietpi@DietPi:~$ cd /sys/class/leds/wan_led
dietpi@DietPi:/sys/class/leds/wan_led$ cat trigger
none rc-feedback rfkill-any rfkill-none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock test_ac-online test_battery-charging-or-full test_battery-charging test_battery-full test_battery-charging-blink-full-solid test_usb-online mmc0 timer oneshot heartbeat gpio cpu cpu0 cpu1 cpu2 cpu3 default-on panic mmc2 [netdev]
dietpi@DietPi:/sys/class/leds/wan_led$ cat device_name
dietpi@DietPi:/sys/class/leds/wan_led$ cat link
0
dietpi@DietPi:/sys/class/leds/wan_led$
- If I set other files (
device_name
andlink
) manually, LEDs work.
Many thanks for your report.
/sys/class/leds/*_led/trigger
is set to something functional by default, isn't it? So we can add a udev rule to our R5S image which sets device_name
and link
OOTB, and leave the trigger to be set by dietpi-led_control
, just to cover the rare case that users want to have them blinking on something different then netdev
.
Added with: https://github.com/MichaIng/DietPi/commit/ce358db Image will be rebuild after release within the next two hours.