armbian / documentation

Armbian Linux Documentation
https://docs.armbian.com
GNU General Public License v3.0
184 stars 175 forks source link

topic: On-board LED modes #97

Closed lanefu closed 1 year ago

lanefu commented 4 years ago

quick overview on how to interact and work with /sys/class/led

EvilOlaf commented 4 years ago

I mostly do this the noob way:

du -a /sys|grep led|grep trigger
echo heartbeat > /sys/whatever/led/i/need/trigger

🤦

lanefu commented 4 years ago

yeah same here... people seem to ask about it, so thought at least some basic instructions would help.

also my real dream is that it's an armbian-config feature

https://armbian.atlassian.net/browse/AR-449

EvilOlaf commented 3 years ago

I usually only use on, off or heartbeat on red/green led. I don't know on which familiy more stuff is possible and don't even know what stuff this might be like using led to monitor disk/net activity, cpu usage or whatever...

igorpecovnik commented 3 years ago

Is this standardised enough across different hardware? This could be added rather to armbian-config, but well if there are few lines in the docs, it can't hurt.

EvilOlaf commented 3 years ago

From my guts feel no. At least OPis have orangepi as string somewhere in the path to the led trigger files. Did not have a chance yet to compare. I'll get to it this weekend hopefully. Have an H3, H6 and RK3399 up to check

EvilOlaf commented 3 years ago

Nanopi R4S:

0   ./devices/platform/gpio-leds/leds/status_led/trigger
0   ./devices/platform/gpio-leds/leds/lan_led/trigger
0   ./devices/platform/gpio-leds/leds/wan_led/trigger

Orange Pi One Plus:

0   ./devices/platform/leds/leds/orangepi:red:power/trigger
0   ./devices/platform/leds/leds/orangepi:green:status/trigger

Orange Pi One:

0   ./devices/platform/leds/leds/orangepi:red:status/trigger
0   ./devices/platform/leds/leds/orangepi:green:pwr/trigger
paolosabatino commented 3 years ago

Setting the led at startup is a feature I miss a lot, so I propose myself to make the necessary configuration section to armbian-config and other changes/scripts to make it work.

Names are not standardized at all. So my idea would be to propose, as a list, all the content of /sys/class/leds to the user (maybe filter out the input devices leds), and let the user choose the led she wants to configure.

There are also extended options for some specific triggers that can be dealt with. For example, the timer trigger spawns two other filesystem objects that control the on time and the off time. I would ignore these extended configurations options for now.

lanefu commented 3 years ago

@EvilOlaf

is this helpful?

https://armbian.lane-fu.com/linx/0ql9mql4.txt

EvilOlaf commented 3 years ago

Yes and no. It is another confirmation that there is no standardization between SoCs...