PoempelFox Blog

[..] [RSS Feed]
 

Sat, 13. Aug 2016


Why 2.4 GHz WLAN is no fun in the city Created: 13.08.2016 14:55
I've long since given up on using 2.4 GHz wireless at home, because just 3 meters from the access point there was packet loss and it really wasn't fun to use. That wasn't surprising, because I live in a big city, and since everybody has a WiFi network at home those days, I can receive about 20 foreign WiFi networks just sitting in my living room. And of course, because 2.4 GHz effectively only has 3 different usable channels (1, 6, 11), they very much interfere and disturb each other.

Recently, I had a spare old WiFi router with OpenWRT on it lying around, and got the idea from IRC to use this for measuring just how full the 2.4 GHz band is.
On an OpenWRT router, the command iw dev devicename survey dump will display something like:
Survey data from wlan0
        frequency:                      2412 MHz
        noise:                          -95 dBm
        channel active time:            22017 ms
        channel busy time:              9749 ms
        channel receive time:           9457 ms
        channel transmit time:          0 ms
It will show that for all channels. The active time is the amount of time the device was tuned to that channel, and the busy time is the amount of time the device thought the channel to be in use by others (since it doesn't send anything itself). I wrote a simple script to change channels every 22 seconds so that stats for all relevant channels were available. From the collected data, I drew graphs. Here is the result:

Now as you can see, on any average day just the noise from foreign WiFis blocks all available 2.4 GHz channels for a huge percentage of time. There is hardly any airtime left for sending data.
You can also see why I switched to using only 5 GHz WiFi some time ago: Channel 040 is the 5 GHz channel I use, and noone in the neighbourhood besides me uses it. There is only one other 5 GHz WLAN on channel 36 that I can occassionally receive in my appartment, all the other channels are unused.
no comments yet
write a new comment:
name or nickname
eMail adress (optional)
Your comment:
calculate: (2 times 10) plus 3

Mon, 11. Jul 2016


Foxtemp 2016 Created: 11.07.2016 20:34
A few years ago, I constructed my DS1820toUSB device for attaching a temperature sensor to USB. This year, it was time for a new generation: The Foxtemp2016. The main trigger for that was that I wanted to measure humidity in addition to the temperature. I've also since experimented with the home automation software FHEM. While there are a lot of sensors for commercial weather stations that can be received by FHEM, it's always a bit of a gamble: Nobody knows whether the manufacturer perhaps made minor changes to the sensor that break its compatibility with FHEM, and even if that is not the case, those things are usually extremely poorly documented, so you don't know what accuracy they have. You'll also have to buy what's currently available, so unless you buy all your sensors at the same time, you'll usually end up with a whole zoo of different sensors.

The new features of Foxtemp2016 compared to DS1820toUSB are:
  • Now wireless. Sadly, that means it needs to be powered by batteries, and you'll need a receiver for the wireless data.
  • uses a SHT31 as a sensor, not a DS1820. As a result of this, it can now also measure humidity - the datasheet of the SHT31 claims it can do this at a typical accuracy of ±2% RH in the relevant ranges. It also claims a typical accuracy of ±0.3°C for the temperature measurement, so the accuracy is better than the ±0.5°C the DS1820 promises.


Instead of constructing everything from scratch, this time I used premade parts: The microcontroller board that is the base for this is a JeeNode micro v3, and the sensor is on a Adafruit SHT31 breakout board. However, both are open hardware designs, so should they no longer be made, you could still make them yourself. Sadly, due to those premade parts this isn't nearly as cheap as a ds1820tousb, but that really wasn't a top priority for me.

The data from the Foxtemp2016 devices can be received with the same JeeLink (V3) you'd probably use for receiving cheap commercial weather station sensors. You essentially just need to enable something when compiling the firmware for use with FHEM. A small module for making FHEM understand the data received is also included.

You can find the build instructions and more pictures over in the Foxtemp2016 gitlab repository.
no comments yet
write a new comment:
name or nickname
eMail adress (optional)
Your comment:
calculate: (2 times 10) plus 3

Sun, 21. Feb 2016


Download redirector for Debian CD and DVD images Created: 21.02.2016 10:50

The problem

If you ever downloaded Debian CD and/or DVD images from the internet via HTTP/FTP (and not via Torrent), you'll have come across the 'Debian CD/DVD images via HTTP/FTP' website. So did I on multiple occasions, and when I last visited it to download a Jessie image after that was released, I noticed that it still was as horrible as always: There are links to downloads for each architecture, but they all point to the main site for CD/DVD images in Sweden. There is also a list of all known mirrors hidden away at the bottom of the page, but even if you happen to find that, it is next to useless:
  • It does link to mirrors that have been down for weeks or months
  • It does link to mirrors that do not have the current version (yet)
  • The links point to the root of the mirror, not to the directory containing the image for the current version, meaning you'll have to find your way there, which sometimes isn't easy. And of course, if you actually selected a mirror that does not have the file that you wanted, you'll have to start over with another mirror... In some cases it may not even be obvious if the mirror really does not have the file that you wanted, or you just got lost in the maze of directories with no description.
As a result, nobody uses the mirrors, everyone just uses the main site in Sweden. I can actually confirm that, as I run a listed public mirror of debian-cd at work, and even during release-time it is one of our least traffic-generating mirrors with only a few gigabytes per day - while the site in Sweden pushes out 10+ GBit. While they don't seem to mind the traffic surge that generates, this is still less than ideal. Especially with huge files like 4 GB DVD ISO-images, it does make a huge difference if you download them from another continent, or at least ten times as fast from a mirror in the same country.

The solution

Ideally, the download-page would send you to a mirror that is local to you and has the file that you want automatically. This would better spread the load and also improve the user experience through faster downloads.
This is actually not rocket science. Software that does that is available, and in fact is already in use by Debian: httpredir.debian.org does exactly that for the archive, i.e. the repositories that apt uses. Unfortunately, the software used for httpredir can only handle package repositories, because it needs the index files in those repositories. It would be hard and messy to implement support for redirecting debian-cd into the software used for httpredir. There is however other existing software of this kind that would work very well for debian-cd. The two most popular solutions are Mirrorbrain and Mirrorbits. Both boast a very similiar featureset, as Mirrorbits was written by a VLC developer to replace Mirrorbrain because it allegedly became too slow. Even the commandline-interface of both is almost identical.
The way this works is that Mirrorbrain knows about all the public mirrors of debian-cd and their location. It will check if they are up every few minutes, and it will also scan their contents in regular intervals, so that it knows which mirrors have which files. When a client asks the Mirrorbrain-server for a file, the server will look up the client in his GeoIP and ASN databases. As a result of that, it will usually know in which country and on which ISP the client is. It will then try to find a good mirror for the client to use. It will automatically ignore mirrors that are down or do not have the file that was requested (because they are partial mirrors, or out of sync). If there is one (or multiple) mirrors on the same subnet or the same ASN (in simplified terms, the same ISP) it will select those. If there aren't, it will look for mirrors in the same country, and select a random one of those. If no mirrors are in the same country, the search is broadended to the same continent. Only if that search is also unsuccessful, or if the initial GeoIP-lookup failed to return a country for the client, a random server from all over the world will be selected. The client will then get a HTTP 302 response that redirects it to the selected server, which will send the actual file.

The catch

So why is this not live yet? Well, in a way it is, see below.
But for this to run as an official debian service on official debian infrastructure, there is one major prerequisite: The software needs to be in the standard Debian package repositories. And unfortunately, so far neither Mirrorbrain nor Mirrorbits are.
There actually are Debian packages available for Mirrorbrain, but not in the standard Debian repositories. They would probably need some work to make them compliant with Debian packaging policies. Mirrorbrain consists of multiple packages, among them three small Apache-modules.
For Mirrorbits there are no packages available, and I imagine packaging it will not be fun, because it's the typical "lets download 1000 random libraries in random, mostly beta-versions, because we have to use the absolutely latest features, from random sites around the internet" kind of software. I'll rant about how much I loathe that another time. On the plus side, Mirrorbits packs everything, from builtin webserver to command line utilities, into just one binary, so there will only be one mirrorbits-package. It is also the newer project and under active development.
So far, all attempts to find a Debian Developer to create and maintain packages have been unsuccessful. If you are a Debian Developer and willing to package Mirrorbrain or Mirrorbits - please do. It doesn't really matter which one, both will provide the required featureset, and both have their advantages and disadvantages.

Running instance

Originally because I wanted to toy around a bit with Mirrorbrain, I actually did set up a working mirrorbrain-instance for debian-cd. If you want to give it a try, head over to
debian-cd.debian.net.
This is a fully functional mirror redirector for debian-cd downloads. It knows all mirrors of debian-cd contained in the official mirrorlist, and scans those that it can scan. If this were running on official DSA infrastructure and not on a private server run by me, all download-links on the webpage could be pointed at this tomorrow, and thus be automatically redirected.
It could still use some fine-tuning with regards to mirror selection though: For example, it is possible to set priorities for the mirrors within a country depending on how much bandwidth they have available, and that will make Mirrorbrain redirect more or less clients there; Or it might sometimes be a good idea to override the selection of servers for countries that do not have any mirrors on their own, because Mirrorbrains automatism based on geographic distance sometimes makes less than ideal choices. That however can only be improved by lots of feedback from lots of users. Feel free to send me feedback to the address given on the website. It should be possible to import all tuning made on my demo-instance into a production-version on official Debian infrastructure, which will hopefully happen one day.
For any feedback, it is imperative to know what mirrorbrain thinks about you: Where you're coming from, which mirrors it considered, and why. Luckily, one can easily get that info: You just need to append ?mirrorlist to the download URL, and instead of redirecting you, Mirrorbrain will give you lots of info helpful for debugging. Here is an example output from this in a case where mirror selection worked perfectly:

As you can see, it recognized there is a mirror on the very same subnet (because the university happens to run a debian mirror), and since it is up and has the requested file, the client would be redirected there. If the mirror were down, Mirrorbrain would randomly select (with the "prio" values influencing the likeliness of a mirror getting selected) a mirror from the next group of "same AS", and so on if none was available there.
The Mirrorbrain-version running is mostly the current one from the Mirrorbrain and mod_asn Github repositories with a few minor fixes for IPv6 support applied. The latest released version does not support IPv6 yet, the git version does, but still had a few bugs in that - I've reported them upstream and sent pull requests for some of them. They'll hopefully be fixed soon. Apart from that, there really isn't anything special about this installation. Most of the work setting this up was feeding it the mirrorlist. That was because the official mirrors.masterlist contained A LOT of mirrors, many of them dead, with wrong paths, not answering to rsync or ftp even though the masterlist said they would, and so on. That meant that even though I had a script that would compare the list of mirrors in Mirrorbrain and the one in the masterlist and spit out the commands needed for bringing those into sync, I would have to manually check every second entry, because the masterlist was just wrong. It took me some hours to get all about 130 mirrors into Mirrorbrain. In some rare cases, mirrors are actually up, but cannot be used in Mirrorbrain. That happens because Mirrorbrain needs to scan what files a mirror has, and for that it needs a way to get a directory listing. If a mirror only offers HTTP and no FTP or RSYNC, and prints the directory listings in a format that misses vital information or is just too messed up for Mirrorbrain to parse, that mirror cannot be used, even though it might be perfectly fine for downloading. However that applies to less than 5% of all mirrors, so there aren't that many lost due to that.
If you want to see a list of mirrors currently known to the Mirrorbrain instance, have a look at http://debian-cd.debian.net/mirrorlist.html. It also shows a nice map of the mirror locations.
My biggest hope in running this demo instance is that seeing how good this works in practice will motivate someone to take on the packaging. Lets see if that works out. Until then, spread the word that this option exists. I plan to keep this running for the foreseeable future.
no comments yet
write a new comment:
name or nickname
eMail adress (optional)
Your comment:
calculate: (2 times 10) plus 3

Fri, 12. Feb 2016


Heizungsspass Created: 12.02.2016 20:44
Last modified: 20.02.2016 18:00
Seit über einem Monat habe ich Probleme mit meiner Heizung. Und obwohl seit mehreren Wochen eigentlich bekannt ist, wo das Problem liegt, schafft es das "Kompetenzteam" aus GBW Reparaturservice und beauftragter Heizungsfirma (Herzog Sanitär aus Allersberg) nicht, das Problem zeitnah und dauerhaft zu beheben. Aber der Reihe nach.
  • Bereits in den Weihnachtsferien deuten sich die Probleme an: Die beiden Heizkörper im Wohnzimmer zeigen gelegentlich Aussetzer. Sie werden nicht mehr so heiss wie normal, manchmal werden sie sogar nur noch lauwarm - das erzeugt natürlich genau gar keine Heizwirkung. Die Thermostate (dank digitaler Thermostate kann ich das gut verfolgen) haben das Ventil praktisch dauernd zu 100% offen um die Temperatur zu halten. Wann sie warm werden scheint zeitabhängig zu sein: Nachts heizen sie ordentlich, tagsüber meist nicht.
  • Fr., 22.01.: Da die Heizkörper im Wohnzimmer seit zwei Tagen überhaupt nicht mehr warm werden, sondern eiskalt sind, rufe ich beim "GBW Reparaturservice" an. Die GBW hat fast alles, was früher die Hausmeister erledigt haben, an eine Firma in München outgesourcet. Folglich telefoniert man bei Problemen in seiner Wohnung in Erlangen mit einem Callcenter im 200 km entfernten München, das selbstverständlich durch ganz hervorragende Kenntnisse der lokalen Gegebenheiten glänzt. Und selbstverständlich spricht man bei jedem Anruf mit einem anderen Mitarbeiter, die übliche Callcenterhölle halt. Die geben dann erstmal wahnsinnig hilfreiche Tips wie "entlüften" - was ja im Prinzip nicht verkehrt ist, nur: Ich wohne im Erdgeschoss eines mehrstöckigen Hauses, da ist Luft im Heizkörper ein eher seltenes Problem. Und wenn noch nichteinmal die Zuleitungsrohre zu den Heizkörpern warm werden, umgekehrt aber wenn sie gerade funktionieren die Heizkörper von vorne bis hinten absolut gleichmässig heiss werden, dann ist das kein Problem das sich mit entlüften meiner Heizkörper lösen lässt.
    Langer Rede kurzer Sinn: Da das Problem nicht dringlich ist, bekomme ich einen Termin am Do., 28.01., da soll jemand vorbeikommen um sich das anzusehen.
    Ich versuche abends noch die Heizkörper zu entlüften, aber es ist wie erwartet: Da ist keine Spur von Luft drin, da kommt sofort ein Schwall Wasser (auch bei den Heizkörpern die gerade eiskalt sind).
  • So., 24.01.: Am späten Nachmittag sind plötzlich alle 5 Heizkörper in der Wohnung komplett kalt.
  • Mo., 25.01.: Als ich morgens aufstehe, steht das GBW Hausmeisterauto vor der Tür, und die Heizung in der Küche funktioniert wieder. Ich nehme an, der Hausmeister würde die Heizung reparieren, das erweist sich aber als Irrtum, er hat nur Aushänge gemacht. Zwei Stunden später ist auch der Heizkörper in der Küche wieder eiskalt.
  • Di., 26.01.: Ich telefoniere morgens erneut mit dem Reparaturservice, und melde dass jetzt alle Heizkörper ausgefallen sind und es in meiner Wohnung unangenehm kalt wird. Die erste Mitarbeiterin besteht darauf, dass ich erst noch die anderen Hausbewohner befrage, ob bei denen die Heizung funktioniert, denn wenn es bei denen funktioniert handelt es sich ja um keinen Notfall. Dem kann ich nicht so ganz zustimmen, ich finde eine komplett unheizbare Wohnung die mittlerweile 17 Grad hat, Tendenz fallend, eigentlich Notfall genug, versuche es aber trotzdem - wenig erfolgreich. Bei der einzigen Dame die daheim ist funktioniert die Heizung - die hängt aber auch offensichtlich an einem anderen Heizungsstrang. Beim zweiten Anruf wird das Problem dann trotzdem aufgenommen, und ich werde gebeten daheimzubleiben, damit ich da bin wenn der Heizungsnotdienst kommt. Das tue ich dann.
    Als bis 17:30 noch niemand aufgetaucht ist oder sich auch nur gemeldet hat, rufe ich erneut beim Reparaturservice an. Ich erhalte die Auskunft, das Problem wäre an die Firma Herzog weitergegeben worden, und die hätten einen 24h Notdienst, es könnte also auch sein dass der Techniker erst um 20 Uhr auftaucht. Tut er selbstverständlich nicht, weder an diesem Tag noch am Folgenden. Aber man opfert doch gerne einen Tag Urlaub um sich verarschen zu lassen...
    Ich denke ausserdem erst, ich hätte den Namen der Heizungsfirma falsch verstanden, denn beim googlen nach dem Namen ist die näheste Firma mit diesem Namen in Allersberg, also gut 50 km entfernt. In den Folgenden Tagen stellt sich jedoch heraus: Nein, ich hab den Namen schon richtig verstanden. Die haben wirklich eine Firma beauftragt, die 50 km Anfahrt hat. Vermutlich muss man noch froh sein, wenn sie nicht gleich eine aus München beauftragen...
  • Do., 28.01.: Es meldet sich endlich jemand von Herzog. Ist also eher ein 3x24h-Reaktionszeit-Notdienst als ein 24h Notdienst. Der Techniker soll im Laufe des Nachmittags kommen. Er kommt tatsächlich um kurz nach 13:00. Dass das Problem nicht in meiner Wohnung liegt, ist ihm relativ schnell klar - nachdem er überprüft hat dass alle Heizkoerper kalt sind aber die Ventile gängig sind. Allerdings hat er wohl die Schlüssel für den Heizungskeller vergessen, so dass wir dort nicht reinkommen - er ruft den Hausmeister an, der ihm aufsperrt. Seine Fehlersuche im Keller ist erst nicht erfolgreich, und er überprüft die Heizungsanlage im Nebenhaus, ebenfalls ergebnislos. Schliesslich wird er doch noch fündig: Das Problem ist ein Differenzdruckregler, der den Druck des Heizungsstrangs an dem ich hänge regeln sollte, und ihn offensichtlich auf "null" regelt. Als er dran rumfummelt geht das Ding mit einem hörbaren WOOOSH Geräusch plötzlich auf - und bei mir in der Wohnung werden praktisch sofort die Heizkörper nicht nur warm, sondern ordentlich heiss. Was genau es nun war weiss er auch nicht - er meint, sowas könnte schonmal vorkommen, die Dinger würden halt altern. Er glaubt nicht, dass das Problem nochmal auftreten wird. Oh wie falsch er damit lag...
  • Mo., 01.02.: Die Heizkörper im Wohnzimmer bleiben erneut eiskalt, jedenfalls tagsüber - nachts wird einer der beiden manchmal lauwarm. Bei den Heizkörpern im Rest der Wohnung ist das Bild gemischt, der im Bad wird manchmal heiss und manchmal auch nicht. Nur der in der Küche funktioniert fast immer.
  • Di., 02.02.: Ich melde den erneuten Ausfall beim Reparaturservice. Sie wollen es erneut an die Firma Herzog weitergeben, die würde sich dann bei mir melden.
  • Mo., 08.02.: Ich rufe erneut beim Reparaturservice an. Sie wollen bei Herzog nachfragen.
  • Di., 09.02.: Ich rufe erneut beim Reparaturservice an, und bin langsam wirklich froh dass ich eine Telefonflat habe. Die Mitarbeiterin vom Reparaturservice versucht direkt bei Herzog nachzufragen, dort geht aber nur der Anrufbeantworter ran, der verkündet, dass die komplette Firma in den Faschingsferien ist. Allerdings habe ihre Kollegin am Vortag wohl jemanden erreicht, und der Firmeninhaber selbst habe versprochen, sich um das Problem zu kümmern. Sie verspricht weiter zu versuchen die Firma zu erreichen, und mich auf jeden Fall zurückzurufen. Richtig geraten, ein Rückruf kam natürlich nie.
  • Fr., 12.02.: Ab 5:30 morgens werden die Heizkörper im Wohnzimmer plötzlich wieder warm, die Ursache ist unbekannt - vielleicht ist einer der Nachbarn übers Wochenende weggefahren und hat die Heizung abgedreht, so dass der Druck wieder für mich reicht. Die Heizkörper im Wohnzimmer werden jedenfalls wieder brauchbar warm. Nicht so heiss wie normal, aber immerhin so warm dass sie eine spürbare Heizwirking erzielen - die ganze Zeit über voll aufgedreht schaffen sie es bis mittags, das Wohnzimmer auf fast 21 Grad aufzuheizen.
    Um 12:50 ruft mich plötzlich ein Techniker von Herzog an, er wäre jetzt bei mir daheim, ob ich kommen könnte. Satte 10 Tage, nachdem ich das Problem gemeldet habe, und vollkommen unangekündigt. Da ich aber natürlich daran interessiert bin, dass meine Heizung irgendwann wieder normal funktioniert, radel ich von der Arbeit nach Hause.
    Dort muss ich feststellen, dass der Techniker (ein anderer als beim letzten Mal) zwar wenigstens die Schlüssel für den Heizungskeller dabeihat, aber leider nicht hier ist um den defekten Differenzdruckregler zu reparieren oder tauschen. Im Gegenteil weiss er noch nichtmal ansatzweise, was sein Kollege vor 2 Wochen bereits getan hat, und auch sonst erweckt er nicht unbedingt einen kompetenten Eindruck:
    • Er faselt irgendwas davon, dass er im Keller Luft in den Leitungen gehört hätte, und man dringend entlüften müsste.
    • Er dreht wild an den Ventilen für die anderen beiden Heizungsstränge im Haus herum. Die sind jetzt vermutlich nicht mehr so justiert wie früher...
    • Er sucht die Heizunganlage unter dem Dach. Klar, bei den 15 cm dicken isolierten Rohren, die im Heizungskeller aus der Wand kommen, und beschriftet sind mit "Fernwärme Heizung von X-Y-Strasse 42", kann man unmöglich darauf kommen, dass das warme Wasser im Nebengebäude erzeugt wird...
    • Er führt mir stolz vor, wie der Differenzdruckregler funktioniert, als ob ich das nicht wüsste. Natürlich stellt er ihn danach nicht wieder so ein wie zuvor, sondern irgendwie. Und natürlich geht durch das Rumfummeln, wie bereits zwei Wochen vorher, der Regler wieder auf und regelt erstmal wieder so wie er sollte - was er aber nicht kapiert.
    • Als er danach feststellt, dass die Heizkörper heiss sind, hält er mich offenbar für zu blöd den Thermostat zu bedienen.
    Die traurige Vorstellung endet damit, dass er unter dem Vorwand, im Nachbargebäude den Wasserstand prüfen zu wollen abhaut ohne sich zu verabschieden. Aber immerhin: versehentlich hat er den kaputten Regler erstmal wieder gängig gemacht, meine Heizung funktioniert wieder. Wenn auch, weil er den Regler ja komplett verstellt hat, im "Luzifer-Modus": Der Druck den er eingestellt hat ist offensichtlich viel zu hoch, die Thermostate schiessen regelmässig über die eingestellte Temperatur hinaus, weil selbst eine Öffnung des Ventils von nur 10% die Heizkörper innerhalb von 2 Minuten so heiss werden lässt, dass man sie nicht mehr berühren kann ohne sich die Finger zu verbrennen.
  • to be continued... Ich glaube nicht, dass die Geschichte hier zu Ende ist. Der Regler ist immer noch der alte, nur dass er jetzt völlig verstellt ist, und wird vermutlich bald wieder das spinnen anfangen. Vielleicht funktionierts ja noch bis zum Sommer...
Ich hab jedenfalls daraus gelernt: Beim nächsten Mal werde ich nicht naiv damit rechnen, dass die beteiligten Firmen irgendwas auf die Reihe bekommen, und gleich den Anwalt einen hübschen Brief zum Thema saftige Mietminderung aufsetzen lassen. Vielleicht bringt das ja Bewegung in die Sache.
no comments yet
write a new comment:
name or nickname
eMail adress (optional)
Your comment:
calculate: (2 times 10) plus 3
 

EOPage - generated with blosxom