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.