FORUMS
Remove All Ads from XDA

[LED][DEV] Moto E LED Custom Controls

3,303 posts
Thanks Meter: 4,680
 
Post Reply Email Thread
Playing With Notification LED
Original source (for MotoG) <<< make sure you read the blog article before commenting ....
dedicated Blog article for MotoE

It's always cool to know at a glance that your device is charging without the need of lighting the screen, here is how:

Requirements :
  • Moto E (tested on XT1022)
  • Rooted
  • SU rights granted
  • adb if you want to monitor all this from a computer

Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards, BURNT LEDs,
* thermonuclear war, or you getting fired because the alarm app failed.
* YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
in /sys/class/leds/charging/trigger we have these triggers available :
Code:
[none] bkl-trigger usb-online mmc0 mmc1 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid bms-online
easy to change them using :
Code:
echo battery-charging >/sys/class/leds/charging/trigger
needs to set any value !=0 for brightness (LED is either ON or OFF on MotoE):
Code:
echo 1 >/sys/class/leds/charging/trigger
Moto E (is quite different than Moto G MotoG has two LEDs too, they are simply impossible to see):
If you pay attention, you can se that Moto E has Two little white LEDs soldered under the LED hole, the first one (left) is ruled by /sys/class/leds/charging and the second one (less bright, ont the right) is ruled by the /sys/class/leds/white.

/sys/class/leds/white/trigger, and /sys/class/leds/white/brightness configure the right LED and these settings are overridden has soon as a notification comes.

/sys/class/leds/charging/trigger and /sys/class/charging/brightness configure the left LED (the brighter one) and these settings are not overridden by notifications AND both can work toghether:
You can see the left one kept ON while charging (using battery-charging trigger) and the right one Blinking with an incoming notification.


It is time for the community to help, and we will find out a way to correctly dim the LEDs if possible.

For now, the best way is to set left LED (/sys/class/leds/charging/) for charging using dedicated trigger and keeping the right one to none and get both working together this way.

______________________________


Set at boot:
WARNING : if you fail this, you may screw up your device ... (keep a backup somewhere)
  1. Create a blank file and name it like 99charging_LED-blink
  2. paste the following in that file :
    Code:
    #!/system/bin/sh
    # enabling charging LED blinking while charging
    echo "battery-charging-blink-full-solid" >/sys/class/leds/charging/trigger
    echo "1" >/sys/class/leds/charging/brightness
  3. mount /etc/init.d as RW
  4. Paste 99charging_LED-blink there
  5. set permissions as -RWXR-XR-X
  6. Open terminal emulator, and type :
    Code:
    su
    sh /etc/init.d/99charging_LED-blink
    Plug it to charger, it should start blinking ... if not, make sure everything is correctly set
  7. Reboot
  8. Enjoy!

______________________________


For whose who asked, here is the proof of the 2 LEDs and their White-color :
http://forum.xda-developers.com/showpost.php?p=57039807&postcount=7


Feel free to test further and report your discoveries!
The above has been tested on stock rooted ROM, and reported to work on CM11-m12, both on XT1022.

Here is the LED related Thread for MotoG

XDA:DevDB Information
[LED][DEV] Moto E LED Custom Controls, Tool/Utility for the Moto E

Contributors
matmutant

Version Information
Status: Testing

Created 2014-11-24
Last Updated 2014-12-15
The Following 16 Users Say Thank You to matmutant For This Useful Post: [ View ] Gift matmutant Ad-Free
 
 
g33kparineeti
24th November 2014, 05:34 PM |#3  
Guest
Thanks Meter: 0
 
More
Thumbs up
@matmutant Epic discovery sir..
The Following User Says Thank You to For This Useful Post: [ View ] Gift Ad-Free
25th November 2014, 02:37 AM |#4  
AshuGite's Avatar
Senior Member
Flag Off the Edge!!!
Thanks Meter: 179
 
More
tried this in trickster mod led control... but since the left one is so bright it overrides the indication of the right..i.e the change in the blinking intensity is not visible until observed closely...
25th November 2014, 08:08 AM |#5  
matmutant's Avatar
OP Recognized Contributor
Flag ~/
Thanks Meter: 4,680
 
More
Quote:
Originally Posted by AshuGite

tried this in trickster mod led control... but since the left one is so bright it overrides the indication of the right..i.e the change in the blinking intensity is not visible until observed closely...

In fact, you should use the following :
Code:
echo battery-charging-blink-full-solid >/sys/class/leds/charging/trigger
This way the brighter will blink during charge, so the notification LED will be visible too (that's not the same blink pattern so it gives an irregular blink feeling)

Of course, i have no idea why there are 2 LEDs, and if lighting the brighter one will burn it or not : i'm going to add a disclaimer to OP since this mod has potential consequences on Hardware.

Thank you for your report, may i ask you your device and ROM?
25th November 2014, 09:17 AM |#6  
AshuGite's Avatar
Senior Member
Flag Off the Edge!!!
Thanks Meter: 179
 
More
Quote:
Originally Posted by matmutant

In fact, you should use the following :

Code:
echo battery-charging-blink-full-solid >/sys/class/leds/charging/trigger
This way the brighter will blink during charge, so the notification LED will be visible too (that's not the same blink pattern so it gives an irregular blink feeling)

Of course, i have no idea why there are 2 LEDs, and if lighting the brighter one will burn it or not : i'm going to add a disclaimer to OP since this mod has potential consequences on Hardware.

Thank you for your report, may i ask you your device and ROM?


same results on cm11 m12 and stock 4.4.4 in XT1022
The Following User Says Thank You to AshuGite For This Useful Post: [ View ] Gift AshuGite Ad-Free
25th November 2014, 04:28 PM |#7  
matmutant's Avatar
OP Recognized Contributor
Flag ~/
Thanks Meter: 4,680
 
More
For whose who asked :
I was able to show that our MotoE has 2 LEDs (until now it was only a high suspicion) and that they are really White and not mis-configured RGB.

Here is the in-depth proof.
The Following User Says Thank You to matmutant For This Useful Post: [ View ] Gift matmutant Ad-Free
26th November 2014, 01:42 AM |#8  
If only we could change their color.

Sent from my GT-I9070
26th November 2014, 05:40 AM |#9  
svprm's Avatar
Senior Member
Flag Coimbatore
Thanks Meter: 432
 
Donate to Me
More
Is this working?
Because i have planned to make app for this.
The Following User Says Thank You to svprm For This Useful Post: [ View ] Gift svprm Ad-Free
26th November 2014, 06:39 AM |#10  
matmutant's Avatar
OP Recognized Contributor
Flag ~/
Thanks Meter: 4,680
 
More
Quote:
Originally Posted by svprm

Is this working?
Because i have planned to make app for this.

Sure it works

Two steps are needed to set up each LEDs :

The Brighter One:
Code:
echo battery-charging-blink-full-solid >/sys/class/leds/charging/trigger
Code:
echo 1 >/sys/class/leds/charging/brightness
The 'notification' One (better keep it to trigger=none, so it will keep its role of notification LED), but if you wanna play with it:
Code:
echo battery-charging-blink-full-solid >/sys/class/leds/white/trigger
Code:
echo 1 >/sys/class/leds/white/brightness
Contrary to MotoG, i couldn't dim this LED by setting 0~255 for brightness

There might be a way to trigger flash LED when getting notification, but this is not for Moto E either


if you make an app for this we could share this thread as co-contributors and in-depth study these new possibilities
The Following User Says Thank You to matmutant For This Useful Post: [ View ] Gift matmutant Ad-Free
26th November 2014, 06:26 PM |#11  
Senior Member
Flag vidhya nagar
Thanks Meter: 127
 
More
If we can change colour, it will be too good

Sent from my XT1022 using xda premium
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes