1

Everything seems to be working as expected, but the green LED flashes briefly every 400-500 ms.

The system is not under heavy load (almost completely idle, ssh service running without users logged in).

1
  • 1
    Mine flashes the whole time.. everything works fine though. I thought that was normal? :D
    – Piotr Kula
    Jan 9, 2017 at 12:46

4 Answers 4

2

Green LED is flashing because by default it is used for heartbeat that the RPi/BPi performs correctly. You can change it's behavior by setting the proper file to a specific value.

For example to turn off green LED completly you have to issue command:

echo none > /sys/class/leds/bananapi:green:usr/trigger

Also in this file you can set the value to mmc0 that it will react upon every read/write operation on SD card.

For Raspberry Pi in this case the file is in another folder. The common is only /sys/class/leds/.

In trigger file you will find available options.

You can set this value in /etc/rc.local file at its end to change LED behavior every time the system boots.

2

Green LED is just as the same as the Hard Drive status LED on your PC. Instead here it is used to monitor the SD card. LED flashes when the OS read or write to the SD card. It can be pretty useful as sometime we can know the response of raspberry pi during headless mode.

2

Possibly normal if it's a very brief flash. I'm surprised you notice the flash, most people don't.

The system checks (presumably) twice a second to see if an SD card is present.

See https://www.raspberrypi.org/forums/viewtopic.php?p=681761#p681761

2
  • 1
    Mine flashes the whole time.. It is pretty noticeable its about 100ms darkness or longer. You sure you not thinking about another LED? (with power problems)
    – Piotr Kula
    Jan 9, 2017 at 12:47
  • 2
    @ppumkin By default the activity LED will flash whenever the SD card is accessed. I have assumed the questioner was not expecting the flashes which led me to think about unexpected SD card accesses.
    – joan
    Jan 9, 2017 at 13:48
1

This will happen if you don't have an SD card inserted; for example, if you are booting from USB or network.

Not only does the LED blink, but it also consumes a small amount of system resources polling the (non-existent) SD card.

You can prevent this behavior by adding the following to the bottom of your /boot/config.txt file:

dtparam=sd_poll_once

The OS will look for an SD card during boot and make it available. But if a card isn't found it will disable the SD card interface.

This is the recommended method, instead of the earlier, deprecated dtoverlay=sdtweak,poll_once.


In addition, you can repurpose the LED. See the possible options like so:

$ cat /sys/class/leds/led0/trigger 
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 cpu1 cpu2 cpu3 default-on input panic actpwr
[mmc0] rfkill-any rfkill-none

Note that 'mmc0' is selected. To change the LED's trigger to 'heartbeat', for example:

sudo sh -c "echo heartbeat > /sys/class/leds/led0/trigger"

Two things to note:

  1. This change doesn't persist after reboot. You could add the command to a startup script.
  2. Use the earlier dtparam command to disable the polling, even if you are going to choose a new LED trigger. It saves resources.

From /boot/overlays/README, regarding base parameters:

Name:   <The base DTB>
Info:   Configures the base Raspberry Pi hardware
Load:   <loaded automatically>
Params:

sd_poll_once    Looks for a card once after booting. Useful
                for network booting scenarios to avoid the
                overhead of continuous polling. N.B. Using
                this option restricts the system to using a
                single card per boot (or none at all).
                (default off)

From further in the same file, regarding overlays:

Name:   sdtweak
Info:   This overlay is now deprecated. Use the sd_* dtparams in the
        base DTB, e.g. "dtoverlay=sdtweak,poll_once" becomes
        "dtparam=sd_poll_once".
Load:   <Deprecated>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.