Lightning detector - Kickoff

I recently purchased a MOD-1016 chip for lightning detection in order to improve my weather station. The chip is based on the AS3935 chip and ships as a complete I2C-ready breakout module from embedded adventures.

First steps

I skip the following parts because I consider them trivial:

  • Soldering
  • Wiring to a Arduino Nano

The wiring part is actually the most tricky part, I will provide the schematics once I have a running system. For now I focus on getting the system online. The wiring on the following picture is accurate:

Wiring of the MOD-1016 to the Arduino Nano

I put everything together in a nice box to protect the electronics from the environment. In the end it will end up outdoors in my garden.
The box is IP55 compliant, so when deployed for real I will put it in additional plastic bag to avoid any issues that comes from rain. For the first experiments IP55 is fine. And this is how it looks like

Wired box, open

A small reader program is in my meteo repository (in the Lightning directory) on GitHub, and I let it run for 1.5 days.
I had some problems with the serial port on high baud rates, so i configured it for 9600 baud. The serial connection over this period was fine, but it seems that the location has too much interference.
All I got was constant "DISTURBER DETECTED"

Right now all I get out is "DISTURBER DETECTED"

Looks like I need some fine-tuning. I disconnected the device and will run some tests with my laptop on the go.

For now I have a running serial connection, the chip delivers some output, so I'm expecting that with some fine-tuning I should get this thingy running soon.

Ubuntu Linux - Map Wacom to one screen when using multiple screens

Quick Know-how post. How to limit a Wacom tablet in Ubuntu Linux to one screen, if you are having multiple displays.

Keywords: Wacom, Ubuntu, Linux, multiple screens, multiple displays

We need to gather system information with xrandr and xinput. First we use xrandr to determine the display, where the tablet should be active. Run xrandr

I want to have it on the primary display, witch is in my case DP-4.

Next we need to list the devices using xinput | grep -i Wacom

For me, it's id 12 to 15. No we map the Wacom tablet to DP-4

Done 🙂

Raspberry Pi 3 and H.256

Some time ago I got annoyed by some movies encoded in h.256 are not running smoothly on the Kodi of my Raspberry Pi 3.

h.256 is a block-oriented quite new video compression algorithm, that is unfortunately not supported natively by the hardware decoder on the Raspberry Pi 3. So it has to be done in Software, and apparently the computational power of the Pi is too weak.

Surfing through some fora, I found some people claiming, that overclocking the Raspberry Pi should be the solution. So I decided to give it a try.

Overclocking goal

The goal was to bring the h.265 codec smoothly on the screen, using 1080p@30fps. Some people said, that overclocking the pi to 1300MHz should be enough. So that's where I have to go.

Only do overclocking, with an adequate cooling system! Since the Raspberry ships without any heat sink, I needed to buy one.

Cooling system

I've decided to go with a plain Aluminium heat sink, but monitor the temperature very closely with cputemp and gputemp, two tools that ship by default on the Raspbian and OpenELEC:

Works. During the whole overclocking procedure I was connected to the Raspberry via ssh to monitor the temperatures very closely. At least one readout every second, ready to intervene if something goes nasty.

The goal was to keep the temperature below 85 degrees (soft-limit) and immediately cancel the procedure after 90 degree (hard-limit). During the overclocking procedure I reached the hard-limit.


And here we go. Backup /flash/config.txt before editing, so that you can set it back to default, once you have finished.

There are plenty of examples on this page. You may need to figure out, witch one works for you.

There's also this amazing wiki page about overclocking, the risks and the pitfalls. I think that's the resource you should read before getting started.

The default clocking settings for a Raspberry Pi are commented out, thus if you are unsure about your current configuration, just comment it out, reboot and you'll have the stable plain configuration again.

In the end, I tries to get the system working with the following configuration

System was stable, but heating up a lot, up to more than 85 degrees. That's an important threshold, because at 85 degrees the Raspberry starts to protect itself from the heat death by throttling down the CPU. So in overall you'll have no benefit from overclocking, except a small boost in performance before it throttles you down to worse throughput, than with plain vanilla settings.


The poor Raspberry Pi got really hot during this procedure! 1300 MHz would be too much for a long-period. Also because it throttles itself down, I did not get any benefit from the overclocking procedure.

And although I pushed it to the limit with the available cooling system, I couldn't reach a smooth experience.

So I consider h.265 as not suitable for my Raspberry Pi. Well, seems that I have to encode it to something more Raspberry friendly 🙂

Still, it was a nice project!



Shared memory C++ class - Standalone

Since  needed it for one of my research projects, I have created an offspin of the SharedMemory class in my FlexLib2 library.

The created SharedMemory class supports the creation of SharedMemory segments in the OpenMPI context. In the end you will have a shared memory segment on every machine, where the program is executed.

Shared memory example
Shared memory example

An example code is included. It compiles on gcc 4.8.4 on Ubuntu 14.04 with C++98 and C++11 Standart.

It includes a Makefile and an example program. Checkout the README file for details. And: Have fun 🙂

[Link to the source]


If you need some more info about how to deal with POSIX shared memory on a Linux system, I can recommend this following article.

Ubuntu 16.04 is here

Eponym: African ground squirrel. They are cute! [Source]
Ubuntu 16.04 is here! You can immediately download it from the page. View the Release Notes here.

Since I'm away until the end of the next week, I will not have the time to try it out yet.

I am really looking forward to the announced snaps and the apt. I have hopes that the snaps will make a difference when it comes to unification of installing packages on different distributions. To be honest, unless the package is well supported, the situation is a mess. I don't want to be offensive, I know it's not easy to build a package for every distribution.

To support the community, my server now seed the Ubuntu Torrents 🙂

Have fun! I will have a closer look, when I'm back home. Until then - Hejda from Sweden 🙂

Cool Linux Terminal: cool-retro-term

Fallout-Like Terminal makes your work more fun 🙂

Having a boring task in the terminal to do? Why not putting it into a fancy Fallout-Like Terminal??Get cool-retro-term 🙂
Compilation instructions are on the GitHub page.

Have fun 🙂

Triple Seven - Just a random ssh bug

Seit gestern ist ein neuer OpenSSH Bug bekannt: Triple Seven.

Aufgrund eines Problems im Speichermanagement ist es so bösartigen Servern möglich, den privaten ssh Key des Clients auszulesen. Für den Fall, dass sich also jemand mit einem nicht vertrauenswürdigen ssh-Server verbunden hat, ist es möglich, dass der eigene ssh-Key kompromittiert wurde.
Wer sich nicht sicher ist, ist daher angeraten sich neue ssh-Keys zu generieren und die alten in die Verbannung zu schicken (wichtig!)

Es steht mittlerweile ein Update für Debian, Ubuntu, RHEL und weiteren Distros zur Verfügung, das das Problem fixen soll.

Wer den eigenen Client zur Zeit nicht updaten kann, sollte die UseRoaming Option ausschalten. Entweder als Parameter in /etc/ssh/ssh_config

Oder als Programargument in der Kommandozeile

Und als Abschluss: Wenn irgendjemand Lust auf dubiosen Verschwörungstheorien hat, kann bei diesem Heise-Kommentar anfangen 🙂

Nat mit IPTables

NAT mit iptables in 4 einfachen Zeilen.
(Ist eigentlich NAPT und nicht NAT, wird aber weitläufig so bezeichnet)

1. IP Forwarding aktivieren

Zur permanenten Aktivierung, entsprechende Zeile in /etc/sysctl.conf

2. IPTables konfigurieren

Ich nehme an, dass eth0 die Schnittstelle nach draußen ist und eth1 die interne Schnittstelle, die mit dem Internet verbunden werden soll. Also

eth1 -> eth0 -> Internet

Abschließende Hinweise

  • iproute2 untersützt seit Linux 2.6 nicht mehr nat [Verweis]. Leider finden sich noch einige Tutorials dazu im Internet.
  • Was ich hier vorstelle ist eigentlich nicht NAT sondern NAPT. NAT im Sinne von "ich verwende den Routing Stack von Linux" findet sich heute eher selten.