![]() |
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 python This 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) |
All times are GMT. The time now is 19:53. |
vBulletin® Version 3.8.8