Lightning Monitor - Update

Because of heavy rain and thunderstorms this weekend, I had some time to work on my lightning monitor again. With success, I could reduce the "DISTURBER DETECTED" messages significantly by putting the device away from the laptop.

Even better, it was starting to measure lightnings during one of the thunderstorms! Great 🙂

The data makes sense, since we really have been in the center of the thunderstorm. I could verify that the distance estimation works pretty nice, because another thunderstorm that was in a nearby village was giving me lightnings with a distance of 5 km.

The current Arduino sketchbook is, as usual, on GitHub.

Nice thing for a rainy Sunday!

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.

The joy of multicore processors

I recently came back from an amazing trip to Iceland. Had a glorious time there - it was an outstanding adventure!

After this trip I had to convert 3200 photos from RAW to JPEG. Turns out, that usually it takes something like 15 seconds for my computer to process 1 file. 3200 * 15 is roughly a bit more than 13 hours.

Some minutes later and a python script I could distribute the work my 8 processor cores of a FX-8350. The script is ugly and very very dirty, that's why I don't want to publish it.
I've started the script, went outside for a longer time and when I returned the process was completed.

This is just one example of things, where a large number of CPU makes sense on a workstation computer. Even normal users benefit more and more from increased CPU cores more and more.

AMD made good work when they were increasing the number of CPU's. And nowadays I willingly have a bit lower single-thread performance but twice as much CPU cores. Makes totally sense for multimedia converting, large picture editing, compiling, ecc.

Intel Skylake Hyperthreading broken

Hyperthreading in Skylake and Kaby Lake seems to be broken and should be disabled in BIOS/UEFI.

My Laptop is also affected by this bug, but I will try to update the Microcode. Since I'm running Arch Linux I should get the update rather fast.

I underestimated the effect of this bug. For now I disable Hyperthreading completely. Hope a fix will be available, if one is even possible.

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 🙂

BIOS Update of the HP ZBook 15u G4 using Linux

(not entirely true, I needed a Windows Virtual machine)

I wanted to run a BIOS Update for my HP ZBook 15u G4. Unfortunately, HP provides updates only for Windows.
Linux users are used to such sorrow - but I will most probably stick back to other vendors in the future, where the Linux support is better.

Quick guide

I've extracted the folders and files and put them into this archive file (Updated 28.02.2018, here is the old file). Download it and extract it directly to you USB device. The folder Hewlett-Packard should be then in the root directory on your flash drive.

Reboot and select the Update options in your BIOS. It will reboot several times. Don't worry, grab a cup of coffee.

Files: [BIOS-P78_0115.tar.xz] [BIOS-P78_0103.tar.xz (old)]

My story: How I run the Update without a native Windows on the Laptop

I downloaded the BIOS update from the HP support page for the HP ZBook and installed it in a Windows-Virtual Machine on another computer. Here you can select the creation of a USB stick. So I've created a "recovery" USB stick and copied the BIOS image from the Hewlett-Packard\BIOS\Current folder on the USB stick to the Hewlett-Packard\BIOS\New folder.

Now I rebooted the laptop into the BIOS and selected Update BIOS. The system recognised the Update from the USB stick and could install it.
IMPORTANT: Plug in the power supply during BIOS update. The last thing you want is a power-down during a BIOS update!

Don't worry, during the Update process the laptop boots a few times and shows some weird behaviour. Just let him do. Grab a cup of coffee

So, although it is officially not supported, there is a way of how to update the BIOS on the Laptop.

Update [28.02.2018] - I updated the archive file to the current BIOS vP78_0115 from 01.02.2018. The old file is still available

Civilization Beyond Earth - Fix for Arch Linux

I love the Civilization series. One of my favourites is Beyond Earth, where luckily a Linux Version exists on Steam. Awesome! 🙂

Unfortunately under Arch Linux this doesn't work out of the box but needs some fixing. First of all you need to run steam-native, instead of steam. For debugging it's the best to run it in a terminal. If you start Civ Beyond Earth and end up with a similar error like

Then you need to install the lib32-intel-tbb lib from the AUR. I had to enable multilib and install gcc-multilib, but then it build and I could finally start Civilization Beyond Earth.

Civilization Beyond Earth - In game (just at the beginning)

Another victory for the good cause! 🙂

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!



Benchmarking tool - Flops

Flops is a nice tool for benchmarking floating point operations of a CPU.

Under Arch Linux i had some problems compiling it, because the static linking towards openmp was not working properly. I've made a fork, fixed the issue by removing the -static flag (and replaces -std=c++0x to -std=c++11) and a pull request in the hope, it will be included in the mainline soon.

The tool itself is quite nice to compare the throughput of FLOPS on a CPU. It measures it under perfect conditions so be aware that the everyday performance will be lower.

Still: Nice tool 🙂