Writing a Quick and Easy Thread-Monitor (Watchdog) in Python [shorts #1]

A thread-monitor, often also referred to as a watchdog, is extremely helpful when building multi-threaded and reliable applications. In its simplest form, a watchdog should detect when one or more threads hang or crash, and it should restart the problematic threads if necessary. Depending on your use-case, you could implement this helper in a variety of ways, and you could add many more features such as a heartbeat function that allows each thread to report its progress to the monitor.

Continue reading Writing a Quick and Easy Thread-Monitor (Watchdog) in Python [shorts #1]

Write better looking console applications using ANSI escape codes

Console applications are a great thing: They usually solely focus on getting things done. That, however, often also means that the user experience can come short. While I don’t have a problem with a simple text-only menu, it can often scare away new users. But there’s a way to easily style your console applications so that they can have something that you could call a primitive GUI:

Continue reading Write better looking console applications using ANSI escape codes

How to use Websockets to control an ESP8266 and a Raspberry Pi with a web browser

For a current project of mine, I had to evaluate how high the latency is when using websockets. In my case, I wanted to use a small single board computer as the server and any device, that can run a web browser, as the client. This tutorial illustrates how a Raspberry Pi and an ESP8266 can be used to act as a websocket server that can be controlled with a standard webbrowser.

Continue reading How to use Websockets to control an ESP8266 and a Raspberry Pi with a web browser

Low latency and high FPS camera stream with a Raspberry Pi

I just saw that two very good sources, that both had an article about this topic, have gone offline without an archived version. And because I continued my work on a robot that is controlled by a Raspberry Pi, I had to figure out how to create a low latency and high FPS stream from the Pi’s camera that can be viewed in a web browser again.

Continue reading Low latency and high FPS camera stream with a Raspberry Pi

DIY electronic riddle advent calendar

Oh yes, Christmas! It’s almost that season of the year again. And to shorten the time between the 1st of December and Christmas Eve’, I thought about a bit more interesting advent calendar than one, that only has chocolate in it. This electronic advent calendar offers a riddle that you can create for a loved one or a friend and give it to them so they can try to solve it before Christmas arrives. It offers a clue every day and it presents all unlocked clues on a website that runs on the device itself. The only two things it needs to work is a power supply and a WiFi network it can connect to. And the best thing is: It is really simple to build and it can be re-used every year and it can also be used for other occasions (for example Valentine’s Day)! Continue reading DIY electronic riddle advent calendar

How to use hardware PWM/CLK to get exact timings on a Raspberry Pi

Introduction

This might not be a common issue, that hobbyists run into when creating their projects, because usually the software PWM, offered by the raspberry pi’s RPi.GPIO-Module, is exact enough for dimming some lights or controlling dc-motors. But for real-time and time-critical applications, this is actually an issue: Continue reading How to use hardware PWM/CLK to get exact timings on a Raspberry Pi