Need help - Controlling Wifi LED


N3Cr0

Member
Joined
Mar 22, 2013
Messages
279
I want to use my Pandora for messaging, so it has to be always on line a cellphone.

Therefor I have to save some power. I have already set up a script which clocks down the CPU to OPP2/250Mhz if I push the hold-switch.

Now I want to extend this even further. I need to turn off the Wifi LED from command line.

The problem is that I have no write access to /sys/class/leds/pandora::wifi/*, no matter which permissions I set.

I guess I have to mess around with /usr/pandora/scripts/op_ledsettings.sh , but I don't even understand that script completely.
 
http://boards.openpandora.org/topic/7404-new-vs-old/?p=131624/URL]

Try this:

Is it too late to enter the coding competition? B)

It needs privileges so run from the command line:

sudo ./krled.sh.txt
 

#!/bin/bash
# Flashes four left LEDs in a back and forth sequence

D=.05 # Delay between flashes in seconds
L=5 # Number of loops
X=0
while [ $X -lt $L ]; do
echo 1 > /sys/class/leds/pandora::sd1/brightness
sleep $D
echo 0 > /sys/class/leds/pandora::sd1/brightness
sleep $D
echo 1 > /sys/class/leds/pandora::sd2/brightness
sleep $D
echo 0 > /sys/class/leds/pandora::sd2/brightness
sleep $D
echo 1 > /sys/class/leds/pandora::wifi/brightness
sleep $D
echo 0 > /sys/class/leds/pandora::wifi/brightness
sleep $D
echo 1 > /sys/class/leds/pandora::bluetooth/brightness
sleep $D
echo 0 > /sys/class/leds/pandora::bluetooth/brightness
sleep $D
echo 1 > /sys/class/leds/pandora::wifi/brightness
sleep $D
echo 0 > /sys/class/leds/pandora::wifi/brightness
sleep $D
echo 1 > /sys/class/leds/pandora::sd2/brightness
sleep $D
echo 0 > /sys/class/leds/pandora::sd2/brightness
sleep $D
let X=X+1
done
#restore default LED triggers
echo mmc0 > /sys/class/leds/pandora::sd1/trigger
echo mmc1 > /sys/class/leds/pandora::sd2/trigger
echo bluetooth > /sys/class/leds/pandora::bluetooth/trigger
 
Last edited by a moderator:
As I said, that doesn't work because of the permissions.

I guess it worked in previous firmwares.

Edit: 

I have rebooted now and suddenly, I can set new permissions to the brightness and trigger.

[problem solved]

Thanks.
 
Last edited by a moderator:
Yes, but that allows no automation.

Now I press one switch and the Pandora goes into a low power mode without freezing or turning off Wifi.
 
Maybe something to think about, perhaps changing for the next OS firmware release, but perhaps creating an LED group for these LED device files and give default user access to this group.
 
Last edited by a moderator:
Back
Top