Skip to content

Steffen Vogel

40 posts by Steffen Vogel

Freeing a Xiaomi Humidifier from the Cloud

Home Assistant Logo

I recently moved into a new apartment which I used as an opportunity to make our home a little smarter. As a big open source supporter I built my smart home platform with Home Assistant of course.

Unfortunately, there are still far too few products that are directly compatible with Home Assistant. Especially in the area of humidifiers where I only found products that rely on a proprietary app or cloud from the manufacturer. Something that I would like to avoid at all costs. For one thing, such dependence is a certain form of planned obsolescence, as the product becomes useless as soon as the app loses its compatibility with new smartphone operating system versions or the manufacturer’s cloud is no longer operated.


Therefore, it was important for me to find a smart humidifier that integrates directly with my Home Assistant setup. To achieve this goal, I identified two options:

  1. Add sensors / actuators to a classic humidifier to make it smart.
  2. Replace the firmware of a smart humidifier with my own source code.

I decided to use the second approach, because it required less effort, since I would have had to implement my own firmware anyway.

This blog has joined the Fediverse

ActivityPub Logo
ActivityPub Logo.

My blog noteblok.net has joined the Fediverse. You can follow my posts via this new handle: stv0g@noteblok.net.

This has been made possible by the Wordpress ActivityPub Plugin. With the ActivityPub plugin installed, the WordPress blog functions as a federated profile, along with profiles for each author. For example, my blog-wide profile can be found at @blog@noteblok.net. Authors like myself, on the other hand, would have their individual profiles at @stv0g@noteblok.net.

The integration allows following the blog from your own Fediverse platform and account like Mastodon. I return you can also react and comment to my blog posts via simply replying with your existing Fediverse account.

Fritz!DNS - An authoritative DNS server for AVM FRITZ!Box routers

Fritz!Box
Fritz!Box.

In my home network, I am using an AVM FRITZ!Box Cable 6690. It handles DHCP, DNS, Wifi and recently also interfaces my home network via WireGuard to my servers.


Just like the venerable Dnsmasq AVM’s FRITZ!OS uses hostnames learned from its DHCP leases and makes them resolvable via its internal DNS server.

Unfortunately, this feature in FRITZ!OS has some limitations:

  1. The name of the DNS Zone is hard coded to fritz.box and can not be adjusted. Hence, the resolvable names have the following schema: myhostname.fritz.box
  2. The internal DNS server only supports recursive DNS looks. It does not act as an authoritative DNS server. Hence the local zone can not be delegated.
  3. AXFR zone transfers are not supported.

My solution to these shortcomings is Fritz-DNS which:

  • Is a small tool written in the Go programming language.
  • Is a small authoritative DNS server which serves A / AAAA resource records for local hosts connected to an AVM Fritz Box home WiFi router.
  • Can be used in a hidden master configuration as it supports AXFR zone transfers.
  • Uses the custom extension (X_AVM-DE_GetHostListPath) of the TR-064 Hosts SOAP-API as documented here to retrieve a list of local hosts.
  • Supports the generation of AAAA (IPv6) resource records based on the hosts MAC addresses using 64-Bit Extended Unique Identifier (EUI-64) and a configured unique local address (ULA) prefix.
  • Does not yet support PTR resource records (to be implemented…)
  • Is licensed under the Apache 2.0 license

You can find Fritz-DNS at Codeberg: /stv0g/fritz-dns .

Here is a small figure illustrating the interaction of Fritz-DNS with the Fritz!Box and other DNS servers / clients:

Fritz!DNS Architecture
Fritz!DNS Architecture.
Terminal window
$ fritz-dns
Usage of fritz-dns
-ipv6-ula-prefix string
Fritz Box IPv6 ULA Prefix (default "fd00::/64")
-pass string
FritzBox password
-port int
Listen port (default 53)
-soa-expire duration
SOA expire value (default 744h0m0s)
-soa-mbox string
SOA mailbox value
-soa-minttl duration
SOA minimum TTL value (default 1h0m0s)
-soa-ns string
Authorative DNS server for the zone
-soa-refresh duration
SOA refresh value (default 2h0m0s)
-soa-retry duration
SOA retry value (default 1h0m0s)
-ttl duration
default TTL values for records (default 5m0s)
-url string
FritzBox URL (default "http://fritz.box/")
-user string
FritzBox username (default "admin")
-zone string
DNS Zone (default "fritz.box.")

Aachen wird Transparent!

Ich möchte Stadtpolitik in Aachen für alle verständlich machen. Mein aktuellstes Projekt aachen-transparent.de ermöglicht es, die öffentlichen Informationen aus dem städtischen Ratsinformationssystem modern und benutzerfreundlich aufzubereiten. Dazu habe ich das bereits existieren Open-Source Projekt Meine-Stadt-Transparent erweitert und für die Bedürfnisse in Aachen angepasst.

Screenshot von aachen-transparent.de
Screenshot von aachen-transparent.de.

Aachen Transparent ist ein Projekt, dass ich ehrenamtlich im Rahmen des Open Data Labs Aachen ins Leben gerufen habe. Es versucht einige der Unzulänglichkeiten des Ratsinformationssystems der Stadt Aachen zu umgehen. Dazu nutzt es dessen öffentliche OParl Schnittstelle um die dort hinterlegten Informationen über eine moderne Oberfläche zugänglich zu machen.

A highly available WireGuard VPN setup

WireGuard Logo

WireGuard is a communication protocol and free and open-source software that implements encrypted virtual private networks (VPNs), and was designed with the goals of ease of use, high speed performance, and low attack surface.

Tinc Logo
Tinc Logo.

I’ve been using it in my home lab setup since about 2020. When, in the end of 2021, it was finally merged into the Linux mainline with release 5.9, I started to replace my former Tinc-VPN setup with it. Tinc-VPN is another great open source VPN solution. Unfortunately, its development has stalled over the last years which motivated me to look for alternatives. In contrast to WireGuard, Tinc runs as a user-space daemon and uses tun / tap devices which adds a significant processing overhead. Like WireGuard, it is also using UDP for tunneling data, but falls back to TCP in situations where direct datagram connectivity is not feasible. Another big advantage of Tinc is its ability to form a mesh of nodes and to route traffic within it when direct P2P connections are not possible due to firewall restrictions. At the same time, this mesh is also used for facilitating direct connections by signaling endpoint addresses of NATed hosts.

Tinc's mesh capability
Tinc's mesh capability.

This mesh functionality made Tinc quite robust against the failure of single nodes as usually we could route traffic via other paths.

To counteract this shortcoming, this blog post will present a highly available WireGuard setup using the Virtual Router Redundancy Protocol (VRRP) as implemented by the keepalived daemon.

That said, it is worth noting that this setup does will not bring back some of the beloved features of Tinc. Both meshing, the peer and and endpoint discovery features of Tinc are currently and will never be supported by WireGuard. Jason A. Donenfeld the author of WireGuard focused the design of WireGuard on simplicity, performance and auditability. Hence advanced features like the ones mentioned will only be available to WireGuard by additional agents / daemons which control and configure WireGuard for you. Examples for such are Tailscale, Netmaker and Netbird.

The setup presented in this post is a so called active / standby configuration consisting of two almost equal configured Linux servers running both WireGuard and the keepalived daemon. As the name suggest only one of those two servers will by actively handling WireGuard tunneling traffic while the other one stands by for the event of a failure or maintenance of the active node.

VRRP Wireguard Setup
VRRP Wireguard Setup.

Before get started some requirements for the setup:

  • 2 Servers running Linux 5.9 or newer.
  • A working Wireguard configuration.
  • A local L2 network segment two which both servers are connected.
  • Upstream connectivity without NATing via gateway connected to the network segment (usually provided by your internet or hosting provider).
  • An unused address to be used as Virtual IP (VIP) which roamed between the two servers by VRRP.

An important point is here the assumption that we are running both servers in the same switched network segment as this is a requirement for VRRP. We are also assuming that the upstream gateway performs no NATing. This guide covers only IPv6 addressing. However all steps can be also adapted or repeated for a dual stack or IPv4-only setup.

Here are some of the specifics for my setup which need to be adapted by you:

  • Server Key (same use by both servers)
    • Private: YIEDx+A2ONo5+uv3mrk/p7ileL3T5QQ8hleQK0IYEEI=
    • Public: XGubrkGtuECdvoykKeUiNMigk2onfLCPfEo9Im+vmx8=
  • Peer Key (In this example we only have a single peer)
    • Private: OIbpWVIVVBOtWfwkmXkFRN7Q/jBdfYtsGt7j97aHx1Q=
    • Public: 3NGl6gTOGs6ai0RE91VmVFgF+N4gw1EBG11KOeiKJAg=
  • Public Server Subnet: 2001:DB8:1::/64
    • Gateway: 2001:DB8:1::1
    • Virtual IP: 2001:DB8:1::2
    • Server A: 2001:DB8:1:::3
    • Server B: 2001:DB8:1::4
  • WireGuard Tunnel Subnet: 2001:DB8:2::1/64
    • Server: 2001:DB8:2::1 (same used by both servers)
    • Peer: 2001:DB8:2::2
  • Interface names
    • Wireguard: wg1
    • Upstream: eno1
  1. Prepare servers

    We start of preparing the two servers by installing WireGuard and keepalived:

    Terminal window
    sudo apt install keepalived wireguard-tools iproute2

    Next we configure a WireGuard interface on both servers using exactly the same configuration file at /etc/wireguard/wg1.conf:

    [Interface]
    Address = 2001:DB8:2::1/64
    PrivateKey = YIEDx+A2ONo5+uv3mrk/p7ileL3T5QQ8hleQK0IYEEI=
    ListenPort = 51800
    [Peer]
    PublicKey = 3NGl6gTOGs6ai0RE91VmVFgF+N4gw1EBG11KOeiKJAg=
    AllowedIPs = 2001:DB8:2::2/128
    PersistentKeepalive = 25

    Similarly, a reciprocal configuration file is needed on the client side which skip here for brevity. Before proceeding, we activate the interface on both servers:

    Terminal window
    systemctl enable --now wg-quick@wg1
    wg show wg1 # Check if interface is up
  2. Configuring Keepalived

    Create a configuration file for keepalived at /etc/keepalived/keepalived.conf

    global_defs {
    enable_script_security
    script_user root
    }
    # Check if the server the WireGuard interface configured
    vrrp_script check_wg {
    script "/usr/bin/wg show wg1"
    user root
    }
    vrrp_instance wg_v6 {
    interface eno1
    virtual_router_id 52
    notify /usr/local/bin/keepalived-wg.sh
    state BACKUP # use BACKUP for Server B
    priority 99 # use 100 for Server B
    virtual_ipaddress {
    2001:DB8:1::1/64
    }
    track_script {
    check_wg
    }
    }
  3. Create a notification script for keepalived at /usr/local/bin/keepalived-wg.sh

    #!/usr/bin/env bash
    TYPE=$1
    NAME=$2
    STATE=$3
    PRIO=$4
    WGIF=wg1
    case ${STATE} in
    MASTER)
    ip link set up dev ${WGIF}
    ;;
    BACKUP|FAULT|STOP|DELETED)
    ip link set down dev ${WGIF}
    ;;
    *)
    echo "unknown state"
    exit 1
    esac

    Now start the keepalived daemon:

    Terminal window
    chmod +x /usr/local/bin/keepalived-wg.sh
    systemctl enable --now keepalived
  4. Testing the fail over

    In our configuration, Server A has a higher VRRP priority and as such will be preferred if both servers are healthy. To test our setup, we simply bring down the WireGuard interface on Server A and observe how the VIP gets moved to Server B. From the WireGuard peers perspective not much changes. In fact no connections will be dropped during the fail-over. Internally, the clients WireGuard interface renegotiate the handshake. However, that step is actually not observable by the user.

    Run the following commands on Server A while alongside test the connectivity from the client side through the tunnel via ping -i0.2 2001:DB8:2::1:

    Terminal window
    # Check that keepalived has moved the VIP to interface eno1
    ip addr show dev eno1
    # Bring down the Wireguard interface
    wg-quick down wg1
    # Keepalived should now have moved the VIP to Server B
    ip addr show dev eno1

In my personal network, I operate a Interior Gateway Protocol (IGP) to dynamically route traffic within and also towards other networks. Common IGPs are OSPF, ISIS or BGP. In my specific case, both Servers A & B run the Bird2 routing daemon with interior and exterior BGP sessions.

So how does the WireGuard HA setup interoperates with my interior routing? Quite well actually. As my notify script (keepalive-wg.sh) will automatically bring up / down the interface, the routes attached to the interface will be picked up by Bird’s direct protocol.

I am also planning to extend my WireGuard agent cunicu ( /cunicu/cunicu ) to support the synchronization of WireGuard interface configurations between multiple servers.

Surprisingly, the setup works by using Keepalived and does not require any iptables or nftables magic to rewrite source IP addresses. I’ve seen some people mentioning that SNAT / DNAT would be required to convince WireGuard to use the virtual IP instead of the server addresses. However, in my experience this was not necessary.

Another concern has been that the backup Wireguard interface still might attempt to establish a handshake with its peers. This would quite certainly interfere with the handshakes originated by the current master server. However, also this has not been proven to be the case. I assume the fact that our notify script brings down the WireGuard interface on the backup server causes them to cease all communication with its peers.

SSH Access for Netgear's Nighthawk M5 Mobile LTE/Router

SSH Logo

In my previous post, I demonstrated how to gain root access by enabling a Telnet daemon via the routers AT-over-TCP interface. In this post I will close this gasping security hole by replacing the Telnet with a Secure Shell (SSH) daemon. Netgear’s firmware does not ship with a SSH daemon itself. So we first build a statically linked Dropbear instead of the rather heavy OpenSSH daemon.

Having a detailed look at the Netgear Nighthawk M5 Mobile LTE/Router

Dr. Watson

After gaining root access to the device in the first post of this series, we will have a closer look at the device and its firmware.

This post is documenting some internals of the device which is not the most exciting stuff to read. I mainly collected it here for documentation purposes.

All information in this post has been collected from a device running firmware version NTGX55_12.04.12.00.

A 3D-printed wall mount for Netgear Nighthawk mobile 5G/LTE routers

I have recently designed and printed a wall mount for Netgear’s Nighthawk mobile 5G/LTE routers. More specifically a Nighthawk M5 (MR5200).

I have been inspired by an existing commercial wall mount for the Nighthawk M-series routers by FTS Hennig GmbH:

My inspiration: the wall-mount and antenna adapter from FTS Hennig
My inspiration: the wall-mount and antenna adapter from FTS Hennig.

Unfortunately, the mount is with a price tag of around 50 € rather expensive. So I decided to use our new lab 3D-printer and try do design it myself usings AutoDesk’s Fusion 360 software.

My own 3D printed holder is released under a creative commons license at Codeberg: /stv0g/3d-printing/netgear-m5-wall-mount

Gaining Root Access on Netgear Nighthawk Mobile 5G/LTE Routers

This blog posts covers the required steps to gain root access via Telnet on Netgear Nighthawk Mobile 5G/LTE Routers. Its the first post in a small series covering my experiences playing around with this device.

Last month I obtained one of Netgear’s latest mobile 5G routers, the Netgear Nighthawk M5 (model MR5200-100EUS) . Being one of the most expensive consumer 5G routers, I was lucky to get a fairly good second hand deal from eBay.

Netgear Nighthawk M5 mobile 5G/LTE Router
Netgear Nighthawk M5 mobile 5G/LTE Router.

Open-Data Lab Aachen

Aachener Rathaus
Aachener Rathaus.
Logo des Open Data Lab Aachen
Logo des Open Data Lab Aachen.

Im September letzten Jahres hat sich in Aachen das Open Data Lab mit einer virtuellen Kick-off Veranstaltung gegründet.

Im Open Data Lab wollen wir ehrenamtlich Projekte rund um Offene Daten in Aachen voranbringen. Wir suchen dazu Personen, die daran generell interessiert sind, ob Entwickler*innen, Designer*innen, Datenjournalist*innen aus Verwaltung, Politik und Gesellschaft.

Wir wollen Daten und Ideen zusammenbringen und daraus Projekte generieren.


GoSƐ - A terascale file-uploader

GoSƐ Logo
GoSƐ Logo.

GoSƐ is a modern and scalable file-uploader focusing on scalability and simplicity.

It is a little hobby project I’ve been working on over the last weekends.

The only requirement for GoSƐ is a S3 storage backend which allows to it to scale horizontally without the need for additional databases or caches. Uploaded files a divided into equally sized chunks which are hashed with a MD5 digest in the browser for upload. This allows GoSƐ to skip chunks which already exist. Seamless resumption of interrupted uploads and storage savings are the consequence.

And either way both upload and downloads are always directed directly at the S3 server so GoSƐ only sees a few small HTTP requests instead of the bulk of the data. Behind the scenes, GoSƐ uses many of the more advanced S3 features like Multi-part Uploads and Pre-signed Requests to make this happen.

Users have a few options to select between multiple pre-configured S3 buckets or enable browser & mail notifications about completed uploads. A customizable retention / expiration time for each upload is also selectable by the user and implemented by S3 life-cycle policies. Optionally, users can also opt-in to use an external service to shorten the URL of the uploaded file.

Currently a single concurrent upload of a single file is supported. Users can observe the progress via a table of details statistics, a progress-bar and a chart showing the current transfer speed.

GoSƐ aims at keeping its deployment simple and by bundling both front- & backend components in a single binary or Docker image. GoSƐ has been tested with AWS S3, Ceph’s RadosGW and Minio. Pre-built binaries and Docker images of GoSƐ are available for all major operating systems and architectures at the release page: /stv0g/gose (Releases) .

GoSƐ is open-source software licensed under the Apache 2.0 license.

Live Demo
GoSƐ Demo
GoSƐ Demo.
  • De-duplication of uploaded files based on their content-hash
    • Uploads of existing files will complete in no-time without re-upload
  • S3 Multi-part uploads
    • Resumption of interrupted uploads
  • Drag & Drop of files
  • Browser notifications about failed & completed uploads
  • User-provided object expiration / retention time
  • Copy URL of uploaded file to clip-board
  • Detailed transfer statistics and progress-bar / chart
  • Installation via single binary or container
    • JS/HTML/CSS Frontend is bundled into binary
  • Scalable to multiple replicas
    • All state is kept in the S3 storage backend
    • No other database or cache is required
  • Direct up & download to Amazon S3 via presigned-URLs
    • Gose deployment does not see an significant traffic
  • UTF-8 filenames
  • Multiple user-selectable buckets / servers
  • Optional link shortening via an external service
  • Optional notification about new uploads via shoutrrr
    • Mail notifications to user-provided recipient
  • Cross-platform support:
    • Operating systems: Windows, macOS, Linux, BSD
    • Architectures: arm64, amd64, armv7, i386

I consider the current state of GoSƐ to be production ready. Its basic functionality is complete. However, there are still some ideas which I would like to work on in the future:

Also checkout the Codeberg Issue Tracker /stv0g/gose (Issues) for a detailed overview.

Running a Xilinx hw_server as Docker Container

Dockerized Xilinx hw_server Setup
Dockerized Xilinx hw_server Setup.

This article describes the necessary steps to run a Xilinx hw_server as a Docker container.

Xilinx’s hw_server is a command line utility which handles JTAG communication between a Xilinx FPGA board and usually the Vivado IDE. It can be used to configure the FPGA bitstream, connect to the embedded logic analyzer cores (ILA) or perform debugging of processor cores via GDB and the Xilinx System Debugger (XSDB). The hw_server is usually used when those tasks shall performed remotely as the connection between Vivado or XSDB is established via TCP connection and allows us to run it on a remote system.

Running the hw_server as a Docker container has the benefit that its installation is simplified to starting a Docker container by running:

Terminal window
docker run \
--restart unless-stopped \
--privileged \
--volume /dev/bus/usb:/dev/bus/usb \
--publish 3121:3121 \
--detach \
ghcr.io/stv0g/hw_server:v2021.2

It also allows us to run the hw_server on architectures which are not natively supported by Xilinx such as the commonly used Aarch / ARM64 and ARMv7 architectures found in Raspberry Pis.

This is enabled by Dockers support for running container images for non-native architectures. I am using the aptman/qus Docker image ( /dbhi/qus ) to setup this user-mode emulation. The qemu-user-static (qus) image is a compilation of utilities, examples and references to build and execute OCI images (aka docker images) for foreign architectures using QEMU’s user-mode emulation.

Run the following commands to run the hw_server on a embedded device:

Terminal window
# Install docker
sudo apt-get update && sudo apt-get upgrade
curl -sSL https://get.docker.com | sh
# Start Docker
sudo systemctl enable --now docker
# Enable qemu-user emulation support for running amd64 Docker images
# *Note:* only required if your system arch is not amd64!
docker run --rm --privileged aptman/qus -s -- -p x86_64
# Run the hw_server
docker run --restart unless-stopped --privileged --volume /dev/bus/usb:/dev/bus/usb --publish 3121:3121 --detach ghcr.io/stv0g/hw_server:v2021.2

This setup has been tested with a Raspberry Pi 4 running the new 64-bit Debian Bullseye Raspberry Pi OS.

The pre-built Docker image for the hw_server of Vivado 2021.2 is available via:

/stv0g/xilinx-hw-server-docker (Packages)

Detailed instructions can be found at Codeberg: /stv0g/xilinx-hw-server-docker .

Encrypted credentials for Amazon AWS command line client

In this quick post I will show you how to use the password manager “password-store1 to securely store your credentials used by the Amazon Webservices command line client.

AWS CLI Logo
AWS CLI Logo.

The installation for Mac and Linux system is fairly easy:

Terminal window
pip install awscli

The credentials are stored as key-value pairs inside a PGP-encrypted file. Every time you call the AWS CLI tool, your keys will be decrypted and directly passed to the aws tool.

Use pass to add your keys in the store:

Terminal window
pass edit providers/aws

An editor opens. Use the following format:

User: stv0g
Access-Key: AKB3ASJGBS3GOMXK6KPSQ
Secret-Key: vAAABn/PMAksd235gAs/FSshhr42dg2D4EY3

Add the following snippet to your ~/.bashrc:

Terminal window
function aws {
local PASS=$(pass providers/aws)
local AWS=$(which aws)
# Start original aws executable with short-lived keys
AWS_ACCESS_KEY_ID=$(sed -En 's/^Access-Key: (.*)/\1/p' <<< "$PASS") \
AWS_SECRET_ACCESS_KEY=$(sed -En 's/^Secret-Key: (.*)/\1/p' <<< "$PASS") $AWS $@
}

Then use the cli tool aws as usual:

Terminal window
aws iam list-access-keys { "AccessKeyMetadata": [ { "UserName": "stv0g", ...`
  1. I covered password-store already a few times earlier: Use YubiKey and Password-store for Ansible credentials, Workshop: Security Token.

Use Yubikey and Password-store for Ansible credentials

I spent some time over the last months to improve the security of servers and passwords. In doing so, I started to orchestrate my servers using a configuration management tool called Ansible. This allows me to spin-up fresh servers in a few seconds and to get rid of year-old, polluted and insecure system images.

Ansible loves Yubico
Ansible loves Yubico.

My ‘single password for everything’ has been replaced by a new password policy which enforces individual passwords for every single service. This was easier than I previously expected:

To unlock the ‘paranoid’ level, I additionally purchased a Yubikey Neo token to handle the decryption of my login credentials in tamper-proof hardware. ‘pass’ is just a small shell script to glue several existing Unix tools together: Bash, pwgen, Git, xclip & GnuPG (obeying the Unix philosophy). The passwords are stored in simple text files which are encrypted by PGP and stored in a directory structure which is managed in a Git repository.

Yubikey Neo und Neo-n
Yubikey Neo und Neo-n.

There are already a tons of tutorials which present the tools I describes above. I do not want to repeat all of it. So, this post is dedicated to solve some smaller issues I encountered.

Workshop: Security Token

Der Open Source Arbeitskreis (OSAK) der Fachschaft FSMPI, veranstaltet nun zum zweiten Mal eine Crypto Party auf der sich Interessierte über Verschlüsselung und verwandte Themen informieren können.

Ich möchte hier die Gelegenheit nutzen um etwas Werbung für diese Veranstaltung zu machen. Genaue Infos findet Ihr unten im Flyer.

Dieses Mal wird es auch einen kleinen Workshop von mir geben:

„I know none of my passwords“

Ich werde in circa 20 Min eine kurze Übersicht über Security Tokens wie beispielsweise den Yubikey oder die OpenPGP Smartcard geben. Dabei wird der Fokus auf verschiedenen Anwendungsszenarien wie One-Time-Passwords, Logins, sowie E-Mail Verschlüsselung liegen.

Update: Hier sind die Vortragsfolien und das Handout:

Download:Präsentation
Download:Handout
Cryptoparty im Sommersemester 2015
Cryptoparty im Sommersemester 2015.

Casting between Qt and OpenCV primitives

OpenCV & QT
OpenCV & QT.

As a follow-up to the previous post, I’d like to present some code which I think might be helpful for other Qt / OpenCV projects as well.

This code was written for Pastie. Pastie is a piece of software I wrote as part my image processing seminar. It makes use of the well known libraries:

  • Qt for the graphical user interface
  • OpenCV for image processing and computer vision

I wrote a C++ header file to facilitate the co-operation of those two libraries. This file enables the conversion / casting of OpenCV and Qt types e.g.:

#include <QImage>
#include <cv/core.hpp>
QImage qimg("filename.png");
cv::Mat cvimg = toCv(qimg);

The source code is available at Codeberg: /stv0g/snippets/c/qcv_cast.h .

The following conversions are supported:

QImagecv::Mat
QTransformcv::Mat
QPointcv::Point2i
QPointFcv::Point2f
QRectcv::Rect2i
QRectFcv::Rect2f
QSizecv::Size

You can find some examples in the real code here: /stv0g/pastie/filters/pattern.cpp and here /stv0g/pastie/cast.h .

Seminar: Camera-based PCB Analysis for Solder Paste Dispensing

Mini Kossel 3D Printer
Mini Kossel 3D Printer.

The lectures during my last semester were largely focused on digital image processing. Combining this with the inspiration for 3D printing, I gathered through my trip though South Korea, resulted in the following seminar paper. Seminars are a compulsory part of our curriculum which I like due the self-contained work and the ability to pick an individual topic.

Over the past year, I’ve built my own Kossel 3D printer. The Mini Kossel is based on a novel parallel delta kinematic which was developed by Johann C. Rocholl, a Google engineer from Germany.

This paper is targeting the automation of solder paste dispensing onto printed circuit boards by using computer vision and RepRap robots.

Download:Presentation Slides
Download:Full Paper
Source Code

Bachelor Thesis: Extended Abstract

Almost fourteen months ago, I started working on my bachelor thesis. Although I finished it half a year ago, it’s still part of my work as a student research assistant.

During my initial work, most of the code was written for an internal research kernel. I’m now happy that we were able to port it to an open source kernel called eduOS: /RWTH-OS/eduOS ). This minimal operating system is used for practical demo’s and assignments during the OS course at my university. There’s much more I could write about. So this will probably be another separate blog post.

The motive for this article is an abstract I wrote for the student research competition of the ASPLOS conference which is held this year in Istanbul, Turkey. Unfortunately my submission got rejected. But as a nice side-effect, I’ve now the chance to present my work to an English audience as well:

Download:Extended Abstract (PDF)

noteblok.{de,net,org,dn42}

noteblok

Dies ist das neue Logo und Name meines Blogs.

Bisher gab es hier nur wenige persönliche Beiträge. Da ich das auch so beibehalten möchte, habe ich mich entschlossen meinen Namen aus dem Titel zu streichen. Vielleicht findet so auch mal der ein oder andere Gastbeitrag seinen Weg hierher.

World IPv6 Launch Badge

Mit dem neuen Namen hat sich auch die Domain geändert. Der Blog ist nun erreichbar unter noteblok.{de,net,org,dn42}. Über meine persönliche Domain gelangt man nun direkt zu ein paar Infos über mich.

Neben den neuen Domains sind nun auch alle Webseiten/Blogs über IPv6 erreichbar 😊.

dn42 Logo

Zudem ist der Blog auf über des dn42 Darknet erreichbar. Das dn42 ist ein dezentrales und dynamisches VPN Netzwerk. Es besteht aus einem Verbund von Freiwilligen Admins, die jeweils Peer-to-Peer Verbindungen über VPNs herstellen. Es baut damit als Overlay Netzwerk auf dem bestehenden Internet auf. Zudem nutzt das dn42 mit BGP, DNS, Whois die gleichen Protokolle wie das reguläre Internet.

Als Teil von (/dev/nulll) betreibe ich das Autonome System AS4242422428 und unterhalte Peerings mit anderen Knoten des dn42 Netzwerkes.

Hier ist noch ein Screenshot meines Blog aus dem Jahr 2014:

Screenshot noteblok.net vom 2014-12-22
Screenshot noteblok.net vom 2014-12-22.

tileLED

tileLED
tileLED.

Und schon wieder habe ich ein kleines Hardwareprojekt, das ich hier vorstellen möchte. Auf eBay bin ich auf diese günstige LED Dot-Matrix Displaymodule gestoßen. Auf einer Größe von 3x3cm besitzen sie 8x8 rote oder grüne LEDs, die per Multiplexverfahren angesteuert werden.

Für diese Module habe ich eine kleine Platine designed, die nicht größer ist als das Modul selber. Die LEDs werden über einen kleinen ATmega8 Mikrocontroller direkt angesteuert. Auf Konstantstromquellen habe ich hier zugunsten der Platinengröße verzichtet. Auch wenn diese Beschaltung den ATmega etwas überlastet, funktioniert es super.

Platinen Layout
Platinen Layout.

EAGLE Libraries: Raspberry Pi

Für mein neuestes Projekt habe ich mir die Mühe gemacht und meine EAGLE Bibliotheken aufgeräumt. EAGLE ist ein CAD Programm der Unternehmen Cadsoft, das vornehmlich im Elektronik/DIY Bereich zum Designen von Schaltplänen und Platinen eingesetzt wird.

In den letzten Jahren haben sich einige selbst erstellte Bibliotheken angesammelt, die ich hier nun gesammelt veröffentliche. Mit ihnen können die bereits mitgelieferte Datenbank von Bauteilen (Footprints und Symbole) erweitert werden.

Diese Bibliotheken und noch einige Skripte, Einstellungen und CAM Jobs findet ihr auf Codeberg: /stv0g/eagle .

Ein Layout mit dem RPi Shield
Ein Layout mit dem RPi Shield.

Interessant ist vielleicht noch die Raspberry Pi Bibliothek. Bisher hab es noch keine EAGLE Bibliothek mit der man einfach Shields (vergleiche auch Arduino) für den Board-Computer layouten konnte. Die Bibliothek enthält die genauen Abmessungen des Pi’s und die Belegung aller GPIO Stiftleisten. Aber die folgenden Bilder erklären das sicher viel besser.

Viel Spaß damit!

/_astro/Raspberry_Pi_Dimensions.Bc-6JOk8.png /_astro/humble.C0SUg3lm.png /_astro/humble2.Doukzx1U.png /_astro/layout.UOAIzrtX.png /_astro/package.D0F1OIng.png /_astro/symbol.W221lSoK.png

breadBUG

breadBUG ist ein kleines Mikrocontroller Modul, das direkt auf ein Breadboard aufgesteckt werden kann. Es ist als Prototyping-Werkzeug für tägliche Basteleien gedacht.

Es fasst das für den Mikrocontroller nötige “Vogelfutter” auf einer kleinen Platine zusammen:

  • ATmega8 Controller
  • 16 MHz Quarz und Keramikkondensatoren
  • 5 V Festspannungsregler
  • Reset Taster
  • ISP Stecker
  • LED zur Spannungsüberwachung

breadBUG ist während meiner Arbeit für die Mikrocontroller-AG des MMIs entstanden. Einige Teilnehmer wünschten sich ein einfaches, kleines und günstiges Modul, das sie als Alternative zu dem von uns verwendeten Evaluation Board für eigene Projekte nutzen können.

Fast alle von uns in der AG verwendeten Erweiterungsmodule sind daher Pin-kompatibel mit dem “breadBUG” Board. Bis auf den Controller selber haben wir nur Through-hole Komponenten verwendet um den Aufbau auch für Einsteiger möglichst einfach zu halten.

Das Board hat etwa eine Größe von 2.5x5 cm, sodass im Mehrfachnutzen genau zwei Boards auf eine 5x5cm Platine von seeedstudio.com passen. Damit liegt der Preis für eine einzelne Platine bei weniger als 50 Cent.

Platinen Layout des breadBUG
Platinen Layout des breadBUG.

EAGLE Schaltplan, Layout und Gerber Dateien gibt es auf Codeberg: /stv0g/hardware/breadBUG/v1 .

Mikrocontroller AG

Vor drei Jahren war ich selber Teilnehmer der Mikrocontroller AG und habe diese dann für die vergangenen zwei Jahre mit Hilfe zweier weiterer Kommilitonen, Markus Hamm und Mats Markus, geleitet.

Als Abschluss meiner dortigen Arbeit schreibe ich nun meinen Bericht und möchte diesen hier kurz zusammenfassen. Den kompletten Tutoriums Bericht könnt ihr euch hier herunterladen:

Download:Tutoriums Bericht Mikrocontroller AG

Das Institut für Mensch-Maschine-Interaktion (MMI) der RWTH bietet für Studenten des zweiten Semesters eine freiwillige AG zum Einstieg in die Mikrocontroller Programmierung an. Diese verknüpft theoretische Grundlagen der Vorlesung “Grundgebiete der Informatik 2” von Prof. Roßmann mit praktischen Beispielen und Aufgaben aus dem Bereich der Mikrocontroller. Es handelt sich um eine freiwillige Veranstaltung, die für die Teilnehmer nicht als Studienleistung anerkannt werden kann. Wie auch in der Vorlesung werden die ATmega Mikrocontroller der Firma Atmel verwendet.

Logic Analyzer

Logic traces on a computer screen
Ein Salea Klon
Ein Salea Klon.

Für Einsteiger können die ersten Schritte beim Basteln mit Mikrocontrollern häufig etwas frustrierend sein. Ja, das ist leider auch meine eigene Erfahrung. Der Fehler liegt dann meist im Verborgenen: Wackelkontakte, eine instabile Spannungsversorgung oder Softwarefehler helfen kann hierbei nur viel Geduld und geeignete Messgeräte. Dass dies aber nicht immer direkt ein teures Oszilloskop sein muss, möchte ich in diesem Beitrag zeigen.

Ich konzentriere mich dabei auf einige fast baugleiche Geräte: Saleae Logic & USBee AX. Beide basieren auf dem gleichen Mikrocontroller, dem Cypress FX2, und werden per USB an den Rechner angeschlossen. Bei eBay, AliExpress und co. sind sie für unter 10 € erhältlich.

transWhat

Die Telefonvermittelung bei den Simsons
Die Telefonvermittelung bei den Simsons.

transWhat ist ein XMPP Transport, der den WhatsApp Messenger in das Jabber Netzwerk einbindet.

Das Gateway simuliert dabei serverseitig die normale WhatsApp App von Android beziehungsweise iPhone. Der User benötigt nur noch einen normalen XMPP Client wie beispielsweise Adium, Gaijm, IM+ oder Pidgin. Damit ist es nun möglich WhatsApp auf nahezu allen Geräten und Betriebssystemen einzusetzen. Ich kann transWhat sehr in Kombination mit Pidgin auf Desktops und Laptops und mit IM+ auf Tablets empfehlen 😊.

Alle Details, Serverdaten, Logins, Tipps und Tricks findet ihr hier im Wiki.

Aus verschiedenen Gründen werde ich den Code nicht veröffentlichen sondern das Gateway nur als Service anbieten.

Ich habe mich nun doch dazu entschieden den Quelltext freizugeben. Er ist auf Codeberg zu finden: /stv0g/transwhat .

Nach dem Break gibt’s noch ein paar technische Details und Informationen zur Umsetzung.

calcelestial

Planets of the Solar System

/stv0g/calcelestial ist ein kleines Linux-Tool zum Berechnen von Auf- und Untergangszeiten sowie der Position sämtlicher Planeten unseres Sonnensystems.

Es ist der Weiterentwicklung von /stv0g/sun , das ursprünglich als kleines Bash-Skript für meinen Router startete. Mittlerweile ist das Tool zu einem weit umfangreicherem Werkzeug gewachsen, welches nicht mehr nur die Auf- und Untergangszeit der Sonne berechnen kann:

Es sind mit dem Mond, Mars, Neptun, Jupiter, Merkur, Uranus, Saturn, Venus und Pluto eine Menge neuer Planeten dazugekommen. Auch kann nun die Position dieser Himmelskörper zu jedem beliebigen Zeitpunkt oder dem Auf- und Untergang berechnet werden.

Nun bin ich selber kein kleiner Hobby-Astronom, sodass ich diese ganzen Berechnungen aus dem Ärmel schütteln könnte. Stattdessen nutze ich die Bibliothek libnova. libnova benutzt die sehr genauen Algorithmen “Variations Séculaires des Orbites Planétaires” (kurz VSOP-87), die Pierre Pratagnon 1987 entwickelte.

Terminal window
$ calcelestial
Usage:
calcelestial [options]
Options:
-p, --object calc for celestial object: sun, moon, mars, neptune,
jupiter, mercury, uranus, saturn, venus or pluto
-H, --horizon calc rise / set time with twilight: nautic, civil or astronomical
-t, --time calc at given time: YYYY-MM-DD [HH:MM:SS]
-m, --moment calc position at moment of: rise, set, transit
-n, --next use rise, set, transit time of tomorrow
-f, --format output format: see strftime (3) for more details
-a, --lat geographical latitude of observer: -90° to 90°
-o, --lon geographical longitude of oberserver: -180° to 180°
-q, --query query geonames.org for geographical coordinates
-z, --timezone override system timezone
-u, --universal use universial time for parsing and formatting
-h, --help show this help
-v, --version show version
A combination of --lat & --lon or --query is required.
Please report bugs to: post@steffenvogel.de

Die einfachste Variante nutzt das Unix Tool at:

Terminal window
echo ~/bin/enable-lightning | at $(calcelestial -p sun -m set -q Frankfurt -H civil)

Mit folgenden Cronjobs, lässt sich dieses Prinzip auch leicht auf andere Anwendungen übertragen:

0 0 * * * echo 'fnctl stop && fnctl fade -c 000000' | at $(calcelestial -m rise -p sun -q Aachen)
0 0 * * * echo 'fnctl start' | at $(calcelestial -m set -p sun -q Frankfurt)

Mit dem Tool nvram-wakeup, lässt sich so beispielsweise der Rechner jeden Tag 10 Minuten for Sonnenaufgang automatisch starten:

Terminal window
nvram-wakeup -s $(date -d "-10 min $(calcelestial -m rise -p sun -q Berlin)" +%s)

Oder möchtest du deinen Rechner nach Sonnenuntergang automatisch herunterfahren?

Terminal window
shutdown $(date -d +10 min $(calcelestial -m rise -p sun --lat=50.55 --lon=-6.2) +%H:%M)

Die aktuelle Position des Mondes kann beispielsweise so bestimmt werden:

Terminal window
calcelestial -p moon -q Aachen -f "az: §a alt: §h"

Detailiertere Dokumentation findet ihr in der Manpage calcelestial(1).

calcelestial ist wie immer auf Codeberg verfügbar /stv0g/calcelestial .

mountL2P: Mount L2P Shares on Linux

l2p-3d-klein

Vielleicht kennt ihr Sync-my-L2P? Es ist ein kleines Tool, das automatisiert Dateien vom Online Lernportal der RWTH herunterlädt und syncronisieren kann.

Eigentlich eine super Sache! Entgegen meiner ursprünglichen Erwartung ist das Tool auch unter Linux lauffähig. Ich habe mich trotzdem dazu entschieden das ganze etwas anders, aus meiner Sicht deutlich simpler, zu lösen.

Mein Skript nutzt die Möglichkeit einzelne Microsoft Sharepoint Ordner (hier: L2P-Lernräume) via WebDav einzubinden.

Dazu gibt es unter Linux zwei Varianten:

  1. [davfs2](https://savannah.nongnu.org/projects/davfs2 (nutzt FUSE, kompatibel mit mount und fstab)
  2. gvfs (stark in GNOME & Nautilus integriert, einfach)

Die zweite Variante ist für GNOME Nutzer deutlich einfacher, da hier nur eine entsprechende URI in die Adresszeile des Dateimanagers eingegeben werden muss.

Mein Tool hilft euch diese URIs zu finden, indem es sich unter eurem Namen im L2P einloggt und nachsieht in welchen Lernräumen ihr registiert seid.

Das Skript ist auf Codeberg verfügbar: /stv0g/snippets/bash/mount.l2p.sh .

Terminal window
$ mountl2p.sh
usage: mountl2p.sh [-f FORMAT] [-s SEMESTER] [-u L2P_USER] [-p L2P_PASS]
FORMAT is one of 'gvfs' or 'fstab'
SEMESTER is an optional regex to filter the semester
L2P_USER is your L2P account name like 'sv123242'
L2P_PASS is your L2P account password

Um schnell auf die aktuellen Lernräume zugreifen zu können, bietet es sich an diese als Lesezeichen im Dateimanager zu registrieren:

Terminal window
./mountl2p.sh -f gvfs -s "ws12|ss12" -u sv111090 >> ~/.gtk-bookmarks
L2P WebDAV Mount
L2P WebDAV Mount.

Mikrocontroller & Elektronik CheatSheet

Daniel

Wie war nochmal die Pinbelegung des Festspannungsreglers? Wie stark darf ich die Pins des Mikrocontrollers belasten? Wie viel Volt fallen an dieser LED ab?

Häufig sind es diese kleine Fragen, die gerade Anfänger den Einstieg in die Welt Elektronik oder Mikrocontroller erschwert.

Um diesen etwas zu erleichtern und auch den erfahrenen Bastlern einen Spickzettel zur Verfügung zu stellen, habe ich folgendes CheatSheet zusammengestellt:

Download:Mikrocontroller CheatSheet

Anmerkungen, Hinweise zu Fehlern oder Ergänzungen nehme ich gerne auf. Bitte kontaktiert mich dazu einfach.

Cron Jobs für Sonnenauf- & untergang

Nicht selten kommt es mal vor, dass sich ein Rechner nach astronomischen Zyklen orientiert. Die zur Berechnung der Osterfeiertage häufig verwendete Gaußsche Osterformel basiert so z.T. auf der Mondgleichung.

Unser Problem stellte sich etwas anders dar: Die LED-Flurbeleuchtung in unserem Flur wird durch den Router geregelt und lief bisher in der Regel 24/7. Mit dem hier vorgestellten Programm haben wir es nun geschafft die Laufzeit auf die Nachtstunden zu begrenzen, indem wir die von unserer geografischen Position abhängige Sonnenuntergangszeit nutzen um die Lampen erst bei Dämmerung einzuschalten.

UPDATE: Ich habe nochmal etwas Arbeit in das Tool investiert und es in ein eigenes Projekt ausgelagert. Das neue Tool liefert wesentliche genauere Ergebnisse und mehr Funktionen. Zu finden ist es hier: calcelestial.

Das neue Tool besitzt eine Reihe weiterer nützlicher Funktionen:

Terminal window
$ sun
usage: sun mode [options]
mode is one of: rise, set, noon, daytime, nighttime
following OPTIONS are available
-t, --twilight use special twilight (nautic|civil|astro)
-d, --date calculcate for specified date (eg. 2011-12-25)
-f, --format output format (eg. %H:%M:%S)
-a, --lat geographical latitude (-90° to 90°)
-o, --lon geographical longitude (-180° to 180°)
-q, --query query geonames.org for geographical position
-z, --zone use timezone for output
-h, --help show this help
-v, --version show version
A combination of --lat, --lon or --query is required!

Die einfachste Variante nutzt das Unix Tool at:

Terminal window
echo ~/bin/enable-lightning | at $(sun set -q Frankfurt -t civil)

Mit folgenden Cronjobs, lässt sich dieses Prinzip auch leicht auf andere Anwendungen übertragen:

0 0 * * * echo 'fnctl stop && fnctl fade -c 000000' | at $(sun rise -q Aachen)
0 0 * * * echo 'fnctl start' | at $(sun set -q Frankfurt)

Mit dem Tool nvram-wakeup, lässt sich so beispielsweise der Rechner jeden Tag 10 Minuten for Sonnenaufgang automatisch starten:

Terminal window
nvram-wakeup -s $(date -d "-10min $(sun rise -q Berlin)" +%s)

Oder möchtest du deinen Rechner nach Sonnenuntergang automatisch herunterfahren?

Terminal window
shutdown $(date -d +10min $(src/sun set --lat=50.55 --lon=-6.2) +%H:%M)

HIDeKey

HIDeKey USB Security Token
HIDeKey USB Security Token.

Als Abschlussprojekt und Vorbereitung auf meine Betreuer Tätigkeit für die Mikrocontroller-AG des MMI’s habe ich mich näher mit dem USB-Bus und dem darauf aufbauenden HID-Protokoll befasst.

HIDeKey ist ein kleiner USB-Stick, der als HID-Tastatur vom Rechner erkannt wird und beliebge Zeichenketten und Tastenkombinationen an den Host-Rechner senden kann.

Mein Ziel war es ein kleinen Hardware-Dongle zu entwickeln welcher Passwörter, TANs und Onetime-Tokens direkt an jeden beliebigen Rechner senden kann. Meine Passwörter sind im verschlüsselt EEPROM des Mikrocontrollers gespeichert. Beim Drücken, des Tasters auf dem Stick, wird das Passwort eingegeben.

Als Hardware nutze ich die zuvor vorgestellten USBasp Programmieradapter aus China, deren Firmware ich durch eine eigene ersetzt habe. Mit einem zusätzlichen Taster lässt sich so über ein kleines Menü zwischen 10 User-Passwort-Kombination wählen.

Neue Passwörter können mit einem kleinen Konsolen-Programm direkt über den Rechner einprogrammiert werden.

HIDeKey soll auch zur Generierung von One Time Passwords (OTP) genutzt werden können. Da er sich wie ein gewöhnliche USB-Tastatur verhält, kann er auch unterwegs am Schlüsselbund in Internet-Cafes und Rechner-Pools genutzt werden.

Quelltext und Schaltpläne gibt auf Codeberg: /stv0g/hidekey .

In meinem Wiki ist auch noch etwas Dokumentation gesammelt.

HIDeKey ist wie die meisten meiner Projekte als OpenSource veröffentlicht. Ich freue mich über jede Verbesserung, Erweiterung oder andere Beiträge zu diesem Projekt 😊.

Das 3 € ATmega Developement Board

USBasp Clone
USBasp Clone

Für gerade mal 2,95 € bieten chinesische Händler einen Klon des In-System-Programmers USBasp von Thomas Fischl auf eBay an. Das Board wurde ursprünglich zum Programmieren von AVR Mikrocontrollern entwickelt und basiert selbst auf einem ATmega8 Controller. Das Board bietet folgende Features, die auch für andere Zwecke genutzt werden können:

  • Software USB mit V-USB
  • Stromversorgung über Rechner
  • wahlweise 5V oder 3.3V
  • 2 LEDs
  • 1 Jumper
  • 6 IO-Pins (inklusive UART)

Dieses Angebot ist preislich unschlagbar. Es gibt kein anderes megaAVR Board, das inklusive Versandkosten für unter 3 € zu haben ist. Auch ein Selbstbau mit den günstigsten Bauteilen ist bei kleineren Stückzahlen (< 50) weit teurer. Fertige Leerplatinen sind aber auch über eBay verfügbar.

Der günstige Preis hat aber auch einen Nachteil: Mitunter muss man einen Monat warten, bis der Stick im eigenen Briefkasten liegt. Dafür gibt es in der REgel keine Probleme beim Zoll 😉.

transcode

Digital Logic Diagram
Assembler code

Ich sitze im Zug nach Hause. Gerade komme ich von der letzten Vorlesung des zweiten Semesters: Informatik. Eigentlich bin ich auf dem Weg in die Semester-”Ferien”, ständen da nicht für den nächsten Monat noch 4 Klausuren in meinem Kalender 😉.

Informatik, Grundlagen des Digitalrechners. Klingt eigentlich recht trocken. Trotzdem ist es klar mein Favorit unter den Fächern dieses Semesters. Als Ergänzung zur Vorlesung richtete unser Professor einen kleinen Wettbewerb aus. Mein Beitrag zum Students Englightment Award ist ein Compiler Frontend für den GNU Compiler der Atmel AVRs.

Teil der Vorlesung war die Einführung des Mikrocontrollers ATMega8 von Atmel und dessen Programmierung mit Assembler. Dabei lernten wir zuerst die Schaltungstechnischen Grundlagen und die Minimierung von Schaltnetzen. Anschließend sind wir auf den Aufbau der Zentralen Recheneinheit eingegangen (Steuerwerk, ALU).

transcode kompiliert & assembliert ANSI C und Assembler in Maschinencode und umgekehrt. Dabei wird mit Hilfe von Debugging Informationen ein Bezug zwischen Zeilen im C-Code und den Mnemonics hergestellt. Durch Auswählen von Zeilen werden Bezüge direkt durch Hervorhebungen dargestellt. Für die Darstellung des Maschinencodes lässt sich zwischen binär, dezimal & hexadezimaler Form wählen.

Conway's Game of Life

Conway's Game of Life Screenshot
Conway's Game of Life Screenshot.

Als Übung für meine Informatik Vorlesung an der RWTH Aachen habe ich diese C Implementation von Conways Game of Life geschrieben.

Dieses simple “zero player” Game wird komplett im Terminal ausgeführt. Mit Mausunterstützung und Farben wurden mit libncurses realisiert.

Den Quelltext findet ihr inklusive eines Makefiles auf Codeberg: /stv0g/rwth-info1/src/conway.c .

  • p” pausiert das Spiel
  • q” beendet das Spiel
  • c” leert das Spielfeld
  • Leertaste setzt eine neue Zelle in das aktuelle Feld
  • Pfeiltasten bewegen den Cursor
  • Maus kann zum Bewegen des Cursors genutzt werden
  • 0” fügt ein chaotisches Anfangsmuster ein
  • 1” fügt einen Glider in das Spielfeld ein
  • 2” fügt einen Segler in das Spielfeld ein
  • 3” fügt einen Buffer in das Spielfeld ein
  • +” erhöht die Anzahl der Generationen pro Sekunde (frames per second)
  • -” erniedrigt die Anzahl der Generationen pro Sekunde (frames per second)

Visualize your Power Consumption with fnordlicht LED Modules

fnordlicht Power Consumption Visualizer

Gerade zurückgekommen vom elektro:camp(<<2010>>) aus Kaiserslautern, blogge ich heute über mein neustes Spielzeug: zehn fnordlichtmini’s.

Vor ein paar Wochen bin ich auf das Projekt von Alexander Neumann aufmerksam geworden, um den Eingang neuer Mails, Nachrichten und meinen Stromverbrauch darzustellen. Meine 10 Module waren schnell aufgebaut. Sie bestehen aus je 3x3 LED’s (RGB) und einem ATMega8 Mikrocontroller, der die PWM-Ansteuerung und die Kommunikation über einen seriellen Bus übernimmt.

Leider gab es bisher nur kein in Ruby geschriebenen Code zum Testen der Ansteuerung der Lichter über einen Rechner ( /fd0/fnordlicht/tests ). Daher ergriff ich die Gelegenheit und schrieb eine kleine C++-Bibliothek zur Ansteuerung der fnordlicht Module über die serielle Schnittstelle. Die Bibliothek sowie ein Beispiel-Programm für die Linux-Konsole gibt es auf Codeberg: /stv0g/libfn .

Mit der Ethernet-RS232 Bridge von ethersex (Y-Port) konnte ich sogar die Ansteuerung über das Internet testen. Dies wird auch von der Library unterstützt.

/_astro/IMG_3749.B-334MuJ.jpg /_astro/IMG_3754.Bzfs4Xvn.jpg /_astro/IMG_3756.CHWvRnKD.jpg /_astro/IMG_3760.M_alROZc.jpg /_astro/IMG_3765.C_mUVNnl.jpg /_astro/IMG_3766.Z-Mb1uBh.jpg /_astro/IMG_3770.BDw74amh.jpg

volkszaehler.org

volkszaehler.org Logo
volkszaehler.org Logo.

volkszaehler.org ist ein freier Smart Meter (hier: intelligenter Stromzähler) im Selbstbau. Die anfallenden Stromprofile bleiben dabei unter der Kontrolle des Nutzers.

Seit dem 1. Januar 2010 müssen Stromversorger ihren Kunden für Neubauten so genannte “intelligente Stromzähler” (Smart Meter) anbieten. Der Kunde soll dadurch seinen Stromverbrauch analysieren und optimieren können.

Die dabei anfallenden Daten (“Stromverbrauchsprofil”) erlauben einen sehr detaillierten Einblick in den Tagesablauf des Nutzers (wann steht er auf? wann geht er in’s Bett? wann kocht er? wie oft verwendet er seine Spülmaschine? verändert sich sein Verhalten? …). Darum sollten die Daten ausschließlich für den Nutzer selbst zur Verfügung stehen - und das geht nur, wenn man sich den Smart Meter selbst baut. Mit einem Materialeinsatz von etwa 100 €, etwas Geschick und Zeit lässt sich das mit Hilfe eines Standard-µC-Moduls aufbauen.

Auf der SIGINT 2010 konnte ich mir den Vortrag von Justin Otherguy über das noch recht junge Projekt anhören und fand anschließen die Gelegenheit mit ihm über das Projekt zu sprechen. Schnell war für mich klar, dass ich hier helfen möchte.

Bisher gibt es nur einen funktionsfähigen Prototypen. In den letzten Wochen habe ich mit ein paar weiteren Entwicklern begonnen den Code des Prototypen neu aufzubauen.

Die Architektur von volkszaehler.org ist dreigeteilt:

  1. Die Controller und Sensor Ebene erfasst mithilfe eines Mikrocontrollers die Daten leitet sie an den Backendserver weiter.
  2. Der Backendserver besteht aus einem PHP-Skript und einer Datenbank. Hier werden die Daten weiter verarbeitet und ausgewertet. Er kommuniziert ausschließlich über eine standardisierte JSON API.
  3. Das Frontend stellt die Daten für den Benutzer übersichtlich dar und ist für die Ausgabe der Analysen verantwortlich.
Systemübersicht volkszaehler.org
Systemübersicht volkszaehler.org.

Diese Darstellung verrät uns auch, dass nur der Stromverbrauch erfasst werden kann. Geplant sind sämtliche Messgrößen (Temperatur, Luftdruck, Luftfeuchtigkeit, Strahlung, Niederschlag, …).

Bisher gibt es noch keine stabile, lauffähige Version des Quellcodes. Im Wiki, der Mailing-Liste und im GitHub Repository ( /volkszaehler/volkszaehler.org ) findet ihr weitere Informationen zu meinem neuen Projekt.

Wir freuen uns über jede Unterstützung 😊. Besonders Entwickler mit PHP und Javascript Kenntnissen wären hilfreich 😉.

/dev/nulll - Eine Plattform für Entwickler und Tüftler

/dev/nulll Logo

Micha und Steffen haben, wie viele Bastler, im Laufe der Zeit viele kleine Tools entwickelt, die bei mehr oder weniger alltäglichen Problemen helfen. Wir fanden, dass sie zu schade sind, um willkürlich verteilt auf verschiedenen Festplatten herum zu liegen und schließlich in Vergessenheit zu geraten. Uns fehlte oft die Übersicht und eine angemessene Dokumentation. Oder wir wollten bestimmte Projekte einfach nicht auf unseren eigenen Websites veröffentlichen.

Tiny DNS & URL aka SDDNS

SDDNS Favicon

Zusammen mit Micha besuchte ich Ende letzten Jahres das U23 des C4 in Köln. Dort habe ich viel über die Techniken des Internets gelernt. Unter anderem ging es hier auch um das Domain Name System, das für die Namensauflösung im Internet verantwortlich ist.

Mittlerweile betreibe ich einen eigenen DNS Server für meine Domains (0l.de, steffenvogel.de, griesm.de & vogel.cc).

Zudem biete ich euch kostenloses DNS Hosting. Gerne übernehme ich auch die DNS Administration eurer Domains. Jedoch könnt ihr sicherlich verstehen, dass ich euch dafür dann nichts garantieren kann.

Mit der Zeit habe ich ein Webinterface für den DNS Server Bind entwickelt auf das nun jeder Zugriff hat. Ihr könnt eigene Subdomains registrieren, Records setzen und URL Weiterleitungen einrichten. Dynamisches DNS wird ebenso unterstützt.

Es ist auch möglich URLs zu verkürzen und so beispielsweise die URL: https://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=100237997621038330776.000468b0a95f89721a96e&ll=18.646245,15.820313&spn=120.933723,198.632813&z=3 auf http://a.0l.de abzukürzen Das ist vergleichbar mit dem Service von TinyURL. Jedoch sind meine URLs dann um 7 Zeichen kürzer 😊. Im Gegensatz TinyURL sind meine URLs auch nur über die Subdomains erreichbar. Eine direkte Unterscheidung zwischen eigenem DNS Record und einer simplen URL Weiterleitung ist also nicht möglich.

Service Wiki/Doku