Thank you for your donation!


Activity LED on RPi Zero
#1
Hi all!

I'm using RPi Zero. This board has reversed control for activity LED. While Moode checks for RPi Zero and disables options for power LED, it does nothing for activity LED. The result is, that one have to enable LED in settings to turn it off on the board. It is a minor problem, I hope this can be corrected in next release of Moode.
Reply
#2
How should it be handled?
Enjoy the Music!
http://moodeaudio.org | http://twitter.com/MoodeAudio | http://github.com/moodeaudio
Reply
#3
Maybe it would be enough to revert the drawing of the "switch" on configuration screen?
Probably better would be to revert values when executing changes, but I don't know your scripts to suggest anything precise.
Reply
#4
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.
Reply
#5
I had to fire up a 0W to see the issue. Prolly some kernel change that introduced the new behavior.

I'll fix for 7.1.0.
Enjoy the Music!
http://moodeaudio.org | http://twitter.com/MoodeAudio | http://github.com/moodeaudio
Reply


Forum Jump: