Notices


Reply
Thread Tools
Posts: 1,463 | Thanked: 1,916 times | Joined on Feb 2008 @ Edmonton, AB
#11
oohh very useful app, thanks hawaii. I wanted to laugh at these guys with "low battery scripts" that cause a low battery...
 

The Following User Says Thank You to Creamy Goodness For This Useful Post:
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#12
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%
 
hawaii's Avatar
Posts: 1,030 | Thanked: 792 times | Joined on Jun 2009
#13
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.
 

The Following User Says Thank You to hawaii For This Useful Post:
Posts: 235 | Thanked: 86 times | Joined on Dec 2010
#14
Originally Posted by hawaii View Post
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.
Originally Posted by Creamy Goodness View Post
oohh very useful app, thanks hawaii. I wanted to laugh at these guys with "low battery scripts" that cause a low battery...
oops, uh, yeah you're right
didn't notice it until you said it
 
xxxxts's Avatar
Posts: 491 | Thanked: 341 times | Joined on Nov 2009 @ LA
#15
Originally Posted by hawaii View Post
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.
That's what I wanted to try out in this thread;

http://talk.maemo.org/showthread.php?p=940892
 
xxxxts's Avatar
Posts: 491 | Thanked: 341 times | Joined on Nov 2009 @ LA
#16
Originally Posted by pH5 View Post
I've implemented the script in Vala and packaged it as Low Battery LED (lowbatled).
If there is no PatternBatteryLow in mce.ini, the package postinst will add it using mceledpattern and restart MCE.
Well after dealing with the script and it not working, I have installed Low Battery LED - and so far it seems to be working perfectly.

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.
 

The Following User Says Thank You to xxxxts For This Useful Post:
Posts: 539 | Thanked: 518 times | Joined on May 2010 @ nanaurbusiness
#17
Originally Posted by pH5 View Post
I've implemented the script in Vala and packaged it as Low Battery LED (lowbatled).
If there is no PatternBatteryLow in mce.ini, the package postinst will add it using mceledpattern and restart MCE.
Besten Dank,

works brilliant.

Greetz,

..::J4ZZ::..
 

The Following User Says Thank You to J4ZZ For This Useful Post:
pH5's Avatar
Posts: 138 | Thanked: 375 times | Joined on Aug 2009 @ Berlin
#18
Originally Posted by xxxxts View Post
Is this the most efficient way of doing this?
No. The most efficient way would be to add this to the libbattery.so module of the mce daemon because this is running anyway. And guess what, mce is now open source!
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
index cec3f0d..a1ab114 100644
--- a/modules/battery.c
+++ b/modules/battery.c
@@ -129,7 +129,7 @@ static gboolean battery_ok_dbus_cb(DBusMessage *const msg)
 	mce_log(LL_DEBUG,
 		"Received battery ok signal");
 
-//	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
+	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
 
 	execute_datapipe(&battery_status_pipe,
 			 GINT_TO_POINTER(BATTERY_STATUS_OK),
@@ -156,7 +156,7 @@ static gboolean battery_low_dbus_cb(DBusMessage *const msg)
 	mce_log(LL_DEBUG,
 		"Received battery low signal");
 
-//	execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
+	execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
 
 	execute_datapipe(&battery_status_pipe,
 			 GINT_TO_POINTER(BATTERY_STATUS_LOW),
@@ -263,7 +263,7 @@ static gboolean charger_charging_on_dbus_cb(DBusMessage *const msg)
 
 	/* In case these are active; there's no harm to call them anyway */
 	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL, USE_INDATA);
-//	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
+	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
 
 	execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING, USE_INDATA);
Originally Posted by xxxxts View Post
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?
The daemon is sleeping most of the time, it is only woken up by the D-Bus signals. And so is the script. Of course the daemon is way more efficient once the signal comes in, but given the expected frequency of battery_low signals this isn't worth all that much. It occupies less memory though.
 

The Following 4 Users Say Thank You to pH5 For This Useful Post:
xxxxts's Avatar
Posts: 491 | Thanked: 341 times | Joined on Nov 2009 @ LA
#19
Originally Posted by pH5 View Post
No. The most efficient way would be to add this to the libbattery.so module of the mce daemon because this is running anyway. And guess what, mce is now open source!
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
index cec3f0d..a1ab114 100644
--- a/modules/battery.c
+++ b/modules/battery.c
@@ -129,7 +129,7 @@ static gboolean battery_ok_dbus_cb(DBusMessage *const msg)
 	mce_log(LL_DEBUG,
 		"Received battery ok signal");
 
-//	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
+	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
 
 	execute_datapipe(&battery_status_pipe,
 			 GINT_TO_POINTER(BATTERY_STATUS_OK),
@@ -156,7 +156,7 @@ static gboolean battery_low_dbus_cb(DBusMessage *const msg)
 	mce_log(LL_DEBUG,
 		"Received battery low signal");
 
-//	execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
+	execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
 
 	execute_datapipe(&battery_status_pipe,
 			 GINT_TO_POINTER(BATTERY_STATUS_LOW),
@@ -263,7 +263,7 @@ static gboolean charger_charging_on_dbus_cb(DBusMessage *const msg)
 
 	/* In case these are active; there's no harm to call them anyway */
 	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_FULL, USE_INDATA);
-//	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
+	execute_datapipe_output_triggers(&led_pattern_deactivate_pipe, MCE_LED_PATTERN_BATTERY_LOW, USE_INDATA);
 
 	execute_datapipe_output_triggers(&led_pattern_activate_pipe, MCE_LED_PATTERN_BATTERY_CHARGING, USE_INDATA);

The daemon is sleeping most of the time, it is only woken up by the D-Bus signals. And so is the script. Of course the daemon is way more efficient once the signal comes in, but given the expected frequency of battery_low signals this isn't worth all that much. It occupies less memory though.
I don't quite know what to do with this... a little confused and tired. Could you please put it into laymens terms.
 
xxxxts's Avatar
Posts: 491 | Thanked: 341 times | Joined on Nov 2009 @ LA
#20
bump on the question?
 

The Following User Says Thank You to xxxxts For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 03:41.