Poll: Delet the values from the speedpatch?
Poll Options
Delet the values from the speedpatch?

Reply
Thread Tools
coredumb's Avatar
Posts: 92 | Thanked: 74 times | Joined on Nov 2008 @ Indonesia
#1351
update on my script, on automatically change the value of vfs_cache_pressure based on system_inactivity_ind status

Code:
#!/bin/bash

DBUS_SEND=/usr/bin/dbus-send
AWK=/usr/bin/awk

INACTIVE=$($DBUS_SEND --system --type=method_call --dest=com.nokia.mce --print-reply=literal /com/nokia/mce/request com.nokia.mce.request.get_inactivity_status | $AWK '{ print $2 }')

if [ "$INACTIVE" == "false" ] ; then
  echo 100 > /proc/sys/vm/vfs_cache_pressure
else
  echo 10 > /proc/sys/vm/vfs_cache_pressure
fi
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#1352
Originally Posted by coredumb View Post
vi_, i only have a little knowledge on dbus. after doing some obvservation, i found that dbus-scripts only grep 4 argument when the device going standby, which is sender, destination, interface (com.nokia.mce.signal), and member (system_inactivity_ind). but i couldn't find the way to get the status of system_inactivity_ind, the 'true/false' value.

so, to let my script know what is the current status of system_inactivity_ind, i use a file as indicator.
if the indicator file exist, then the device is in standby mode, and vice versa.

this is my script:
Code:
#!/bin/bash

INACTIVE_IND=inactive.indicator

if [ -e $INACTIVE_IND ] ; then
  echo 100 > /proc/sys/vm/vfs_cache_pressure
  rm $INACTIVE_IND
else
  echo 10 > /proc/sys/vm/vfs_cache_pressure
  touch $INACTIVE_IND
fi
the problem is, the script couldn't know the current state when the device is rebooted/restarted

do you have any advice, how to get the system_inactivity_ind boolean value using bash script?
I don't really understand your question. The dbus-scripts rule provided earlier ONLY matches to system inactive. I know it works because I have tested it relentlessly.

Where did you read dbus-scripts only matches 4 'arguments'?
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#1353
Originally Posted by coredumb View Post
update on my script, on automatically change the value of vfs_cache_pressure based on system_inactivity_ind status

Code:
#!/bin/bash

DBUS_SEND=/usr/bin/dbus-send
AWK=/usr/bin/awk

INACTIVE=$($DBUS_SEND --system --type=method_call --dest=com.nokia.mce --print-reply=literal /com/nokia/mce/request com.nokia.mce.request.get_inactivity_status | $AWK '{ print $2 }')

if [ "$INACTIVE" == "false" ] ; then
  echo 100 > /proc/sys/vm/vfs_cache_pressure
else
  echo 10 > /proc/sys/vm/vfs_cache_pressure
fi
WTF? o0 are you out of your god-dammed mind?

You use dbus-scripts in order to avoid polling things. i.e. dbus-scripts waits for somthing, then runs a script.

You don't poll dbus to get the current state of something in order to run a script.


This rule WILL run the script '/opt/scripts/some_script.sh' when the system inactivity signal is on dbus.

Code:
/opt/scripts/some_script.sh * * com.nokia.mce.signal system_inactivity_ind

Then THIS script will run:

Code:
#!/bin/sh
###This **** checks to see if phone is REALLY asleep, sometimes inactive signal appears at a funny time.
brightness=$(cat /sys/class/backlight/acx565akm/brightness)
keyboard=$(cat /sys/devices/platform/gpio-switch/slide/state)
if [ "$brightness" == "0" ]; then
        if [ "$keyboard" == "closed" ]; then
                #do some stuff
                #Do some other stuff
        fi
fi
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.

Last edited by vi_; 2011-07-27 at 13:23.
 

The Following User Says Thank You to vi_ For This Useful Post:
Posts: 856 | Thanked: 1,681 times | Joined on Apr 2010 @ Aleppo ,Syria
#1354
guys after testing the dbus-script
i had a better battery life
standby : 4 days (max)
continues usage : if depends on the kind if usage
ex : webos games (sounds video touchscreen keyboard)
will last for about 4 - 5 hours (max)

ex : IM programs like pidgin and others
will last on continues usage about 9 - 12 hours

other tiny programs will last about 15 hours of continues usage of them



i think this is a great result
an iphone can't have like that one

but be aware i that i have every auto update program is disabled
wifi search interval is disabled too

i will post instructions and how to soon when i have a free time

PS: I HAVE NOTICED SOME THING
when i use N900 heavy usage the battery drains about 2 - 4 % each 10 minutes

but when i leave it standby about 15 minutes the battery value increases
ex : from 40% to 50% sometimes 55%

i think if is predicting feature of N900
it calculates the remaining time of heavy and standby usage (just maybe)
 

The Following 6 Users Say Thank You to karam For This Useful Post:
Posts: 458 | Thanked: 136 times | Joined on Jul 2010 @ Holland
#1355
@karam:

Where can we find the final script? And how to use it?

Thanks for the great work and your time!
 
Posts: 856 | Thanked: 1,681 times | Joined on Apr 2010 @ Aleppo ,Syria
#1356
i will post how to and easy guide soon
but it has nothing to do with speedpatch
it is completely new thing

PS: thanks to vi_ too because he helped me with this
 

The Following 2 Users Say Thank You to karam For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#1357
Originally Posted by karam View Post
guys after testing the dbus-script
i had a better battery life
standby : 4 days (max)
continues usage : if depends on the kind if usage
ex : webos games (sounds video touchscreen keyboard)
will last for about 4 - 5 hours (max)

ex : IM programs like pidgin and others
will last on continues usage about 9 - 12 hours

other tiny programs will last about 15 hours of continues usage of them



i think this is a great result
an iphone can't have like that one

but be aware i that i have every auto update program is disabled
wifi search interval is disabled too

i will post instructions and how to soon when i have a free time

PS: I HAVE NOTICED SOME THING
when i use N900 heavy usage the battery drains about 2 - 4 % each 10 minutes

but when i leave it standby about 15 minutes the battery value increases
ex : from 40% to 50% sometimes 55%

i think if is predicting feature of N900
it calculates the remaining time of heavy and standby usage (just maybe)
That is correct (about the battery). Now for your next trick, adjusting wifi power...

When I am on my home wifi, I am always near the access point. Thus I do not need the full 100mW of wifi power. I can use just 10mW and still have perfect connection. Similarly, at work I am in the middle of 3 dd-wrt routers all cranking out 250mW of power, I can get away with just 2mW of wifi power there. Adjusting wifi power by the 'connections' settings is a pain in the testicles and cannot be done for each network separately...

In maemo (an most linux's) there is is a directory called /etc/network/if-up.d. Any scripts in this folder will be run as root whenever I 'connect'...

So, you create a file called:

Code:
/etc/network/if-up.d/50_wifiscripts
Containing:

Code:
#!/bin/sh
essid=$(iwgetid -s)

if [ "$essid" == "qwerty12" ]; then
	iwconfig wlan0 txpower 7
	echo $essid
elif [ "$essid" == "work" ]; then
	iwconfig wlan0 txpower 3
fi
This means when I connect to qwerty12 (home) or work the power is reduced appropriatley.


Similarly, at the other end:

Code:
/etc/network/if-down.d/50_wifiscripts
Containing:

Code:
#!/bin/sh
iwconfig wlan0 txpower 20
To put power back to max when I disconnect (so you can still connect to other networks).

You can stick other stuff in these directories too. For example, switch to work profile when I connect to work wifi.

This lets me stay connected to wifi all day without even batting an eyelid!
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.

Last edited by vi_; 2011-07-27 at 14:17.
 

The Following 7 Users Say Thank You to vi_ For This Useful Post:
corduroysack's Avatar
Posts: 939 | Thanked: 366 times | Joined on Dec 2010 @ U.K.
#1358
looking forward to trying out that script karam, and thanks to vi_ for that information i see what you mean about changing the wifipower through settings but being housebound so far i don't have that problem yet i imagine swapping back and forth could get a bind. turned it down to 10mW and haven't noticed any problems with performance
__________________
"I Reject Your Reality & Substitute My Own" Adam Savage
 
coredumb's Avatar
Posts: 92 | Thanked: 74 times | Joined on Nov 2008 @ Indonesia
#1359
Originally Posted by vi_ View Post
I don't really understand your question. The dbus-scripts rule provided earlier ONLY matches to system inactive. I know it works because I have tested it relentlessly.

Where did you read dbus-scripts only matches 4 'arguments'?
i run this command:
/usr/sbin/dbus-scripts --system --debug

and when 'system_inactivity_ind' occurs, it only show 4 arguments:
Code:
=================================
Arg 1: :1.11
Arg 2: null
Arg 3: com.nokia.mce.signal
Arg 4: system_inactivity_ind
Script /home/user/bin/cpu_normal.sh matches
whether it goes sleep or active.

btw, sorry for my bad english. english is not my daily language
 
coredumb's Avatar
Posts: 92 | Thanked: 74 times | Joined on Nov 2008 @ Indonesia
#1360
Originally Posted by vi_ View Post
WTF? o0 are you out of your god-dammed mind?

You use dbus-scripts in order to avoid polling things. i.e. dbus-scripts waits for somthing, then runs a script.

You don't poll dbus to get the current state of something in order to run a script.


This rule WILL run the script '/opt/scripts/some_script.sh' when the system inactivity signal is on dbus.

Code:
/opt/scripts/some_script.sh * * com.nokia.mce.signal system_inactivity_ind
sorry, i forgot to say that my script is call by the rule you mention above.

i use this command:
Code:
/usr/sbin/dbus-send --system --type=method_call --dest=com.nokia.mce --print-reply=literal /com/nokia/mce/request com.nokia.mce.request.get_inactivity_status
to identify whether the system_inactivity_ind occurs when the device becomes active (return false) or going to sleep (return true).
 
Reply

Tags
autobrick, awesome-script, do no install, f***epitaph, install it now, perfect_ n900, script-a-brick, very safe


 
Forum Jump


All times are GMT. The time now is 13:43.