maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Estimating the charge time (https://talk.maemo.org/showthread.php?t=39140)

papo 2010-01-03 15:17

Estimating the charge time
 
Hello

I noticed that the N900 does not estimate how long it's going to take for the battery to get fully charged. Such an indication would be helpful to me and I can imagine that other people would be interested too.

I'm trying to do this, but I'm not sure if the information provided by lshal is accurate enough for a decent estimation. To figure that out, I have to profile the charging process. I wrote a script to do that, but I'd like to obtain samples from other N900 users. This enables me to get more samples faster and I can cross-check my code with other charging profiles.

If you want to help me out, use the following script:

#/bin/sh

FILE=$(date +%s|tr -d '\n').charge

while true
do
date +%s|tr -d '\n' >> $FILE
lshal|grep battery >> $FILE
echo "-- " >> $FILE
sleep 30
done


Put this code into the file /home/user/profile.sh, then cd into that directory (cd /home/user) and run chmod 755 profile.sh. When you are going to charge your device, open a terminal and run ./profile.sh before attaching the charger. Quit the script (ctrl-c) after you detached the charger. The script will generate a file with a timestamp and the suffix charge, for example 1262531100.charge. (Note that the internal file browser does not display suffixes). Send me these files; you may remove them afterwards. Please only send in files of charging processes where the device was fully charged, and if possible, write me which charger (USB or power outlet) you used, if WLAN was active and whether the device was idle during charging process.

I can't promise that the data will be accurate enough for a widget to predict charging time, but I promise I'll publish some graphs and analysis of the data if enough samples are returned.

Best regards and thank you

Matt

EDIT:
1. send the files to weyland - a t - library.ethz.ch
2. I was asked whether the script has to be stopped right after the battery gets fully charged. This is not necessary, you can keep the script running and stop it after you come back from whatever you were doing in the meantime. But please don't stop the script before the battery gets full, so that I can use the log file to determine precisely when this happens.

zehjotkah 2010-01-03 15:31

Re: Estimating the charge time
 
welcome to the forum! nice to have you here! i will see, what i can do. a widget with that function would be nice



edit: i've a problem:
made that file
chmod that file
but after ./ it says permission denied...

papo 2010-01-03 16:00

Re: Estimating the charge time
 
Hello

Quote:

Originally Posted by zehjotkah (Post 451243)
but after ./ it says permission denied...

Can you post ls -l profile.sh and make sure that there is no space between ./ and profile.sh? And can you post the full error message (there should be something before Permission denied)?

Regards & thanks

Matt

zehjotkah 2010-01-03 18:38

Re: Estimating the charge time
 
-rw-r--r-- 1 user root 162 Jan 3 17:32 profile.sh

-sh: -/profile.sh: Permission denied

my battery is low, so i must fix that soon... ;)

papo 2010-01-03 18:42

Re: Estimating the charge time
 
Hi

Quote:

Originally Posted by zehjotkah (Post 451495)
-rw-r--r-- 1 user root 162 Jan 3 17:32 profile.sh

The chmod did not work then:

~ $ chmod 644 profile.sh
~ $ ls -lh profile.sh
-rw-r--r-- 1 user users 152 Jan 3 16:56 profile.sh
~ $ chmod 755 profile.sh
~ $ ls -lh profile.sh
-rwxr-xr-x 1 user users 152 Jan 3 16:56 profile.sh


You can only execute the script if the executable bit (x) is set. Alternatively, you can also try sh ./profile.sh which does not require the executable bit.

Thank you for your efforts

Matt

That One Guy 2010-01-03 19:05

Re: Estimating the charge time
 
Email address to send .charge logfiles to?

papo 2010-01-03 19:11

Re: Estimating the charge time
 
Quote:

Originally Posted by That One Guy (Post 451522)
Email address to send .charge logfiles to?

weyland - a t - library.ethz.ch

zehjotkah 2010-01-03 19:22

Re: Estimating the charge time
 
i can't get the file mark as executable^^ thats really strange. i've tried it in the mmc1 but also in .documents...
stays at -rw-r--r--
i've made a .txt in windows, with the content, renamed to profile.sh, transferred to my n900..
something i'm doing wrong... feeling stupid right now^^

Matan 2010-01-03 19:26

Re: Estimating the charge time
 
You can't execute files on the VFAT partition. copy them to another partition.

papo 2010-01-03 19:26

Re: Estimating the charge time
 
Hm, it just popped into my mind that you may be trying on a filesystem that does not support modes (such as vfat). That would explain it. I'm trying in /home/user which is ext3. Anyway, sh ./profile.sh (or whatever the name of the file is) should work anyway, so just add a preceding 'sh' and you should be fine. I'll fix the first post in this thread.

Thanks, Matt


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

vBulletin® Version 3.8.8