Welcome! Log In Create A New Profile

Advanced

Can't change LED on GoFlex Home?

Posted by jedie 
Can't change LED on GoFlex Home?
October 19, 2010 03:07AM
I read this: http://www.plugapps.com/index.php5?title=DockStar_LED

The LED controls exists, but only one LED. The GoFlex Home has two leds:
root@GoFlexHome:~# ls /sys/class/leds/
plug:green:health

Turn one to "heartbeat" doesn't work:
root@GoFlexHome:~# echo heartbeat > /sys/class/leds/plug\:green\:health/trigger
bash: echo: write error: Invalid argument
Re: Can't change LED on GoFlex Home?
August 12, 2012 10:00PM
i have the same problem, years later :)

how to fix it?
Re: Can't change LED on GoFlex Home?
August 13, 2012 12:24AM
To turn on the green LED, add controls statements to end of your /etc/rc.local, right before exit 0, as shown below:



if [ -d /sys/class/leds/status:green:health ]; then
   echo default-on > /sys/class/leds/status:green:health/trigger
fi
if [ -d /sys/class/leds/dockstar:green:health ]; then
   echo default-on > /sys/class/leds/dockstar:green:health/trigger
   echo none > /sys/class/leds/dockstar:orange:misc/trigger
fi

if [ -d /sys/class/leds/plug:green:health ]; then
   echo default-on > /sys/class/leds/plug:green:health/trigger
fi

exit 0

To turn off the green LED during shutdown, add these to before the halt statement in your /etc/rc0.d/K07halt (depending on your Debian installation, K07 could be a different number such as K08,...), as shown below:

log_action_msg "Will now halt"

if [ -d /sys/class/leds/status:green:health ]; then
   echo none  > /sys/class/leds/status:green:health/trigger
fi

if [ -d /sys/class/leds/dockstar:green:health ]; then
   echo none > /sys/class/leds/dockstar:green:health/trigger
fi

if [ -d /sys/class/leds/plug:green:health ]; then
   echo none > /sys/class/leds/plug:green:health/trigger
fi
	
halt -d -f $netdown $poweroff $hddown

Note: the GoFlex Home does not have heartbeat LED control anymore.



Edited 1 time(s). Last edit at 08/13/2012 12:27AM by bodhi.
Re: Can't change LED on GoFlex Home?
August 13, 2012 07:05PM
actually I tried heartbeat yesterday and it was working at least for the green led
Re: Can't change LED on GoFlex Home?
August 13, 2012 07:36PM
What is your archNumber? is it 3338 ?
Re: Can't change LED on GoFlex Home?
August 14, 2012 11:30PM
3089
Re: Can't change LED on GoFlex Home?
August 14, 2012 11:48PM
Yeah, I got that from your other posts, you're actually running the GF Net using the GF Home hardware! I think that's why the heartbeat LED is available.

EDIT: strange, I don't see the heartbeat in GoFlex Net LEDs, either!



Edited 3 time(s). Last edit at 08/16/2012 03:46PM by bodhi.
Re: Can't change LED on GoFlex Home?
November 29, 2012 09:51PM
On the Goflex Home the white LED can be turned on to indicate that the unit has completed booting then turned off almost immediately (about 2 seconds) after issuing the reboot or shutdown command to indicate the unit is going down.

To turn on the white LED edit /etc/rc.local and add the following command at the end just before the exit 0 (as indicated in the above post):
# Turn on the white LED
echo default-on > /sys/class/leds/status:white:misc/trigger

At shutdown (rc0.d) or reboot (rc6.d) scripts will be ran. The daemons are shutdown first. The first K01 script alphabetically listed (There may be more than one K01 script) is the first script to be executed. They are merely links to the actual scripts located in /etc/init.d .

To turn off the white LED edit the first K01 file (/etc/rc0.d or /etc/rc6.d) and add the following command at the very top of the file just after the comments so that it is the first code excuted in the script:
# Turn off white LED
echo none  > /sys/class/leds/status:white:misc/trigger
It's also possible to blink the green LED at shutdown time by adding the following command in the stop section of the same script:
# Blink green LED
echo timer  > /sys/class/leds/status:green:health/trigger



Edited 2 time(s). Last edit at 11/29/2012 09:58PM by maihoaomv.
Re: Can't change LED on GoFlex Home?
November 30, 2012 12:30AM
> At shutdown (rc0.d) or reboot (rc6.d) scripts will
> be ran. The daemons are shutdown first. The
> first K01 script alphabetically listed (There may
> be more than one K01 script) is the first script
> to be executed. They are merely links to the
> actual scripts located in /etc/init.d .

It's best to turn of the green LED in the halt script ( /etc/rc0.d/K07halt), right before the halt command, to make sure that every thing is shutdown when you see it's off.

        log_action_msg "Will now halt"

        if [ -d /sys/class/leds/status:green:health ]; then
          echo none  > /sys/class/leds/status:green:health/trigger
        fi

	halt -d -f $netdown $poweroff $hddown


> It's also possible to blink the green LED at
> shutdown time by adding the following command in
> the stop section of the same script:
>
> # Blink green LED
> echo timer  >
> /sys/class/leds/status:green:health/trigger
>

Nice!



Edited 1 time(s). Last edit at 11/30/2012 12:32AM by bodhi.
Re: Can't change LED on GoFlex Home?
December 01, 2012 04:00PM
I set up the green LED as you suggested. I was manipulating the white LED on the GoFlex Home as a fully booted status indicator. Works great actually.

I do have a question. Is it possible to set the blink rate of the timer? The blink rate is about 1 second on and 1 second off. I would like to switch it to something a little bit faster, like half a second on/off.
Re: Can't change LED on GoFlex Home?
December 01, 2012 04:59PM
@maihoaomv,

Yes, the Debian wheezy kernel has configuration options for LEDs controls that includes timer delay_on and delay_off (you can make the heartbeat go faster with it). So if the kernel you're running has that turned on, then those will exists under /sys/class/leds/. Which Debian version you're running? do you see delay_on delay_off anywhere in the LED subdirectory "/sys/class/leds/status:green:health:" ?

I recalled the stock Debian armel kernel have them configured as modules, not compiled into the kernel. So it will not be available at boot time. I have not tried to bring back the delay_on delay_off controls for my plugs, but I'll take look into that and post back.
Re: Can't change LED on GoFlex Home?
December 01, 2012 11:55PM
@maihoaomv,

Activating the timer will cause delay_on and delay_off controls to be created.

echo timer > /sys/class/leds/status:green:health/trigger
echo n > /sys/class/leds/status:green:health/delay_on
echo n > /sys/class/leds/status:green:health/delay_off

where n is number of milliseconds.

So when n is smaller, the blinking is faster, I assume.
Re: Can't change LED on GoFlex Home?
December 02, 2012 10:26PM
Thanks bodhi, it worked like a charm. I've got this thing pretty much configured the way I want and with OMV installed I'm a happy camper.
Re: Can't change LED on GoFlex Home?
December 02, 2012 11:27PM
Cool!

For future reference: the LED timer, along with other LED controls were actually compiled into the kernel. However, some LED controls are included as modules. For example, my wheezy installation has ledtrig-heartbeat as module (see under /lib/modules).

To use those controls, we can do a modprobe, and then set the value:

modprobe ledtrig-heartbeat
# after this, the trigger file now has hearbeat as an available toggle, so turn on the heartbeat:
echo heartbeat > /sys/class/leds/status:green:health/trigger
Re: Can't change LED on GoFlex Home?
January 05, 2013 03:11PM
Yes, you must load the heartbeat module if you would like the double pulse that it provides.

Really the whole LED system is VERY easy to use and understand using simple 'ls' command to list the directory /sys/class/leds/

You will see the available LEDs. For GoFlex Home this should be all three LEDs (the upper combo orange/green LED (where orange overrides green) and the lower white LED (which seems often forgotten)):
$ ls /sys/class/leds/
status:green:health  status:orange:fault  status:white:misc

if you then list one of the leds you will find that there are a bunch of files there.
$ ls /sys/class/leds/status\:green\:health
brightness  device  max_brightness  power  subsystem  trigger  uevent
Unfortunately a lot of things listed there do not work. This also shows that my current configuration does not allow you to control the timing of led flashes (when you use 'timer' as the trigger mode) because there are no 'delay_on' and 'delay_off' directories (which are provided by the ledtrig-transient module).

so let us see what is inside of trigger to finally reveal the goodness:
$ cat /sys/class/leds/status\:green\:health/trigger
[none] nand-disk timer default-on heartbeat

Here is the magic. This is a listing of the ways that you can set the physical LED to behave. In order to select one you use the well documented method of echoing and piping it into the file. i.e.
# echo timer > /sys/class/leds/status\:green\:health/trigger
Re: Can't change LED on GoFlex Home?
January 06, 2013 02:49AM
To use the delay_on delay_off, turn on timer first
echo timer > /sys/class/leds/status\:green\:health/trigger

after the timer is on, both delay_on and delay_off will be created and the durations can be adjusted.

See this post above http://forum.doozan.com/read.php?2,1764,10787#msg-10787



Edited 1 time(s). Last edit at 01/06/2013 02:50AM by bodhi.
Re: Can't change LED on GoFlex Home?
January 07, 2013 04:03AM
I don't have the timer module :(
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: