![]() |
Blink Notification led on Battery Low
Since i disabled system sounds, I often miss when the battery goes low. Unfortunately Nokia missed the opportunity to signal this with the notification LED. So here is a small hack, I may turn this into a proper daemon written in C someday, but thinking about it there is no much need for it. Note that it gets extremely rare waken up (only when battery gets low or you plug in the charger) so, by itself it needs very minimal resources, blinking the LED does not consume much power either just in case you thik about that.
I posting this here, maybe someone has use for it or may even package it (or implement it in C). There is currently one small problem that it leaves a stale process around when one stops it (busybox problem?) But since it should be started at startup and never be stopped this doesn't hurt much. Anyways If anyone fixes this, please notify me. You need to hack some upstart and/or init.d scripts to start it on boot, I don't post these here and leave that as exercise to the reader. I've also defined my own 'PatternBatteryLow' in /etc/mce/mce.ini, if you are too lazy to define your own, you may just use the error pattern which blinks red at very high priority. Code:
#!/bin/sh |
Re: Blink Notification led on Battery Low
|
Re: Blink Notification led on Battery Low
thank you cehteh for your script. I'll use it, really useful. but more important for me is to understand. please, can you explain your script? what means each code line?
eg: 1.what means com.nokia.mce, is it a web address? 2.why you didn't use a simpler one-line command like PatternbatteryLow=(code) in /etc/mce/mce.ini instead of script? we need both? what I've to write in /init.d directory? a new file or I've to modify existing mce file? please, don't forget to the newbies too and help them to understand. thank you cehteh :) |
Re: Blink Notification led on Battery Low
Quote:
otherwise this should be safe. or am I wrong? Quote:
2) you can make as many as LED pattern in mce.ini, but if nothing ever triggered it (such as "scripts"), then it'll do nothing please correct me if I'm wrong |
Re: Blink Notification led on Battery Low
This is not working for me...
|
Re: Blink Notification led on Battery Low
Quote:
have you set PatternBatteryLow in yours? if you haven't, and you don't wish to hassle with your mce.ini, change the code like below Code:
# Default error pattern is always present bit may be inapprobiate |
Re: Blink Notification led on Battery Low
I inserted PatternBatteryLow in mce.ini, no luck - I also tried changing to PatternError but still no go...
|
Re: Blink Notification led on Battery Low
try move the script to /home/user, and run it using X-Term and see if it works
it should not print anything unless triggered by battery low notification or changer being connected. if you see some lines while running the script, there might be an error while copying the code please also make sure that "/com/nokia/mce/request" and "com.nokia.mce.request.req_led_pattern_activat e/deactivate" are in the same line (the code on my browser, it looked as if they're on different lines). or add trailing backslash after "/com/nokia/mce/request" (there are 2 of them, change both) Code:
dbus-send --system --dest="com.nokia.mce" --type=method_call \ |
Re: Blink Notification led on Battery Low
Quote:
If there is no PatternBatteryLow in mce.ini, the package postinst will add it using mceledpattern and restart MCE. |
Re: Blink Notification led on Battery Low
A lot of these small daemons can be translated into scripts that run on dbuscron, it would be a lot easier to manage and might reduce ticks.
Just an observation. |
Re: Blink Notification led on Battery Low
oohh very useful app, thanks hawaii. I wanted to laugh at these guys with "low battery scripts" that cause a low battery...
|
Re: Blink Notification led on Battery Low
thanks, i added the dbus send to my battery script from my battery test thread, now i can really see when battery is LOW!!! :)
but mine is of course more accurate that relaying on the BME that sometimes goes nuts on my phone since i externally charge my battery while in the phone (again see first posts on the battery thread) When disabling the battery icon on the desktop area you don't get any warning off low battery so this helps that i blinks to "patternerror" when my battery meter hits the low REAL 5% |
Re: Blink Notification led on Battery Low
Ideally, like mentioned before - we could use 'breathing' to show levels of battery. This would also be better useful than advising when the device has such a low battery, that's is almost useless. 5% and you're screwed anyways.
White to a white yellow, then to a white red fading would be fine, trigger only when the device is locked and updated every 30 minutes. Easily achievable with EITHER dbuscron on camped triggers or using fcron on intervals. |
Re: Blink Notification led on Battery Low
Quote:
Quote:
didn't notice it until you said it :D |
Re: Blink Notification led on Battery Low
Quote:
http://talk.maemo.org/showthread.php?p=940892 |
Re: Blink Notification led on Battery Low
Quote:
A few questions though; Is this the most efficient way of doing this? Is this way more efficient than the script (or is it exactly the same)? Does the daemon only activate when triggered by the low battery or is it always running? Thanks. |
Re: Blink Notification led on Battery Low
Quote:
works brilliant. ;) Greetz, ..::J4ZZ::.. |
Re: Blink Notification led on Battery Low
Quote:
After downloading the MeeGo mce from http://meego.gitorious.org/meego-middleware/mce and applying the patch below, I ran "make modules/libbattery.so" and put the result into /usr/lib/mce/modules. It seems to work, but I'm still waiting for the next battery_low signal to verify. Code:
diff --git a/modules/battery.c b/modules/battery.c Quote:
|
Re: Blink Notification led on Battery Low
Quote:
|
Re: Blink Notification led on Battery Low
bump on the question?:o
|
Re: Blink Notification led on Battery Low
Great project!
I installed it, but couldnt test it yet as my battery ist still full. |
Re: Blink Notification led on Battery Low
Quote:
Then you would know that it is hard work! BTW: Don't expect help if you don't get nicer! People writing software invest a big part of their free time for it. |
Re: Blink Notification led on Battery Low
Quote:
|
Re: Blink Notification led on Battery Low
Quote:
|
Re: Blink Notification led on Battery Low
Quite nice idea, I quickly went through the thread. Has anyone contacted the host of LED Patterns and/or Community SSU, since those two, as far as I know, are both doing minor mods to the notification lights? I'd recon, that the first one (LED Patterns) could have this implemented on it, right?
|
Re: Blink Notification led on Battery Low
Quote:
In the long term, we should (in the Community SSU) replace the whole MCE daemon with the open source version from MeeGo. Short term, I guess I could put a modified libbattery.so module in the lowbatled package instead of the daemon, if that makes any sense. |
Re: Blink Notification led on Battery Low
its working grt...thanks needed a lot as it helps to let know when i need to charge...!!!
|
Re: Blink Notification led on Battery Low
Quote:
|
Re: Blink Notification led on Battery Low
The idea of this extra notification is great but I'd prefer if you could modify the blinking pattern to begin at a choosen percentage other than that , its great !!
|
Re: Blink Notification led on Battery Low
Quote:
|
Re: Blink Notification led on Battery Low
Quote:
I've posted a link to this thread in CSSU-thread now. |
Re: Blink Notification led on Battery Low
1 Attachment(s)
Quote:
You can use LED Pattern Editor to modify it to your liking (blinking pattern, colour)." Good enough for you ? |
Re: Blink Notification led on Battery Low
Quote:
Quote:
|
Re: Blink Notification led on Battery Low
Quote:
Well it doesnt really say if its from devel or extras , wierd. I cant really tell you as i have both enabled. anyway.. im still not 100% happy with it cuz of the lack of possibility to manually set it to start blinking in say 20% percent.. |
Re: Blink Notification led on Battery Low
Quote:
Alright, so this seems to either implement itself (the "patch") to the CSSU-settings (and as far as I know, that's a FOSS-clone so that would explain it) or it just happens to work with it. But I think that's enough about it while waiting for the feature to be implemented for end-users. |
Re: Blink Notification led on Battery Low
Quote:
sorry about that... anyway , yes, you do that. |
Re: Blink Notification led on Battery Low
Quote:
|
Re: Blink Notification led on Battery Low
Quote:
Any ideas? |
Re: Blink Notification led on Battery Low
Thank you for this great app!
It is really useful. Sometimes when I plug the phone onto my PC, it for some reasons does not start charging. Last time it happened, the low bat indication continued indicating, so it made me aware of it *thumbs up* However, something I miss is to be able to set a threshhold. Or at least a info when it will start. |
Re: Blink Notification led on Battery Low
Is this in CSSU yet??? I have it installed... and it works pretty well.
|
All times are GMT. The time now is 11:34. |
vBulletin® Version 3.8.8