Tinkering with Raspberry (and other things)

OSX El Capitan 10.11.4 and the CardDav Bug

I have been moving my OwnCloud instance to another provider and while I was at it, I migrated to nextCloud. Everything worked fine on all my devices. Even the newly acquired Windows Surface Book did not have any problem with syncing my contacts and calendars.

Well, for the Macs running El Capitan, things are different. There is a well known bug with the way El Capitan handles the carddav-protocol and Apple has not been able or willing to fix it. There’s loads of information about this on the internet but with 10.11.4 these workarounds stopped working (at least for me). After spending 2 hours editing .htaccess files and trying every possible permutation of servername and path in the “Internet Accounts” panel on my machine, I finally found a solution.

First, you still need redirects. My NextCloud installer did add them to .htaccess on its own. If you are running NextCloud or Owncloud in a subdirectory of your domain just add a .htaccess file at the webroot directory. The following lines did the trick (assuming the cloud installation is in subdirectory “MYDIR”):

RewriteEngine on
  RewriteRule ^\.well-known/carddav /MYDIR/remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /MYDIR/remote.php/dav/ [R=301,L]

On to the System Settings -> Internet Accounts on the Mac.
Add an new CalDav-Account in the following manner:
Account Type: Advanced
Password: userpassword
Server Address:
Server Path: /MYDIR/remote.php/carddav/principals/USERNAME/
Port: 443
Use SSL: X

With these settings I was able to start the Contacts app and after a few seconds all my contacts appeared. If you open this account via the Contacts app’s Settings menu you will not see the Server Path you added in the above steps. Do not try to edit this path.

Elevator Information Display using two ILI9341 TFTs

It has been a long time since my last post, well, I have been busy and had significantly less time for tinkering.

But back again. Take an old elevator panel, two displays and a Raspberry Pi and transform it into a home information system.

Ingredients and Original Idea

  • A really old but massive elevator panel with all the original wiring, the buttons and even the led-matrix displays.
  • A Raspberry Pi (of course)
  • Two ILI9341 2.2″ TFT panels
  • Adafruit’s python library for ILI9341

My original idea was to reuse the LED-matrix from the old panels to display some information. This unfortunately was not possible as these are not ‘normal’ matrix displays but do have some sort of logic built in. Applying a voltage on the terminals (in the middle of the picture) does display the preprogrammed floor numbers in the display. Well, this is not a big issue, TFT displays are much cooler.
Here is an image of the unaltered elevator panel:original elevator panel

Continue reading

Mac OS – El Capitan bluetooth discoverabilty

I recently upgraded my Mid 2011 Mac Mini to El Capitan and had to discover that when Bluetooth was switched on, the machine stayed discoverable via Bluetooth. Living in the middle of a big city this is a gerat security risk. I just don’t want everybody in the neighborhood to be able to see my Mac.

There are numerous instructions on the internet on how to disable the bluetooth visiblity via terminal commands (e.g. at but none of that did work. So I decided on checking the alternatives. And succeeded, thus this blog post. Continue reading

Making an eGalax/Pollin touchscreen work with tslib

Some months ago I found a cheap 7″ LCD screen with a resistive touch-panel. Searching the internet gave me some hope that the screen would work perfectly with my RaspberryPi. And alas, it did. Under XWindows, which I wasn’t going to use on the project I had in mind when buying the touch-display. So the search began and lastet. There’s lots of information out there about eGalax-touchscreens, most of it stating that one needs to compile a custom kernel, hack into some outdated driver software and so on.

After some investigation it became clear that the information available is mostly outdated, as the newer Raspbian images do recognize the touchscreen without compiling a custom kernel. So I started on my own and tried to get the screen working not with XWindows, but directly with the framebuffer. Continue reading


Windows Phone 8.1 on Nokia Lumia – A rant (Updated 2014-07-14)

I know I have been quiet for a while now. And now I start a rant? Yes, I need to share my thoughts because otherwise I will definitely crush a phone.

For those interested why I have been so quiet: I got myself a new job, switched from freelance work to a permanent position. So no more tinkering around when I am in fact in my home office…

Now on to the rant:

At the moment of writing this blog post I am literally seconds away from just throwing my girlfriend’s new Nokia Lumia 635, which I have the honour of setting up (at least I am the nerd here), out of the window or, to avoid being sued by passers-by, with full force against a wall. And I think I could happily live with the best girlfriend ever not talking to me for a very long time. (No, not really).

So what has happened?
She needed a new phone and didn’t want an iPhone (quote: “Every idiot I have to talk to on business has one of these”) and she didn’t like the Android GUI and usability. So we looked at phones for some months and finally she decided on a Windows Phone. Mostly because she almost instantly knew how to use it. Well done on this, Microsoft.

I started searching the net to make sure the phone would integrate with our “infrastructure” we have set up at home and for remote access. That is, being able to connect to our Owncloud server via SSL, the handling of self-hosted IMAP accounts and, of course, how to prevent the phone from synchronizing private data (addresses, calendar entries) to Microsoft servers.
It took me some days but finally I came to the conclusion that all of this would be possible. In short:

  • create Microsoft account only for Store and phone setup
  • use only Microsoft Store vouchers and no credit card
  • Email address used for Microsoft account is not traceable to real-life name
  • Use iCloud account type to connect to Owncloud
  • IMAP push is working (just create an IMAP account, select 15 minutes as the sync interval and save it. Let the phone connect once to the account then go back to the account’s settings. If your imap account supports IMAP-Idle you should be able to select “As it arrives” as sync interval. At least on my Host Europe accounts it does work like this)

Why the rant?

Well, we’ll get there shortly. The phone was ordered and arrived 2 days later. Initial installation went smoothly, more or less (but that was mostly my fault). All of the above mentioned points are working with the phone. Yai!

Until now the phone is in its testing stage, connected to WLAN with no SIM inserted. This is just to test Owncloud syncing over a longer period of time to prevent the best girlfriend ever from getting angry if contacts/appointments would get lost…
During this time I stumbled upon some things I didn’t even think about checking first because I had the opinion they were state of the art and well established since years. Oh, how wrong was I…

Here’s the list of annoying things:

  • If connected to WLAN only and the date/time set to update automatically, the time and date are wrong every time the phone restarts or gets switched off/on again. This is because Microsoft, in its own mysterious ways, decided that WindowsPhone can’t synchronize the time over NTP. Windows Phones rely solely on NITZ, that is the date/time/timezone info needs to be transmitted over the air by your cell phone network. And of course not every provider supports NITZ…
  • The volume of the alarm clock can’t be controlled. No, not at all. It is at a fixed volume, the user has no control whatsoever. This follows the trend of most modern devices that the user is not allowed to decide what and how he/she wants things to behave, you have to live with what the manufacturer decided to be “the best experience for our valued customers”.
    So the only way to modify the alarm sound volume would be to take a custom sound file, put it through Audacity to reduce the volume and then copy that onto the phone.
  • You can not change the “Snooze/Sleep” time of the alarm. It is predefined at 9 minutes and you have to live with it.
  • You can’t set the phone to “Be silent and don’t vibrate” by using the volume buttons. The established “decrease volume – vibrate only – mute” that most phones have is not working. You can mute the sound but the phone is then set to “vibrate”. To switch that off you need to go into the settings menu.
  • Copying custom sounds to the phone is as far from straightforward and user friendly as “Star Trek – The final frontier” is from a good movie. I thought that, as the phone and its SD-card show up in the Windows Explorer, it would be sufficient to copy an MP3 to the “Ringtones” folder. Nope, that did not work. Setting the genre to “Ringtone”, as is suggested on the net, did not work. I finally had to download the WindowsPhone App, copy my sound files to the “Music” folder on the Windows machine (otherwise they won’t show up in the WindowsPhone App) and then, using the aforementioned App, mark the files to be used as ringtones and synchronize them with the phone.
  • You can’t even use ringtones/notification sounds stored on the SD-card. What a bummer is that?!

The updated part:

  • IMAP folders you create using ie Thunderbird do not show up in mail app. Only the folders that were present when you set up the imap account on the phone are shown. If you add/change/remove folders you need to remove the account from the phone and set it up again.
  • Sending full resolution photos via the mail app does not work. Photos always get resized. They suppose you should use OneDrive and share photos that way. This leads to
  • In order to sync full resolution photos with OneDrive you need WiFi. It does not work over 3G or 4G (“By design”):

Bildschirmfoto 2014-07-14 um 18.27.58

  • If you get mails with attached files and save them to the phone they may not show on the phone because:

Bildschirmfoto 2014-07-14 um 18.27.28

What the heck?

The possibility to adjust volumes for ringtones, notifications and alarms separately have been present on all my Nokia phones since the E51 or E90. All other phones I have been using lately do have this feature and I never thought that a new phone OS would omit that.
No time synchronization over NTP? Who decided on that? If it would have been a decision made by some politicians I would have thought “OK, they just did not know. It is ‘Neuland’ to them”. But a company such as Microsoft? I wouldn’t have been surprised if they had decided that time could only be synchronized by a service owned by Microsoft (using a proprietary protocol). But no time synchronization via internet connection? Fail.

Of course this is all for our best. Modern software is more and more designed to let me do what the software thinks I want to do or what is best for me. I could go with that if there was a button labeled “Let me do it on my own”. Have a software suppose the things that I most likely do need to configure or that are most likely needed at a certain point is a great thing. This should be to help and to support us. Not to restrict us from doing the things our way.

It is me who spent money and it is me who wants to have the final decision over what I want to do now. As a result I am responsible for my actions.
But wait, that is changing. Therefore phones may figure out by sensor readings when I am driving a car and during that time stop delivering SMS and phone calls.
STOP. I do not want a phone that is going to decide when it delivers an SMS or notifies me of a call. What would be next? Combine Facebook’s “what to display in the timeline” algorithm with the phone’s “when to notify user” behaviour? So that the phone decides which calls are important and which are not?


I and only I am still responsible for my actions. And can be held accountable for them, that is. So no electronic gadget tells me what to do, when to do it and how to do it. At least let me choose if I want it the “assisted way” or my own way.


Thanks for reading this. Details on how I managed to sync Owncloud (and get Owncloud up and running again), got instant mail notifications etc. will be in a next blog post. For now I need to put the Windows phone away or it will suffer…

1 Comment

Quick Tip: Which Bluetooth Services Does My Mobile Phone Offer

Ok, this has nothing to do with either the Raspberry Pi or any Android device but I think it may be helpful. At least it is for me.


I own a car with a rather expensive and somewhat “feature rich” hands-free equipment. It is capable of using the normal hands-free profile (HFP) or, and that is my preferred connection method, something called “rSAP” (remote SIM Access Profile). This means that the phone transfers the SIM credentials to the car’s system and this is then acting as a mobile phone with my SIM-card inserted (when, in fact, my SIM card stays in the mobile phone). The advantage of using this profile/technology is that the car uses its own outside antenna thus having less electromagnetic signals inside the car and a much better reception of signals.
As I came to understand the rSAP technology is not much used outside Germany/Europe. In fact, from discussions with friends from the US I came to the conclusion that rSAP is fairly unknown there.

The Problem:

rSAP is not a standard component of Android. There is an app in the Play Store that works (more or less) but it needs a rooted phone (no problem here, that is the first thing I usually do on my mobiles). Some Samsung mobiles (S2 and S3) with some (not all) Samsung stock firmwares do support rSAP.
And here’s the catch: if you update the Android system on the phone there is no guarantee whatsoever that the new version will have rSAP support built in. And most annoyingly, contacting the Samsung support does not help because the people there have no idea what “rSAP” is.
So what you could do is update the phone, walk to your car and check if rSAP works. Which, in may case is not very efficient because my car is parked in an underground car park 5 minutes from where I live. So I need to walk to my car, drive it out of the car park, check if everything works and then drive the car to my underground car park again…

The Solution:

Bluetooth services are announced or better, can be queried by applications. So it is much more convenient to flash a new Android version, query the Bluetooth services available from my computer and then continue or (after some swearing) revert to the previous Android version that had the rSAP service built in.
On my Mac there is an app called “RDP Browser“. It is freeware and works like a charm, even with Mavericks.

So my “workflow” now looks like this:

  1. Make a backup of my mobile phone
  2. Flash the new firmware
  3. Connect the mobile via bluetooth to the Mac
  4. Run RDP browser and look for a service called “SIM Access Server” and “OBEX Phonebook Access Server”
  5. Smile if it is there, swear if it is not and in that case: reflash the old firmware


Here’s a screenshot of the services offered by my Galaxy S3:

Bildschirmfoto 2014-05-23 um 18.39.38

Things were much easier with my Nokia E51. There were no updates and rSAP just worked. Well, in fact I did not yet update to Android 4.3. First of all because I do not want the Knox bootloader, second because I am getting more and more annoyed with Android (and iOS, by the way). It was fun and cool in the beginning but nowadays both operating systems get more and more into “gated communities” and I do not like that. Period. What happened to “Do no evil”, Google?

And, before the question arises: I own a Volkswagen Golf GTI Mark VI with the “Premium Freisprecheinrichtung” (PFSE). Why? Midlife crisis and not enough money for a Porsche, I suppose. No, seriouslyy: I wanted an everyday practical car that, when I’m driving it alone, would put an evil smile on my face every time I kick down the acceleration pedal…

Quicktip: Selfmade LED lamp with T5.5 socket (Telephone Lamp)

For my newest project, the “intelligent desk clock” (I shortly mentioned it at the end of the last post) I need to have big momentary switches that could be illuminated. The idea is to let the switch blink if there is user interaction needed.

I found some switches that need old-style bulbs with “telephone lamp” socket, technically a “T5.5” or “T5.5k” socket. These are usually bulbs running at 12V or higher. I want to realize the project with an Arduino or a Raspberry Pi, so 5V is the voltage I have available. LED lamps with T5.5 socket are rather expensive, luckily I was able to order 10 pieces for 7 EUR from ebay. They do have red LEDs but I thought I could desolder them and solder some white ones to the socket.

Today I found some cool switches at my electronics shop, immediately purchased a bunch and at home, was able to completely disassemble the switch. So I now am able to put some label behind the orange button! Of course the shop had the fitting bulbs in stock, with real lamps rated at 12V, but for 0.5EUR a piece. So I took some, too.

Here are pictures of the switch and the disassembled parts:


Make your own T5.5 LED lamp

Take a look at the T5.5 lamp from the shop. It’s just a metal socket an the bulb soldered to it. The metal parts are glued to the bulb with tiny spots of some hot glue. With the help of a scalpel and some brave cutting and bending (watch your fingers if the glass breaks) the bulb can be detached from the metal socket. With a firm pull the whole bulb can be teared off. Now take a soldering iron and clean the soldering spots and, using the scalpel, clean the glue residue from the socket.

Shorten the wires on the LED (remember which side is Anode and Cathode, respectively) and the resistor (I used 220 Ohms, the usual value when using 5V and an LED). Solder the resistor to one wire on the LED and bend the wires slightly outward so they will make contact with the metal socket when fitted in. (One square of the paper is 5mm x 5mm)


Now fit the LED into the socket so that the socket is just around the bottom of the LED. You will need some sort of fixation tool like alligator clamps to make your life easier. Now cautiously solder the wires to the socket and you’re done. You should end up with something like this:


You will definitely need all your patience making this LED thingy. Taken into account that an LED lamp with T5.5 socket will cost around 5EUR (6 USD) each, it’s worth the effort.

1 Comment

GPRS/GSM via Serial (again)

I recently stumbled over a cheap GPRS/GSM shield made for the Arduino platform, of course on ebay, of course from China. As it was priced at a very reasonable 20 EUR (25 USD), I thought I’d go with the risk and order from China. Several weeks later it finally arrived and, I couldn’t believe that at first, worked out of the box.

This is how it looks. If you get interested in one of these gadgets, just search for “GSM Arduino” on ebay, that should do the trick.


It’s a SIM900 based design and has a real time clock (plus buffer battery) on the back. A full description of all the possible AT-commands can be found here. It is basically the same shield that can be bought from Seedstudio, but much cheaper. A description with some sample sourcecode (that is working!) can be found at the Geeetech-Wiki pages. Continue reading


Owncloud – Good bye (for now)

Sorry I have been quite for a while, but real life starts to kick in. I changed from freelance projects to a permanent position and that leaves less time for tinkering. (Less home office, more work).

So what is this about discarding Owncloud?

As you may have read I used a Raspberry Pi with lighttpd and Owncloud to manage my own Caldav and Carddav server. This worked fine and reliable until some days ago. I suddenly could not ssh into my server any more and experienced random but numerous synchronization errors. Attaching a monitor and keyboard to check what had happened (never ever put a machine into a shelf in a way that you can’t easily attach a monitor/keyboard…) was the only way to access it.
The log files didn’t produce anything helpful so I checked for the ssh daemon (again: OK) and for better access opted to shut the machine down and do further investigations on my workbench. That was a great mistake…

After shutting down and rebooting all I got was a kernel panic, a corrupt file system and a non-working system. I tried to repair the filesystem on my Linux machine, using fsck. No success, the filesystem was damaged beyond repair. I took a new SD-card and copied a backup of my owncloud installation on it, to get my server up and running again. This worked. For exactly 9 hours. Then I had the exact same boot messages and the exact same corrupt filesystem.

I’m not giving up easily, so I took a third SD card (different manufacturer, different size, different speed class), did the backup thing again and, believe it or not, after one day this card’s filesystem has been corrupted, too.

At the moment I have no idea whatsoever, why my Raspberry Pi “eats” filesystems. On the other hand I need to have my contacts and appointments synced on a handful of devices, so I am in the need of a working caldav/carddav server. That is why I returned to Google. Yes, I know and I am not comfortable with that solution either. But until I have resolved that filesystem issue there seems to be no other way.

Funnily enough (no, not really), my second Raspberry Pi when running Owncloud with lighttpd is corrupting the filesystem at the same speed…

So I now suspect that something in my installation is issuing way too many read/write cycles that quickly “wear out” the SD card. I need to do some further testing on this but that is the only thing I can of think of as the cause.

If anyone of you has experienced the same filesystem corruptions on a Raspberry Pi that is supposed to be running 24/7 please use the comments section for tips and tricks or your findings. Perhaps together we may solve that issue.


132 LED-matrix with AS1130 and Python

TheĀ AMS AG (austriamicrosystems) does have a neat little (literally) chip called AS1130 on the market. This chip is able to drive 132 LEDs, arranged in a 12×11 cross-plexed matrix. It can store up to 36 individual frames (pictures) and up to 6 patterns for blinking and PWM control of every single LED in every single frame. The frames can be displayed as still images or as a movie, the chip even scrolls the frames without the need for doing any calculations on the controlling computer side.
I could not find any Python code for that chip so I dived into the datasheet and wrote my own driver. As always, the sources are available via GitHub. Here is a short video demonstrating the capabilities of that chip. I had to use some paper to shield the ultra-bright LEDs or the camera would have recorded just a bright white spot…

Continue reading