Petter Reinholdtsen

Entries from December 2015.

OpenALPR, find car license plates in video streams - nice free software
23rd December 2015

When I was a kid, we used to collect "car numbers", as we used to call the car license plate numbers in those days. I would write the numbers down in my little book and compare notes with the other kids to see how many region codes we had seen and if we had seen some exotic or special region codes and numbers. It was a fun game to pass time, as we kids have plenty of it.

A few days I came across the OpenALPR project, a free software project to automatically discover and report license plates in images and video streams, and provide the "car numbers" in a machine readable format. I've been looking for such system for a while now, because I believe it is a bad idea that the automatic number plate recognition tool only is available in the hands of the powerful, and want it to be available also for the powerless to even the score when it comes to surveillance and sousveillance. I discovered the developer wanted to get the tool into Debian, and as I too wanted it to be in Debian, I volunteered to help him get it into shape to get the package uploaded into the Debian archive.

Today we finally managed to get the package into shape and uploaded it into Debian, where it currently waits in the NEW queue for review by the Debian ftpmasters.

I guess you are wondering why on earth such tool would be useful for the common folks, ie those not running a large government surveillance system? Well, I plan to put it in a computer on my bike and in my car, tracking the cars nearby and allowing me to be notified when number plates on my watch list are discovered. Another use case was suggested by a friend of mine, who wanted to set it up at his home to open the car port automatically when it discovered the plate on his car. When I mentioned it perhaps was a bit foolhardy to allow anyone capable of placing his license plate number of a piece of cardboard to open his car port, men replied that it was always unlocked anyway. I guess for such use case it make sense. I am sure there are other use cases too, for those with imagination and a vision.

If you want to build your own version of the Debian package, check out the upstream git source and symlink ./distros/debian to ./debian/ before running "debuild" to build the source. Or wait a bit until the package show up in unstable.

Tags: debian, english, nice free software.
Using appstream with isenkram to install hardware related packages in Debian
20th December 2015

Around three years ago, I created the isenkram system to get a more practical solution in Debian for handing hardware related packages. A GUI system in the isenkram package will present a pop-up dialog when some hardware dongle supported by relevant packages in Debian is inserted into the machine. The same lookup mechanism to detect packages is available as command line tools in the isenkram-cli package. In addition to mapping hardware, it will also map kernel firmware files to packages and make it easy to install needed firmware packages automatically. The key for this system to work is a good way to map hardware to packages, in other words, allow packages to announce what hardware they will work with.

I started by providing data files in the isenkram source, and adding code to download the latest version of these data files at run time, to ensure every user had the most up to date mapping available. I also added support for storing the mapping in the Packages file in the apt repositories, but did not push this approach because while I was trying to figure out how to best store hardware/package mappings, the appstream system was announced. I got in touch and suggested to add the hardware mapping into that data set to be able to use appstream as a data source, and this was accepted at least for the Debian version of appstream.

A few days ago using appstream in Debian for this became possible, and today I uploaded a new version 0.20 of isenkram adding support for appstream as a data source for mapping hardware to packages. The only package so far using appstream to announce its hardware support is my pymissile package. I got help from Matthias Klumpp with figuring out how do add the required metadata in pymissile. I added a file debian/pymissile.metainfo.xml with this content:

<?xml version="1.0" encoding="UTF-8"?>
<component>
  <id>pymissile</id>
  <metadata_license>MIT</metadata_license>
  <name>pymissile</name>
  <summary>Control original Striker USB Missile Launcher</summary>
  <description>
    <p>
      Pymissile provides a curses interface to control an original
      Marks and Spencer / Striker USB Missile Launcher, as well as a
      motion control script to allow a webcamera to control the
      launcher.
    </p>
  </description>
  <provides>
    <modalias>usb:v1130p0202d*</modalias>
  </provides>
</component>

The key for isenkram is the component/provides/modalias value, which is a glob style match rule for hardware specific strings (modalias strings) provided by the Linux kernel. In this case, it will map to all USB devices with vendor code 1130 and product code 0202.

Note, it is important that the license of all the metadata files are compatible to have permissions to aggregate them into archive wide appstream files. Matthias suggested to use MIT or BSD licenses for these files. A challenge is figuring out a good id for the data, as it is supposed to be globally unique and shared across distributions (in other words, best to coordinate with upstream what to use). But it can be changed later or, so we went with the package name as upstream for this project is dormant.

To get the metadata file installed in the correct location for the mirror update scripts to pick it up and include its content the appstream data source, the file must be installed in the binary package under /usr/share/appdata/. I did this by adding the following line to debian/pymissile.install:

debian/pymissile.metainfo.xml usr/share/appdata

With that in place, the command line tool isenkram-lookup will list all packages useful on the current computer automatically, and the GUI pop-up handler will propose to install the package not already installed if a hardware dongle is inserted into the machine in question.

Details of the modalias field in appstream is available from the DEP-11 proposal.

To locate the modalias values of all hardware present in a machine, try running this command on the command line:

cat $(find /sys/devices/|grep modalias)

To learn more about the isenkram system, please check out my blog posts tagged isenkram.

Tags: debian, english, isenkram.
Bokhandeldistribusjon av boken Fri kultur av Lawrence Lessig
14th December 2015

Besøk lulu.com eller Amazon for å kjøpe boken på papir, eller last ned ebook som PDF, ePub eller MOBI fra github.

Jeg ble gledelig overrasket i dag da jeg oppdaget at boken jeg har gitt ut hadde dukket opp i Amazon. 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 Creative Commons-stiftelsen. Med det på plass kunne jeg be lulu.com 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.

Mens jeg var i gang med å titte etter informasjon om boken oppdaget jeg at den også var dukket opp på Google Books, der en kan lese den på web. PDF-utgaven har ennå ikke dukket opp hos Nasjonalbiblioteket, men det regner jeg med kommer på plass i løpet av noen uker. Boken er heller ikke dukket opp hos Barnes & Noble ennå, men jeg antar det bare er et tidsspørsmål før dette er på plass.

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 den norske bokbasen, 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.

Boken er i følge Bibsys/Oria og bokdatabasen til Deichmanske 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.

Tags: freeculture, norsk.

RSS Feed

Created by Chronicle v4.6