User:MartinDengler: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(fixup battery temp tracking) |
||
Line 2: | Line 2: | ||
== About Me == |
== About Me == |
||
I program for a living. I got an XO to support the OLPC project and have a laptop for daily use. |
I program for a living. I got an XO to support the OLPC project and have a laptop for daily use. |
||
I work with python and Fedora a lot. |
I work with python and Fedora a lot. |
||
⚫ | |||
⚫ | |||
I found some trac bugs {{Trac|800|ambient limit}} and {{Trac|1285|bogus temp}} that gave me a hint as to where the ambient temperature sensor's data are available: |
|||
<pre> |
|||
cat /sys/class/power_supply/olpc-battery/temp_ambient |
|||
</pre> |
|||
I saw it earlier but was led to believe the ambient temperature sensor was on the motherboard, not the battery. I'm not sure if this is the case; either it is, and the data being available under power_supply/olpc_battery is (at best) just confusing, or this is a temperature sensor on the battery and not the motherboard ambient temperature sensor that I'm looking for. |
|||
Update: well, it's clearly the "temp" file in olpc-battery, but temp and temp_ambient seem swapped: |
|||
<pre> |
<pre> |
||
Line 28: | Line 20: | ||
</pre> |
</pre> |
||
⚫ | |||
...but on #olpc papajuans reported sensible numbers (temp_ambient a bit lower than temp). |
|||
⚫ | |||
<pre> |
<pre> |
||
bemasc: "ambient" means "ambient in the case" |
bemasc: "ambient" means "ambient in the case" |
||
Line 45: | Line 35: | ||
bemasc: so it's not easy, but it's also not impossible |
bemasc: so it's not easy, but it's also not impossible |
||
</pre> |
</pre> |
||
== Misc snippets to remember == |
== Misc snippets to remember == |
Revision as of 03:48, 14 February 2008
About Me
I program for a living. I got an XO to support the OLPC project and have a laptop for daily use.
I work with python and Fedora a lot.
Ambient temperature tracking
bash-3.2$ cat /ofw/openprom/model ; echo CL1 Q2D13 Q2D bash-3.2$ cat /boot/olpc_build update.1 691 bash-3.2$ for f in /sys/class/power_supply/olpc-battery/temp* ; do (echo -e $f\\t ; cat $f) | paste - - ; done /sys/class/power_supply/olpc-battery/temp 2783 /sys/class/power_supply/olpc-battery/temp_ambient 3900
bemasc explained things on #olpc [I edited out background chatter]:
bemasc: "ambient" means "ambient in the case" bemasc: battery means in the battery compartment bemasc: the "ambient" thermometer is on the motherboard bemasc: not sure which chip bemasc: they were trying to place in the antenna bemasc: so that it would be far from the heat sources mtd: bemasc: so I guess if I want to know the temperature outside the case, the lower of the two numbers is closer to that (though still quite inaccurate) bemasc: the battery temp is closest, yeah bemasc: if you have another thermometer, you might consider trying to work out the offset and correct for it bemasc: it'll be different depending on whether the battery is charging or discharging, and how fast bemasc: and it'll take at least a few minutes to stabilize bemasc: so it's not easy, but it's also not impossible
Misc snippets to remember
Backlight and blurring switched off, makes some pdfs more readable:
su -c "echo 1 > /sys/devices/platform/dcon/output"
How to explicitly forget/add a WPA wireless network
If you want to forget/add a WPA wireless network explicitly, stop NetworkManager (/etc/init.d/NetworkManader stop) and edit
/home/olpc/.sugar/default/nm/networks.cfg
Screen battery status hint
Date: Sat, 5 Jan 2008 18:09:19 +0000 From: Martin Dengler <martin@martindengler.com> Subject: Battery capacity in screen hardstatus line hint To: devel@lists.laptop.org [-- PGP output follows (current time: Sat 05 Jan 2008 06:23:51 PM GMT) --] gpg: Signature made Sat 05 Jan 2008 06:09:19 PM GMT using DSA key ID 75C7D2F8 [GNUPG:] SIG_ID AwM6Me4nlHAq/mT0qRJbz79n4sk 2008-01-05 1199556559 [GNUPG:] GOODSIG 81B444DD75C7D2F8 martin@martindengler.com gpg: Good signature from "martin@martindengler.com" [GNUPG:] VALIDSIG 565C8F33ABF72DAA33DEB9CB81B444DD75C7D2F8 2008-01-05 1199556559 0 3 0 17 2 01 565C8F33ABF72DAA33DEB9CB81B444DD75C7D2F8 [GNUPG:] TRUST_ULTIMATE [-- End of PGP output --] [-- The following data is signed --] Hi, In case this is of use to anyone, I've put the battery capacity in my xo screen instance's hardstatus line with this tiny script & screenrc change: ---------- /home/olpc/bin/olpc_screen_status.sh #!/bin/bash # Author: Martin Dengler <martin@martindengler.com> # idea from http://www.mail-archive.com/screen-users@gnu.org/msg00322.html # based on battery info from olpc-logbat # B_INFO=/sys/class/power_supply/olpc-battery while true do CAP=`cat $B_INFO/capacity` echo b:$CAP% sleep 60 done ---------- ....screenrc change: ---------- /home/olpc/bin/.screenrc # run command forever and assign most recent output to string escape %1` backtick 1 0 0 /home/olpc/bin/olpc_screen_status.sh # the ...%1`... part at the end is the important part hardstatus alwayslastline "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a %1` " ----------
I'd be interested to know how to get at the ambient temperature sensor mentioned in section 2.4.1 of the CL1 hardware design specification PDF. I've had a look around /sys/class but nothing's jumped out at me.