![]() |
Re: N800 Battery Meter
Quote:
No, I would like to query AC plugs/unplugs events by reading from somewhere (/dev/retu) but no luck so far... |
Re: N800 Battery Meter
I have no idea what it read it from; I could only find a .deb and not the source. I found out who the maintainer was (someone at Nokia), and thought about sending an email, but never did.
Here it is: http://timeless.justdave.net/reposit...pdates/diablo/ (you need to install both the ftd* files to get info on the battery). |
Re: N800 Battery Meter
Quote:
0 - No power source connected about 0x100 - power source connected, charging about 0x170 - power source connected, not charging. If it is indeed showing input voltage level, then the reading will depend on charger used. A well regulated source will give the same level, whether charging or not. |
Re: N800 Battery Meter
Quote:
Now I can detect AC plug/unplug and batt full which is a huge improvement for battery metering in NITdroid. Before this I was relying on very imprecise heuristics based on register #8 which is completely erratic (or misunderstood). Thx! I was wondering if you know what the other registers means? @Nokia: it's time to release the RETU/TAHVO ASICs documentation! :rolleyes: |
Re: N800 Battery Meter
Im testing various way to check the battery status for a python application. Using the dbus make the tablet 'fart' everytime I check the level if the charger is connected. I really like the idea to read directly the os values using kcbatt (and having some alternative values to compare to the usual dbus based programs) but it seem only works if the app is 'root'
Any idea how solve? https://garage.maemo.org/frs/downloa...hot_kcbatt.jpg |
Re: N800 Battery Meter
I don't know of any way to read retu as user...
My Python program just used "subprocess.Popen('sudo ./retu-adc', shell=True)" to read it. It doesn't really do anything new...but at least you don't need to actually run the whole program as root (but you need the proper software installed to enable sudo to do that). |
Re: N800 Battery Meter
Quote:
The point is that for that clock the battery check is just an 'extra feature' and if Ill not able to figure out a decent way to read that values Ill probably decide to remove all that part. thank you for the hint anyway, Seem to remeber I tried to read the retu directly from python but probably doing something wrong (Im not a programmer at all :( ) |
Re: N800 Battery Meter
Just get yourself Matan's retu-adc program and it is pretty easy to check... BTW, I'm not much of a programmer either :) I just know a little Python and trial and error usually results in the desired effect. :)
|
Re: N800 Battery Meter
1 Attachment(s)
Ok, I dug up my python code and here it is. I couldn't find my newest version of it, though :confused: I have no idea where it went...
Code:
#!/bin/env pythonThis program basically just polls the retu every minute and writes it to a log file. It then uses that data to calculate (albeit completely unrefined) the battery level. Feel free to use this code :) Edit: The forum messed up th indenting. You'll need to fix it. |
Re: N800 Battery Meter
If you want to access retu as a user, just run
chmod a+rw /dev/retu (You need to run this every time you boot). About using the info from python scripts - you can use ioctls directly from python, there is no need to use retu-adc program or variant. Something like: import fcntl f = open("/dev/retu") adc8 = fcntl.ioctl(f, 0x6003, 8) |
Re: N800 Battery Meter
Quote:
Extremely unlikely - those chips are used in many Nokia phones, not only in the tablets. Furthermore - those are probably generic GPIO/ADC/RTC/etc. devices. The real question is what is connected to which GPIOs, ADC ports, and how. |
Re: N800 Battery Meter
Quote:
|
Re: N800 Battery Meter
I for one would like to toss my hat into the ring and say that a battery meter with colored text denoting battery remaining would be best. It's "sorta" done that way already in regular Linux, but I'd like to see it that way in the NITS too. IE, it's green text until it hits 25%, yellow until it hits 10%, and red the rest of the way down. Then when you click on the text, it can say "estimated" run time and idle time.
|
Re: N800 Battery Meter
sorry if this can be considered cross-posting, but i don't know which is the more appropriate thread for my questions...
bye bye |
Re: N800 Battery Meter
solution found :-)
but the meter seems to be not very accurate: Code:
Nokia-N810-23-14:/home/user# ./kcbatt -q (btw, for who doesn't know, "-q" option shows the % value of the battery) tia. bye bye |
Re: N800 Battery Meter
1 Attachment(s)
after a lot of frustration, i found out that one guy in my department wrote a program that (in the middle of other operations) checks the battery level of the nokia N810 devices; is written in C++ and uses dbus library that asks to hal, so i think that is also valid for N770 and N800.
after a few modifications i'm now able to check correctly the status of the battery! :D in attached you can find the source code, with the hope that it will be helpful to someone. bye bye |
| All times are GMT. The time now is 16:59. |
vBulletin® Version 3.8.8