Turn blue/green led off on cubieboard

If you have your cubieboard stable and do not like the led to blink, you can turn it off.

Basic explanation is in linux-sunxy site.

You can turn leds off by setting brightness to 0 for blue and also for green led (as root).

sudo su -root 
echo 0 > /sys/class/leds/green:ph20:led1/brightness
echo 0 > /sys/class/leds/blue:ph21:led2/brightness

Put that 2 lines into /etc/rc.local so it will stay also after reboot.

If you want to for example blink a blue led:

echo timer > /sys/class/leds/blue:ph21:led2/trigger

To get all available triggers type:

 cat /sys/class/leds/blue:ph21:led2/trigger

 

Creating a root script

Under root, you can create a script that will change the LED blinking so you can then only use sudo and do not have to run it as root.
Become  a root:
 sudo su - root
I created  a file change_led with permission chmod 750:
#!/bin/bash
if [ "$#" -ne 2 ] ; then
    echo "$0: exactly 2 arguments expected"
    echo "Please use one of the following:"
    cat /sys/class/leds/blue:ph21:led2/trigger
    echo
    echo "for blue or green LED."
    echo "sample: change_led blue timer"
    echo
    exit 1;
fi
LED=""
if [ "$1" == "blue" ]; then
    LED="blue:ph21:led2"
fi
if [ "$1" == "green" ]; then
    LED="green:ph20:led1"
fi
echo $2 > /sys/class/leds/$LED/trigger
Now I can just execute the script logged as a user with sudo rights and not directly a root:
sudo /root/change_led blue heartbeat

 

Change the Led status from GUI

There is a nice script In Cubieforum that enables you to change the LED status from the simple terminal GUI. The script is available in this post: LED trigger manipulator with GUI – script

 


Related Posts

Cubieboard2 – Lubundu – Extending NAND from 2GB to 4GB

When I install new Lubuntu NAND image to my new Cubieboard2 I had only 2GB of space out of 4GB available. I followed this forum to expand the filesystem to 4GB. sudo nand-part In my[…]

Continue reading ...

Cubieboard and 2.00mm vs 2.54mm pins

Cubieboard has thickness 2.00mm 2×20-pin-header that is not so suitable for home hobbiest. Arduino and other small boards uses 2.54mm pin (0.100inch) To connect it I have bought 2.00mm to 2.54mm 40pcs Wire Cable 2P[…]

Continue reading ...

I2C on Cubieboard with Lubuntu

I2C bus is used by many integrated circuits and is simple to implement. Any microcontroller can communicate with I2C devices even if it has no special I2C interface so I wanted to enable I2C also[…]

Continue reading ...