Tinkering with Raspberry (and other things)

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


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


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

Quick Tip: crontab and python

Often running a python script via crontab does not work as expected. The most common problem is with permissions, I am sure everybody is aware of.

Here are some other reasons why calling a python program from crontab may fail:

  1. The last line in the crontab file needs to be a newline
  2. Scripts called from within crontab may not contain a “.” (dot) character. This is weird and almost unknown to most users.
  3. crontab scripts may not have all PATH environments you have while testing your python program


So what to do about it? Here’s an easy solution:

Suppose you have added an import-path to your python installation like I did in this quick-tip. We are going to “wrap” the call to “” in a bash script and name that script “ourprogram_starter”. No dots, crontab is happy. In this script we export the PATH variable so that crontab and the “ourprogram_starter” can find all our custom modules.

export PYTHONPATH="$HOME/some_Directory_Name"
python /full/path/to/

Make sure that this file is executable and you’re good to go. Now crontab can call this script which sets all needed environment variables and then calls the python program.


Quick Tip: Adding a directory to Python’s module search path

Over time I have written some Python modules/classes that I am using in more than one little project. As these are single files mostly, I did not bother about writing “real” modules with “” and all that stuff. I do not want to install these files in Python’s default library directory, either.

So I did what one should never ever do 🙂 I copied the files into the project directories as needed. This quickly gets out of hand if you are doing some updates to one of the classes. In order to get some robust structure into my workplace on the Raspberry Pi I did some research and reading about installing Python modules and came up with the most simple solution I can think of: adding my own directory to Python’s search path.

In the Python documentation everything I did can be found, of course. As I did miss it during several reads, I am posting my way of doing it here. To remind me and to, hopefully, help others.

First, a directory to put all the modules to be reused into needs to be created:

mkdir some_Directory_Name

Now we need to add an environment variable that gets set when you log in. Go to your home directory and edit the file “.profile”:

nano .profile

At the end of the file add the following lines:

if [ -d "$HOME/Workplace/Python/MyModules" ] ; then
    export PYTHONPATH="$HOME/some_Directory_Name"

That’s pretty all there is to do. The next time you log in the variable PYTHONPATH is set and used by Python. The if-statement checks for the existence of the given directory. The environment variable will only be created if the directory exists.

You can check this. Do not log out yet, but start Python and do the following (screenshot for better readability:

Bildschirmfoto 2013-12-04 um 14.57.10

This gives you the directories where Python looks for files when you are using the import-statement. Now to have our changes take effect, we could log out and in again, or we re-read the .profile with:

. ~/.profile

There needs to be a space between the first dot and the tilde character. If you are now starting Python again and do the exact same thing you should see your path somewhere in the output from sys.path:

Bildschirmfoto 2013-12-04 um 14.57.59

I have highlighted my personal search path in the above picture.

That’s all for this quick tip.


AM03127 LED marquee + Arduino + Bluetooth = RaspberryPi remote control

After some days of soldering, testing and coding I am now able to control my LED marquee remotely via bluetooth from my Raspberry Pi. Using an Arduino Pro Mini (5V model) and the HC-05 module mentioned in my last blog post, I was able to mount all components inside the sign’s housing.

Some features of the bluetooth enabled display:

  • send messages to display (up to two messages with a length of 360 characters each are possible)
  • select display mode (message – time – off)
  • set time from and to Real Time Clock
  • set display intervals
  • increase/decrease speed of marquee

The sourcecode consists of the Arduino sketch to control the sign and a Python class that encapsulates the communication and message handling to the LED sign. As always, the sources will be available in my GitHub repository (direct link to sources). In this post I will describe the hardware and software developed to accomplish this. Some soldering skills may be required… Continue reading


LED marquee – Teardown

Recently I saw an outdated (I thought) LED marquee sign in a thrift store. As these things make great tinkering objects I went inside and took a closer look. The sign looked fine and (tinkerer’s heaven) did have a serial port. Complete with RS232-to-USB adapter, remote control and power supply.

I did a quick research and decided to buy that thing. The technical data I found on the Internet were talking about up to 26 “pages” of text with 420 characters each, multiple effects and so on. Simply a must have…


The most interesting thing was, of course, the serial port. The idea is to have multiple RSS feeds on display. The news, the weather and so on. Everything controlled from a Raspberry Pi.

To understand how I can interface with the sign I will (of course) open it and take look at the insides. I thought I make this a blog entry to let you participate in my findings and (hopefully) show you something about “reverse engineering” electronic devices.
Continue reading


Short message texting (SMS) with Huawei E220

Finally I got a second Raspberry for tinkering as the old one is now operating as my own calendar and address server (which is pretty useless if the “agencies” really can monitor and decrypt HTTPS, SSL, VPN and every other means of communication). And I have been to my “evidence vault” and found an old UMTS-modem, a Huawei E220. So the most obvious thing to do was to send and receive short message texts (SMS) via my Raspberry Pi. There are some frameworks out there that do this from scratch, but I wanted to dig a little deeper and do it by myself. So read on and I will reference some of the available tools and show you my proof of concept. Continue reading


Soundbridge Information Display

I own two Roku/Pinnacle Soundbridges. And I am frightened for the day they cease existence. As a matter of fact I am trying to buy some used ones, just as spares. These little tubes are the best internet radios around, even nowadays. Plug them in, configure the network and voilá, you have a running radio that is accessible via a webinterface. Back in these days no marketing chef or product designer even thought about forcing the buyers to register with their mailadress, birthdate, creditcard numbers, etc.

The Soundbridge has an open telnet port that can be used to configure and control it. So it’s the perfect device for tinkering around and I am going to use the display to show information sent from the Raspberry.

Continue reading