1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from September
2015</title>
5 <description>Entries from September
2015</description>
6 <link>http://www.hungry.com/~pere/blog/
</link>
10 <title>The life and death of a laptop battery
</title>
11 <link>http://www.hungry.com/~pere/blog/The_life_and_death_of_a_laptop_battery.html
</link>
12 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/The_life_and_death_of_a_laptop_battery.html
</guid>
13 <pubDate>Thu,
24 Sep
2015 16:
00:
00 +
0200</pubDate>
14 <description><p
>When I get a new laptop, the battery life time at the start is OK.
15 But this do not last. The last few laptops gave me a feeling that
16 within a year, the life time is just a fraction of what it used to be,
17 and it slowly become painful to use the laptop without power connected
18 all the time. Because of this, when I got a new Thinkpad X230 laptop
19 about two years ago, I decided to monitor its battery state to have
20 more hard facts when the battery started to fail.
</p
>
22 <img src=
"https://people.skolelinux.org/pere/blog/images/
2015-
09-
24-laptop-battery-graph.png
"/
>
24 <p
>First I tried to find a sensible Debian package to record the
25 battery status, assuming that this must be a problem already handled
26 by someone else. I found
27 <a href=
"https://tracker.debian.org/pkg/battery-stats
">battery-stats
</a
>,
28 which collects statistics from the battery, but it was completely
29 broken. I sent a few suggestions to the maintainer, but decided to
30 write my own collector as a shell script while I waited for feedback
32 <a href=
"http://www.ifweassume.com/
2013/
08/the-de-evolution-of-my-laptop-battery.html
">a
33 blog post about the battery development on a MacBook Air
</a
> I also
35 <a href=
"https://github.com/jradavenport/batlog.git
">batlog
</a
>, not
36 available in Debian.
</p
>
38 <p
>I started my collector
2013-
07-
15, and it has been collecting
39 battery stats ever since. Now my
40 /var/log/hjemmenett-battery-status.log file contain around
115,
000
41 measurements, from the time the battery was working great until now,
42 when it is unable to charge above
7% of original capacity. My
43 collector shell script is quite simple and look like this:
</p
>
48 # http://www.ifweassume.com/
2013/
08/the-de-evolution-of-my-laptop-battery.html
50 # http://blog.sleeplessbeastie.eu/
2013/
01/
02/debian-how-to-monitor-battery-capacity/
51 logfile=/var/log/hjemmenett-battery-status.log
53 files=
"manufacturer model_name technology serial_number \
54 energy_full energy_full_design energy_now cycle_count status
"
56 if [ ! -e
"$logfile
" ] ; then
58 printf
"timestamp,
"
60 printf
"%s,
" $f
63 )
> "$logfile
"
67 # Print complete message in one echo call, to avoid race condition
68 # when several log processes run in parallel.
69 msg=$(printf
"%s,
" $(date +%s); \
71 printf
"%s,
" $(cat $f); \
76 cd /sys/class/power_supply
79 (cd $bat
&& log_battery
>> "$logfile
")
83 <p
>The script is called when the power management system detect a
84 change in the power status (power plug in or out), and when going into
85 and out of hibernation and suspend. In addition, it collect a value
86 every
10 minutes. This make it possible for me know when the battery
87 is discharging, charging and how the maximum charge change over time.
88 The code for the Debian package
89 <a href=
"https://github.com/petterreinholdtsen/battery-status
">is now
90 available on github
</a
>.
</p
>
92 <p
>The collected log file look like this:
</p
>
95 timestamp,manufacturer,model_name,technology,serial_number,energy_full,energy_full_design,energy_now,cycle_count,status,
96 1376591133,LGC,
45N1025,Li-ion,
974,
62800000,
62160000,
39050000,
0,Discharging,
98 1443090528,LGC,
45N1025,Li-ion,
974,
4900000,
62160000,
4900000,
0,Full,
99 1443090601,LGC,
45N1025,Li-ion,
974,
4900000,
62160000,
4900000,
0,Full,
102 <p
>I wrote a small script to create a graph of the charge development
103 over time. This graph depicted above show the slow death of my laptop
106 <p
>But why is this happening? Why are my laptop batteries always
107 dying in a year or two, while the batteries of space probes and
108 satellites keep working year after year. If we are to believe
109 <a href=
"http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
">Battery
110 University
</a
>, the cause is me charging the battery whenever I have a
111 chance, and the fix is to not charge the Lithium-ion batteries to
100%
112 all the time, but to stay below
90% of full charge most of the time.
113 I
've been told that the Tesla electric cars
114 <a href=
"http://my.teslamotors.com/de_CH/forum/forums/battery-charge-limit
">limit
115 the charge of their batteries to
80%
</a
>, with the option to charge to
116 100% when preparing for a longer trip (not that I would want a car
117 like Tesla where rights to privacy is abandoned, but that is another
118 story), which I guess is the option we should have for laptops on
121 <p
>Is there a good and generic way with Linux to tell the battery to
122 stop charging at
80%, unless requested to charge to
100% once in
123 preparation for a longer trip? I found
124 <a href=
"http://askubuntu.com/questions/
34452/how-can-i-limit-battery-charging-to-
80-capacity
">one
125 recipe on askubuntu for Ubuntu to limit charging on Thinkpad to
126 80%
</a
>, but could not get it to work (kernel module refused to
129 <p
>I wonder why the battery capacity was reported to be more than
100%
130 at the start. I also wonder why the
"full capacity
" increases some
131 times, and if it is possible to repeat the process to get the battery
132 back to design capacity. And I wonder if the discharge and charge
133 speed change over time, or if this stay the same. I did not yet try
134 to write a tool to calculate the derivative values of the battery
135 level, but suspect some interesting insights might be learned from
138 <p
>Update
2015-
09-
24: I got a tip to install the packages
139 acpi-call-dkms and tlp (unfortunately missing in Debian stable)
140 packages instead of the tp-smapi-dkms package I had tried to use
141 initially, and use
'tlp setcharge
40 80' to change when charging start
142 and stop. I
've done so now, but expect my existing battery is toast
143 and need to be replaced. The proposal is unfortunately Thinkpad
149 <title>Book cover for the Free Culture book finally done
</title>
150 <link>http://www.hungry.com/~pere/blog/Book_cover_for_the_Free_Culture_book_finally_done.html
</link>
151 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/Book_cover_for_the_Free_Culture_book_finally_done.html
</guid>
152 <pubDate>Thu,
3 Sep
2015 21:
00:
00 +
0200</pubDate>
153 <description><p
>Creating a good looking book cover proved harder than I expected.
154 I wanted to create a cover looking similar to the original cover of
156 <a href=
"https://github.com/petterreinholdtsen/free-culture-lessig
">Free
157 Culture
</a
> book we are translating to Norwegian, and I wanted it in
158 vector format for high resolution printing. But my inkscape knowledge
159 were not nearly good enough to pull that off.
161 <p
>But thanks to the great inkscape community, I was able to wrap up
162 the cover yesterday evening. I asked on the
163 <a href=
"irc://irc.freenode.net/%
23inkscape
">#inkscape IRC channel
</a
>
164 on Freenode for help and clues, and Marc Jeanmougin (Mc-) volunteered
165 to try to recreate it based on the PDF of the cover from the HTML
166 version. Not only did he create a
167 <a href=
"https://marc.jeanmougin.fr/share/copy1.svg
">SVG document with
168 the original and his vector version side by side
</a
>, he even provided
169 an
<a href=
"https://marc.jeanmougin.fr/share/out-
1.ogv
">instruction
170 video
</a
> explaining how he did it
</a
>. But the instruction video is
171 not easy to follow for an untrained inkscape user. The video is a
172 recording on how he did it, and he is obviously very experienced as
173 the menu selections are very quick and he mentioned on IRC that he did
174 use some keyboard shortcuts that can
't be seen on the video, but it
175 give a good idea about the inkscape operations to use to create the
176 stripes with the embossed copyright sign in the center.
</p
>
178 <p
>I took his SVG file, copied the vector image and re-sized it to fit
179 on the cover I was drawing. I am happy with the end result, and the
180 current english version look like this:
</p
>
182 <img src=
"https://people.skolelinux.org/pere/blog/images/
2015-
09-
03-free-culture-cover.png
" width=
"70%
" align=
"center
"/
>
184 <p
>I am not quite sure about the text on the back, but guess it will
185 do. I picked three quotes from the official site for the book, and
186 hope it will work to trigger the interest of potential readers. The
187 Norwegian cover will look the same, but with the texts and bar code
188 replaced with the Norwegian version.
</p
>
190 <p
>The book is very close to being ready for publication, and I expect
191 to upload the final draft to Lulu in the next few days and order a
192 final proof reading copy to verify that everything look like it should
193 before allowing everyone to order their own copy of Free Culture, in
194 English or Norwegian Bokmål. I
'm waiting to give the the productive
195 proof readers a chance to complete their work.
</p
>