I have found code in /var/www/command/worker.php, that deals with activity LED.
It looks ok to me, but it doesn't put expected values into trigger and brightness.
After setting LED0 ON it goes out:
Code:
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
[none] rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 mmc0 rfkill-any rfkill-none rfkill0
0
After setting LED0 OFF it lights up.
Code:
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
[none] rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 mmc0 rfkill-any rfkill-none rfkill0
255
None state shows SD access.
I think trigger and brightness aren't independent.Writing to '0' brightness sets trigger to none. And after setting trigger to mmc0, writing 1 to brightness is ignored.
See all combinations:
Code:
pi@moode:~ $ echo mmc0 | sudo tee /sys/class/leds/led0/trigger
mmc0
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
none rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 [mmc0] rfkill-any rfkill-none rfkill0
0
pi@moode:~ $ echo 0 | sudo tee /sys/class/leds/led0/brightness
0
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
[none] rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlockkbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 mmc0 rfkill-any rfkill-none rfkill0
0
pi@moode:~ $ echo mmc0 | sudo tee /sys/class/leds/led0/trigger
mmc0
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
none rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 [mmc0] rfkill-any rfkill-none rfkill0
0
pi@moode:~ $ echo 1 | sudo tee /sys/class/leds/led0/brightness
1
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
none rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 [mmc0] rfkill-any rfkill-none rfkill0
0
pi@moode:~ $ echo none | sudo tee /sys/class/leds/led0/trigger
none
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
[none] rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlockkbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 mmc0 rfkill-any rfkill-none rfkill0
0
pi@moode:~ $ echo 1 | sudo tee /sys/class/leds/led0/brightness
1
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
[none] rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlockkbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 mmc0 rfkill-any rfkill-none rfkill0
255
pi@moode:~ $ echo mmc0 | sudo tee /sys/class/leds/led0/trigger
mmc0
pi@moode:~ $ cat /sys/class/leds/led0/trigger; cat /sys/class/leds/led0/brightness
none rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 default-on input panic actpwr mmc1 [mmc0] rfkill-any rfkill-none rfkill0
0
pi@moode:~ $
Summary: writing "none" or "mmc0" to trigger controls activity function, brightness is automatically set to "0". When trigger is 'none', one can write "1" to brightness, which turns on the LED permanently.
My suggestion is to treat activity led on RPi Zero the same way as other boards. Actually my RPi Zero is "Pi-Zero W 512MB v1.1", I don't know about other Zero versions.