• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Control the Green and Blue LEDs  (Read 8914 times)
jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« on: April 18, 2009, 07:20:25 AM »

Anyone know how to control the LEDs on the SheevaPlug?
~Joe Donth
Logged

...I've always depended on the kindness of strangers

Raśl Porcel
Global Moderator
Jr. Member
*****

Karma: 0
Posts: 68


View Profile
« Reply #1 on: April 18, 2009, 09:33:41 AM »

At the moment, only one led is controllable using the latest kernel.org kernel(2.6.30-rc1, i have no clue about the one included on the plug).
I don't know which one of both is, as in my case the Sheevaplug i got sent was a "prototype" and it has a green led and a red one. The red one is closer to where you plug the power cable.

So, the green one in my case is the only controllable, how? Having the kernel support for it, you can check it with:

Code:
# cat /sys/class/leds/plug\:green\:health/trigger
none nand-disk mmc0 timer heartbeat [default-on]

That means that the green led can be used for: heartbeat, timer(have no idea what it means), mmc0(when accessing the SD card? haven't tried) nand-disk(when accessing the NAND filesystem) none (power off) and default-on, which is whats by default.

So, for example, enabling the heartbeat thing:
Code:
# echo "heartbeat" > /sys/class/leds/plug\:green\:health/trigger

Can you paste the output of:
# ls -la /sys/class/leds/
? Just to know if the plug:green:health is the same or not.
Logged

jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« Reply #2 on: April 18, 2009, 09:49:45 AM »

<snip>
So, for example, enabling the heartbeat thing:
Code:
# echo "heartbeat" > /sys/class/leds/plug\:green\:health/trigger

Can you paste the output of:
# ls -la /sys/class/leds/
? Just to know if the plug:green:health is the same or not.

I don't have a "/sys/class/leds" path. Do I have to do something to create or init it?
Logged

...I've always depended on the kindness of strangers

Raśl Porcel
Global Moderator
Jr. Member
*****

Karma: 0
Posts: 68


View Profile
« Reply #3 on: April 18, 2009, 10:10:56 AM »

As I said, it may only work on the 2.6.30 kernel, which looks like the case Smiley
Logged

jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« Reply #4 on: April 18, 2009, 11:28:59 AM »

Thanks. I appreciate the effort.
Logged

...I've always depended on the kindness of strangers

Blazer
Newbie
*

Karma: 0
Posts: 21


View Profile
« Reply #5 on: April 25, 2009, 01:20:03 AM »

I gave that a try (echo "heartbeat" > /sys/class/leds/plug\:green\:health/trigger) and it does indeed work, makes my blue LED blink like a heartbeat. I am running 2.6.30-rc1

I also noticed that putting it in heartbeat mode simply toggles /sys/class/leds/plug:green:health/brightness between 0 and 255

root@debian:~# cat /sys/class/leds/plug\:green\:health/brightness
0
root@debian:~# cat /sys/class/leds/plug\:green\:health/brightness
255

So I guess if you wanted to control the LED with a script you could simple alter the brightness, or toggle the trigger between none and on.
Logged

jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« Reply #6 on: April 25, 2009, 07:07:01 AM »

Anyone know how to upgrade the SheevaPlug kernel to 2.6.30?
Logged

...I've always depended on the kindness of strangers

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #7 on: April 25, 2009, 07:29:25 AM »

To upgrade to 2.6.30 read the readme http://sheeva.with-linux.com/sheeva/README-2.6.30-rc2
Then download the readme to the sheeva.  Then run it (don't forget to set the U-Boot args.  I linked the rc2 rather than the rc3, since rc3 has some minor issues that should be fixed in rc4.


Here's a thread on the topic.

http://openplug.org/plugforum/index.php?topic=145.0
Logged

jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« Reply #8 on: April 25, 2009, 09:42:51 AM »

Thank you very much for the info.

I'll try this later this weekend and post my results.

ADDED: I just took a look at the bootargs setting in the README:

# setenv bootargs rootfstype=jffs2 console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=192.168.1.9:192.168.1.4:192.168.1.4:255.255.255.0:DB88FXX81:eth0:none

Can someone explain the "ip" pieces of this for me? I don't recall seeing this before in other bootargs settings (and I admit I know nothing about u-boot - I'm just following other leads by rote.).

Thanks,
~Joe


« Last Edit: April 25, 2009, 09:56:57 AM by jdonth » Logged

...I've always depended on the kindness of strangers

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #9 on: April 25, 2009, 10:01:43 AM »

Actually the ip args are only applicable if you are mounting root over nfs.  So they shouldn't be important in your case.  The first IP address is the IP you want assigned to the sheeva.  The second and third args are the ip address of the server.
Logged

jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« Reply #10 on: April 25, 2009, 12:23:28 PM »


Oops!

Tried to install the 2.6.30-rc2 and received the following errors. Do I need to resize the flash first?

Code:
root@debian:/# ./README-2.6.30-rc2
Downloading files
Extracting modules
Flashing kernel
Erasing 128 Kibyte @ 1e0000 -- 93 % complete. Cleanmarker written at 1e0000.
Image 2151884 bytes, NAND page 2048 bytes, OOB area 2048 bytes, device size 2097152 bytes
Input file does not fit into device: Success
Data was only partially written due to error
: Success
root@debian:/#

My partitions are:
Code:
root@debian:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00200000 00020000 "uImage"
mtd2: 1fd00000 00020000 "root"
root@debian:/#


Logged

...I've always depended on the kindness of strangers

Blazer
Newbie
*

Karma: 0
Posts: 21


View Profile
« Reply #11 on: April 26, 2009, 11:50:18 PM »

I had similar problems...I resized my uImage partition to 4MB so I wouldn't have any more issues.
Logged

jdonth
Jr. Member
**

Karma: 0
Posts: 75

Azle, Texas


View Profile
« Reply #12 on: April 27, 2009, 05:19:55 AM »

Do you have the procedure to resize the partition? I have been looking for it all weekend.
Logged

...I've always depended on the kindness of strangers

Pages: [1]
Print
Jump to: