Play with Leds :
Installation procedure :
Configure the php web-server
Copy the Led Control php script and files to your Mybook
mkdir /shares/internal/PUBLIC/WWW/Welcome/LedControl
wget http://mybookworld.wikidot.com/local--files/leds/index.php -O /shares/internal/PUBLIC/WWW/Welcome/LedControl/index.php
wget http://mybookworld.wikidot.com/local--files/leds/Mbwe_OFF.jpg -O /shares/internal/PUBLIC/WWW/Welcome/LedControl/Mbwe_OFF.jpg
wget http://mybookworld.wikidot.com/local--files/leds/Mbwe_ON.jpg -O /shares/internal/PUBLIC/WWW/Welcome/LedControl/Mbwe_ON.jpg
Connect to the following url :
https://<Mybook>/LedControl
Enjoy !
Thanks to n00b32, teinturman, matemaciek and tinobruno for their help in this tuto…
History :
You can find the original noob32's php script here.
More Information :
There are many pages here with scripts, but I haven't found one explaining just "what to put where" to make LED's on. This is a short summary of what I've found out (fw v2.00.18):
The key folder is /sys/class/leds/
It containts some subfolders:
wdc-leds:transition
wdc-leds:rebuilding
wdc-leds:power
wdc-leds:over-temp
wdc-leds:ignore-act
wdc-leds:fuel-gauge
wdc-leds:fg-bitmap
wdc-leds:degraded
wdc-leds:activity
each of which containts subfolders:
brightness
device/
trigger
uevent
device is a symlink to ../../../devices/platform/wdc-leds
I haven't already found, what are trigger and uevent - there is a place for all of you to research (:
But the whole fun is with brightness file (:
Just echo something to it and watch reaction of leds. (for example: echo 63 > /sys/class/leds/wdc-leds:fg-bitmap/brightness should light the whole inner ring. Why? I'll explain (; ).
There are 4 leds at the outer ring (I'll call them N, S, W, E) and 6 leds at the inner ring.
| [folder] | [value] | effect of echo [value] > /sys/class/leds/wdc-leds:[folder]/brightness |
|---|---|---|
| ignore-act | 1 | turns on ignoring activity mode - outer ring stays on, even when the disk is active. When it's on putting something to activity/brightness is pointless |
| ignore-act | 0 | turns off ignoring activity mode |
| activity | 1 | turns outer ring S led on, after a while it slowly dims. Called once again do so with W led, next call plays with N led, another with E led, next with S and so on |
| transition | 1 | plays transition animation once |
| over-temp | 1 | turns on over-temp animation (blinking of all leds) and keeps playing it |
| over-temp | 0 | turns off over-temp animation, then plays transition animation once |
| degraded | 1 | turns on degraded animation (interchanging blinking of inner and outer ring) and keeps playing it |
| degraded | 0 | turns off degraded animation, then plays transition animation once |
| power | 0 | plays transition, then turns off all leds. They could be on for example by playing transition animation |
| power | 1 | if leds are on, then it plays transition and turns them off. Than it keeps slowly blinking outer ring. Inner ring is than repainted only while the outer ring is on |
| fg-bitmap | 6-bit value | full controll of fuel gauge - just put a 6-bit value, each bit is for one led (: |
| fuel-gauge | - | why need something more when you have fg-bitmap?* |
| rebuilding | - | sad to say, but I can see no influence on leds ): |
*A matter of fact I can't see any influence of putting something there. Maybe it's because of new firmware (2.00.18)? Some explanation can be found here: http://mybookworld.wikidot.com/forum/t-28326/mbwe-led-control
**[TINOBRUNO] i got it… the fuel-gauge stream accepts PERCENTAGE values… so you can completely light the inner ring just sending 100… or half the ring sending 50… clear enough? i think it's easier than using fg-bitmap in some circumstance…
Hope that helps (: And hope someone will find something more than this! Still controll of the outer ring is only high-level… But inner is fully yours! (God bless fg-bitmap! (; )




















