led-set utility for Cobalt server

Today I release the first version of led-set for cobalt machines. Now there are some command line options, a help, getting led status on i386 based cobalt systems, support for MIPS architectures etc.

This small utility is based on the cobalt-panel-utils original provided by Sun Microsystems. This utilities are able to set the LCD of the Cobalt machines and read the Button, but not to set the extra LED some of the machine have.
I own a MIPS bases Qube2 and two i386 machines, the RaQ4r and a RaQ3. The Qube is a great small machine with low power consumption and ideal as use for a home server. The only thing which was disturbing are the bright LED bar on the front and I search for a method to switch it on or off based on the daytime. The both RaQ machines I use with out a FAN to reduce the noise, but if there is some traffic on the machines, the CPU’s may getting to hot. They have a special „Web LED“ which isn’t used outside the original software (all systems are updated to running Debian or Ubuntu in the meantime). I searched for a way to control the LED so that I can build some small hardware extension to control the fan’s, the Web LED is a perfect solution for this.

This ideas lead to this small util led-set.

installation:

The building and installing of this small utility is quite easy. The only thing you need is a GCC compiler and make tools installed. To build and install this utility just run:

# make && make install

This will build the utils and copy the executable to /bin/led-set

Usage:

The usage should not be to complicated. By running the command with the -h option you get the help of this tool:

Usage: led-set [OPTION]...

Mandatory arguments to long options are mandatory for short options too.
-s, --state       return the actual state of the LED as exit code. To display
                  the value you might use the -v|--verbose option too.
                  This is not supported on MIPS, the return will be always 0.
-h, --help        display this help and exit
-v, --verbose     switch on verbose message, e.g. when showing the LED state .
-l, --led=STATE   Set the new state for the LED as numeric value.

Possible States:
MIPS:      0    All   Switch LEDs off
           1    Qube  Front LED bar left on (COBALT_LED_BAR_LEFT = (1<<0))
           2          Front LED bar right on (COBALT_LED_BAR_RIGHT = (1<<1))
           3          Both front LED's
           4    RaQ   Web LED on (COBALT_LED_WEB = (1 << 2))
           8          Power LED off (COBALT_LED_POWER_OFF = (1 << 3))
          15    All   Reset the LED's (COBALT_LED_RESET = (0x0f))
i386:      0    All   Switch LEDs off
           1          LED_SHUTDOWN = (1 << 0)
           2          Switch on the Web LED (LED_WEBLIGHT = (1 << 1))
           3          Switch on the Cobalt/Sun Logo (LED_COBALTLOGO = (1 << 2))

WARNING: There are more possible values for controlling LED you may wish to try.
If you try them you are trying them completely on your OWN RISK! Please
keep this always in mind that this options might be dangerous.

There might additional LED’s depending on your Cobalt machine type. To get (mostly) all supported values you may need to look up the kernel sources for the cobalt drivers, specially the files ./include/asm-mips/mach-cobalt/cobalt.h or ./include/cobalt/led.h, depending on the arch type.

If you find additional combinations, please post this as comment to this Blog entry and let me know which led-state do what on which hardware (machine name and/or systype (cat /proc/cobalt/systype) on i386 machines). If you have questions, ideas or issue, please feel free to contact me too.

11 Antworten auf „led-set utility for Cobalt server“

  1. Today I’ve the chance to build and run the led-set util on a Cache RaQ 2. Build process went fine (what I suggest without real dependencies :-)) and this are the LED states which are working:

    0 = Web LED and Cobalt Logo off
    1 = Cobalt Logo on
    4 = Web LED on
    5 = Cobalt Logo and Web LED on
    
  2. I checked this tool on a RaQ 4r (systype Pacifica). Building and installing was no issue, but only to values seems to work:

    0 = Web LED off
    2 = Web LED on
    

    All other combination (2^x) do not change anything, there is no way to switch of the Logo etc.

    Also it wasn’t providing the right LED status for led-set -s -v.

  3. Good question, Hombre. I don’t know to be honest, but if the BSD kernel have support for the Cobalt LCD device and the original cobalt-lcd-utils are working, than there might be a chance to get led-set working too. But again, I don’t know.

  4. I cannot get it to untar right:

    cobalt:~# tar xjvf led-set.0.2.tar.bz2
    tar: bzip2: Cannot exec: No such file or directory
    tar: Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error exit delayed from previous errors

    Any ideas? Do you have a md5sum of the package? A direct link to the package perhaps?

    Thanx

  5. Hi Thorsten,

    It works beautifully under Debian with RAQ2.
    Now I have to find a way to make it work with lighttpd in /etc/init.d anyone a suggestion so the webled goes on when web on and off when web off?
    Thanks!

  6. Hmm, compiles with gmake on netbsd but complains of no /dev/led device.

    I presume bsd doesn’t support it?

  7. For people that like to know it, I have installed a 500GB 7200 (single drive because of PSU!), it simply works.
    No troubles at all, these tiny RAQ2 boxes simply handle very large drives without any trouble at all 🙂

    Bas.

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.