- <title>The life and death of a laptop battery</title>
- <link>http://people.skolelinux.org/pere/blog/The_life_and_death_of_a_laptop_battery.html</link>
- <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/The_life_and_death_of_a_laptop_battery.html</guid>
- <pubDate>Thu, 24 Sep 2015 16:00:00 +0200</pubDate>
- <description><p>When I get a new laptop, the battery life time at the start is OK.
-But this do not last. The last few laptops gave me a feeling that
-within a year, the life time is just a fraction of what it used to be,
-and it slowly become painful to use the laptop without power connected
-all the time. Because of this, when I got a new Thinkpad X230 laptop
-about two years ago, I decided to monitor its battery state to have
-more hard facts when the battery started to fail.</p>
-
-<img src="http://people.skolelinux.org/pere/blog/images/2015-09-24-laptop-battery-graph.png"/>
-
-<p>First I tried to find a sensible Debian package to record the
-battery status, assuming that this must be a problem already handled
-by someone else. I found
-<a href="https://tracker.debian.org/pkg/battery-stats">battery-stats</a>,
-which collects statistics from the battery, but it was completely
-broken. I sent a few suggestions to the maintainer, but decided to
-write my own collector as a shell script while I waited for feedback
-from him. Via
-<a href="http://www.ifweassume.com/2013/08/the-de-evolution-of-my-laptop-battery.html">a
-blog post about the battery development on a MacBook Air</a> I also
-discovered
-<a href="https://github.com/jradavenport/batlog.git">batlog</a>, not
-available in Debian.</p>
-
-<p>I started my collector 2013-07-15, and it has been collecting
-battery stats ever since. Now my
-/var/log/hjemmenett-battery-status.log file contain around 115,000
-measurements, from the time the battery was working great until now,
-when it is unable to charge above 7% of original capacity. My
-collector shell script is quite simple and look like this:</p>
-
-<pre>
-#!/bin/sh
-# Inspired by
-# http://www.ifweassume.com/2013/08/the-de-evolution-of-my-laptop-battery.html
-# See also
-# http://blog.sleeplessbeastie.eu/2013/01/02/debian-how-to-monitor-battery-capacity/
-logfile=/var/log/hjemmenett-battery-status.log
-
-files="manufacturer model_name technology serial_number \
- energy_full energy_full_design energy_now cycle_count status"
-
-if [ ! -e "$logfile" ] ; then
- (
- printf "timestamp,"
- for f in $files; do
- printf "%s," $f
- done
- echo
- ) > "$logfile"
-fi
-
-log_battery() {
- # Print complete message in one echo call, to avoid race condition
- # when several log processes run in parallel.
- msg=$(printf "%s," $(date +%s); \
- for f in $files; do \
- printf "%s," $(cat $f); \
- done)
- echo "$msg"
-}
-
-cd /sys/class/power_supply
-
-for bat in BAT*; do
- (cd $bat && log_battery >> "$logfile")
-done
-</pre>
-
-<p>The script is called when the power management system detect a
-change in the power status (power plug in or out), and when going into
-and out of hibernation and suspend. In addition, it collect a value
-every 10 minutes. This make it possible for me know when the battery
-is discharging, charging and how the maximum charge change over time.
-The code for the Debian package
-<a href="https://github.com/petterreinholdtsen/battery-status">is now
-available on github</a>.</p>
-
-<p>The collected log file look like this:</p>
-
-<pre>
-timestamp,manufacturer,model_name,technology,serial_number,energy_full,energy_full_design,energy_now,cycle_count,status,
-1376591133,LGC,45N1025,Li-ion,974,62800000,62160000,39050000,0,Discharging,
-[...]
-1443090528,LGC,45N1025,Li-ion,974,4900000,62160000,4900000,0,Full,
-1443090601,LGC,45N1025,Li-ion,974,4900000,62160000,4900000,0,Full,
-</pre>
-
-<p>I wrote a small script to create a graph of the charge development
-over time. This graph depicted above show the slow death of my laptop
-battery.</p>
-
-<p>But why is this happening? Why are my laptop batteries always
-dying in a year or two, while the batteries of space probes and
-satellites keep working year after year. If we are to believe
-<a href="http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries">Battery
-University</a>, the cause is me charging the battery whenever I have a
-chance, and the fix is to not charge the Lithium-ion batteries to 100%
-all the time, but to stay below 90% of full charge most of the time.
-I've been told that the Tesla electric cars
-<a href="http://my.teslamotors.com/de_CH/forum/forums/battery-charge-limit">limit
-the charge of their batteries to 80%</a>, with the option to charge to
-100% when preparing for a longer trip (not that I would want a car
-like Tesla where rights to privacy is abandoned, but that is another
-story), which I guess is the option we should have for laptops on
-Linux too.</p>
-
-<p>Is there a good and generic way with Linux to tell the battery to
-stop charging at 80%, unless requested to charge to 100% once in
-preparation for a longer trip? I found
-<a href="http://askubuntu.com/questions/34452/how-can-i-limit-battery-charging-to-80-capacity">one
-recipe on askubuntu for Ubuntu to limit charging on Thinkpad to
-80%</a>, but could not get it to work (kernel module refused to
-load).</p>
-
-<p>I wonder why the battery capacity was reported to be more than 100%
-at the start. I also wonder why the "full capacity" increases some
-times, and if it is possible to repeat the process to get the battery
-back to design capacity. And I wonder if the discharge and charge
-speed change over time, or if this stay the same. I did not yet try
-to write a tool to calculate the derivative values of the battery
-level, but suspect some interesting insights might be learned from
-those.</p>
-
-<p>Update 2015-09-24: I got a tip to install the packages
-acpi-call-dkms and tlp (unfortunately missing in Debian stable)
-packages instead of the tp-smapi-dkms package I had tried to use
-initially, and use 'tlp setcharge 40 80' to change when charging start
-and stop. I've done so now, but expect my existing battery is toast
-and need to be replaced. The proposal is unfortunately Thinkpad
-specific.</p>
+ <title>Bokhandeldistribusjon av boken Fri kultur av Lawrence Lessig</title>
+ <link>http://people.skolelinux.org/pere/blog/Bokhandeldistribusjon_av_boken_Fri_kultur_av_Lawrence_Lessig.html</link>
+ <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Bokhandeldistribusjon_av_boken_Fri_kultur_av_Lawrence_Lessig.html</guid>
+ <pubDate>Mon, 14 Dec 2015 12:10:00 +0100</pubDate>
+ <description><p><strong>Besøk
+<a href="https://www.lulu.com/shop/lawrence-lessig/fri-kultur/paperback/product-22441576.html">lulu.com</a>
+eller
+<a href="https://www.amazon.com/Fri-kultur-Norwegian-Lawrence-Lessig/dp/8269018236/">Amazon</a>
+for å kjøpe boken på papir, eller last ned ebook som
+<a href="https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.pdf">PDF</a>,
+<a href="https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.epub">ePub</a>
+eller
+<a href="https://github.com/petterreinholdtsen/free-culture-lessig/raw/master/archive/freeculture.nb.mobi">MOBI</a>
+fra
+<a href="https://github.com/petterreinholdtsen/free-culture-lessig/">github</a>.</strong></p>
+
+<p>Jeg ble gledelig overrasket i dag da jeg oppdaget at boken jeg har
+gitt ut
+<a href="https://www.amazon.com/Fri-kultur-Norwegian-Lawrence-Lessig/dp/8269018236/">hadde
+dukket opp i Amazon</a>. Jeg hadde trodd det skulle ta lenger tid, da
+jeg fikk beskjed om at det skulle ta seks til åtte uker.
+Amazonoppføringen er et resultat av at jeg for noen uker siden
+diskuterte prissetting og håndtering av profitt med forfatteren. Det
+måtte avklares da bruksvilkårene til boken har krav om
+ikke-kommersiell bruk. Vi ble enige om at overskuddet fra salg av
+boken skal sendes til
+<a href="https://creativecommons.org/">Creative Commons-stiftelsen</a>.
+Med det på plass kunne jeg be
+<a href="https://www.lulu.com/shop/lawrence-lessig/fri-kultur/paperback/product-22441576.html">lulu.com</a>
+om å gi boken «utvidet» distribusjon. Årsaken til at
+bokhandeldistribusjon var litt utfordrende er at bokhandlere krever
+mulighet for profitt på bøkene de selger (selvfølgelig), og dermed
+måtte de få lov til å selge til høyere pris enn lulu.com. I tillegg
+er det krav om samme pris på lulu.com og i bokhandlene, dermed blir
+prisen økt også hos lulu.com. Hva skulle jeg gjøre med den profitten
+uten å bryte med klausulen om ikkekommersiell? Løsningen var å gi
+bort profitten til CC-stiftelsen. Prisen på boken ble nesten
+tredoblet, til $19.99 (ca. 160,-) pluss frakt, men synligheten øker
+betraktelig når den kan finnes i katalogene til store nettbokhandlere.
+Det betyr at hvis du allerede har kjøpt boken har du fått den veldig
+billig, og kjøper du den nå, får du den fortsatt billig samt donerer i
+tillegg noen tiere til fremme av Creative Commons.</p>
+
+<p>Mens jeg var i gang med å titte etter informasjon om boken
+oppdaget jeg at den også var dukket opp på
+<a href="https://books.google.no/books?id=uKUGCwAAQBAJ">Google
+Books</a>, der en kan lese den på web. PDF-utgaven har ennå ikke
+dukket opp hos <a href="https://www.nb.no/">Nasjonalbiblioteket</a>,
+men det regner jeg med kommer på plass i løpet av noen uker. Boken er
+heller ikke dukket opp hos
+<a href="https://www.barnesandnoble.com/">Barnes & Noble</a> ennå, men
+jeg antar det bare er et tidsspørsmål før dette er på plass.</p>
+
+<p>Boken er dessverre ikke tilgjengelig fra norske bokhandlere, og
+kommer neppe til å bli det med det første. Årsaken er at for å få det
+til måtte jeg personlig håndtere bestilling av bøker, hvilket jeg ikke
+er interessert i å bruke tid på. Jeg kunne betalt ca 2000,- til
+<a href="http://www.bokbasen.no/">den norske bokbasen</a>, en felles
+database over bøker tilgjengelig for norske bokhandlere, for å få en
+oppføring der, men da måtte jeg tatt imot bestillinger på epost og
+sendt ut bøker selv. Det ville krevd at jeg var klar til å
+sende ut bøker på kort varsel, dvs. holdt meg med ekstra bøker,
+konvolutter og frimerker. Bokbasen har visst ikke opplegg for å be
+bokhandlene bestille direkte via web, så jeg droppet oppføring der.
+Jeg har spurt Haugen bok og Tronsmo direkte på epost om de er
+interessert i å ta inn boken i sin bestillingskatalog, men ikke fått
+svar, så jeg antar de ikke er interessert. Derimot har jeg fått en
+hyggelig henvendelse fra Biblioteksentralen som fortalte at de har
+lagt den inn i sin database slik at deres bibliotekskunder enkelt kan
+bestille den via dem.</p>
+
+<p>Boken er i følge
+<a href="http://bibsys-almaprimo.hosted.exlibrisgroup.com/primo_library/libweb/action/display.do?tabs=detailsTab&ct=display&fn=search&doc=BIBSYS_ILS71518423420002201&indx=1&recIds=BIBSYS_ILS71518423420002201&recIdxs=0&elementId=0&renderMode=poppedOut&displayMode=full&frbrVersion=&dscnt=0&tab=library_catalogue&dstmp=1448543801124&vl(freeText0)=fri%20kultur&vid=UBO&mode=Basic">Bibsys/Oria</a>
+og bokdatabasen til
+<a href="https://www.deich.folkebibl.no/cgi-bin/websok?tnr=1819617">Deichmanske</a>
+tilgjengelig fra flere biblioteker allerede, og alle eksemplarer er
+visst allerede utlånt med ventetid. Det synes jeg er veldig gledelig
+å se. Jeg håper mange kommer til å lese boken. Jeg tror den er
+spesielt egnet for foreldre og bekjente av oss nerder for å forklare
+hva slags problemer vi ser med dagens opphavsrettsregime.</p>