Jump to content

The LED1 and LED2 on the BanabaPi Pro. How do I get them to show MMC card usage and the watchdog heart beat?


Myron
Go to solution Solved by Werner,

Recommended Posts

Hello all. A possible mission impossible challenge for someone who wishes to accept it and this message will not self-destruct in 10 seconds.  :-)

The LED1 (green) and LED2 (blue) on the BanabaPi Pro. How do I get them to show the watchdog heart beat and the MMC card usage?

 

An out-of-date Rasbian Distro for the Lemaker BananaPi Pro had this feature this right-out-of-the-box, but at the moment on Armbian I've only got the steady red power LED. Is there a way to enable this functionality within Armbian?

Link to comment
Share on other sites

  • Solution

I usually do the noob way finding the trigger files for LEDs :P

du -a /sys | grep led | grep trigger

 

I don't know what trigger is needed for mmc but heartbeat is self-explaining. echo heartbeat > trigger

 

 

Link to comment
Share on other sites

10 hours ago, Werner said:

I don't know what trigger is needed for mmc but heartbeat is self-explaining. echo heartbeat > trigger

 

Pssst ... If you cat the trigger file, it'll tell you the valid options, and which one is currently selected.

 

tparys@laptop:~$ cat /sys/class/leds/input4\:\:capslock/trigger 
none usb-gadget usb-host 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 ACAD-online BAT0-charging-or-full
BAT0-charging BAT0-full BAT0-charging-blink-full-solid disk-activity disk-read disk-write
ide-disk mtd nand-disk cpu cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7 panic mmc0 rfkill0
phy0rx phy0tx phy0assoc phy0radio rfkill1 audio-mute audio-micmute 

 

I'd wager the correct trigger is "mmc0", unless there's a both a SD card and eMMC slot on that board?

Link to comment
Share on other sites

19 hours ago, Myron said:

The LED1 (green) and LED2 (blue) on the BananaPi Pro. How do I get them to show the watchdog heart beat and the MMC card usage?

 

on my BananaPi M1 I can only control the green LED, but for that usage I do use the following command-line:

echo 'mmc0' > /sys/class/leds/bananapi:green:usr/trigger


only green LED available:
# ls -l  /sys/class/leds/

lrwxrwxrwx 1 root root 0 Sep 11 22:11 bananapi:green:usr ->  ./../devices/platform/leds/leds/bananapi:green:usr

 

Link to comment
Share on other sites

Thank-you.  I have got a lot to learn and at the moment my learning curve is as steep as a Saturn 5 rocket blasting off and going into orbit.  I am self-educating way more than I am asking questions.

 

echo heartbeat > /sys/devices/platform/leds/leds/bananapro:blue:usr/trigger
echo mmc0 > /sys/devices/platform/leds/leds/bananapro:green:usr/trigger

 

Erm.....  {sheepish look to my face and batting eyelids . . . .}  How do I get this to persist across reboots, or the file I need to alter to make this the default.  :-)

 

EDIT: I think I found answer to my question.  https://smallbusiness.chron.com/run-command-startup-linux-27796.html  Is this correct?

Link to comment
Share on other sites

Thank-you everyone. I would mark multiple solutions, but the board only allows me to mark one.

I got it working. Used the cron @reboot method on user root.  The LEDs are useful where on the screen it may look like it's got stuck, the LEDs will at least show if there is some activity and if the SOC is still got a heartbeat.  I'm still a noob on the higher technical issues of Linux.  I have one more question to ask and that will be in another thread.    (Yes, I will donate!  I've seen the donate link on the Armbian home page, but as you all know, the budget that keeps the roof over the head, electricity supplied, food on the table, etc... is priority. Shall donate what I can, when I can.)

 

EDIT: I finally ended up using the /etc/rc.local method.  Thank-you @Werner and @guidol.

Link to comment
Share on other sites

15 hours ago, tparys said:

 

Pssst ... If you cat the trigger file, it'll tell you the valid options, and which one is currently selected.

 

tparys@laptop:~$ cat /sys/class/leds/input4\:\:capslock/trigger 
none usb-gadget usb-host 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 ACAD-online BAT0-charging-or-full
BAT0-charging BAT0-full BAT0-charging-blink-full-solid disk-activity disk-read disk-write
ide-disk mtd nand-disk cpu cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7 panic mmc0 rfkill0
phy0rx phy0tx phy0assoc phy0radio rfkill1 audio-mute audio-micmute 

 

I'd wager the correct trigger is "mmc0", unless there's a both a SD card and eMMC slot on that board?

Yes. I knew this.  What happened is that I totally forgot about the /sys folder and then I remember that it's quite a large tree. Didn't think about using du and grep that way.

Link to comment
Share on other sites

10 hours ago, guidol said:

 

on my BananaPi M1 I can only control the green LED, but for that usage I do use the following command-line:

echo 'mmc0' > /sys/class/leds/bananapi:green:usr/trigger


only green LED available:
# ls -l  /sys/class/leds/

lrwxrwxrwx 1 root root 0 Sep 11 22:11 bananapi:green:usr ->  ./../devices/platform/leds/leds/bananapi:green:usr

 

Yep, Working perfectly.  [Now only if I could get xdrp, X and xfce4 play nicely. That's another thread.]

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines