Hauke’s Projects

Playin' around with Electronics and Computers

Documentation

Blog posts mainly thought as documentation for myself, but hopefully of some value to others too.

Next Generation Perfect Offline Hiking Maps – Superatlas Goes Vector! Part I: Introduction

The survey offices of many countries now offer vector maps, so I adopted my previously raster map based hiking maps to use these vector maps. This results in much smaller map files, a sharper display and deeper zoom possibilities without the need to add more data. The data reduction now allows to store the OpenStreetMap (OSM) layer of my hiking maps for the whole of Germany in just about 650 MB. I also used this opportunity to revisit my OSM data selection and the general rendering, improving the maps considerably.

This is part 1 of 3, giving a general introduction – if you are just interested in using the maps, or if you already know why vector based maps are so much better than raster maps, you can skip it. Part II as the core piece explains how to use my maps and create the necessary map files yourself. Part III explains how to modify the OSM data selection, the rendering style and how to adopt for additional map sources – it requires the highest amount of tech savviness of the three parts.

Continue reading “Next Generation Perfect Offline Hiking Maps – Superatlas Goes Vector! Part I: Introduction”

Superatlas Goes Vector! Part II: Creating and Using the Offline Vector Maps

In part I of this series of three posts, I introduced you to the benefits of using vector map data vs. raster map data. In this part I’ll explain the one-time-setup required to use the maps with OruxMaps, and the steps you will need to run each time you want to produce up-to-date map data.

The One-time-setup consists of:

  • Registering for the Mapbox Premium maps (Paid feature of OruxMaps)
  • Putting the base files on the smartphone (style, glyphs and sprites)
  • Installing and preparing tilemaker
  • Installing QGIS and adding data sources
  • Optional: Installing Osmosis (depends on your use cases)

The map creation needs the following steps:

  • Downloading OSM data files from Geofabrik (one or several, depending on your use cases)
  • Optional: Merging the OSM data files (only required if your region is not covered by a single file)
  • Creating the OSM layer mbtiles database via tilemaker
  • Downloading the basemap.de vector tiles into a second mbtiles database via QGIS
  • Optional: Downloading the basemap.de contour lines vector tiles into a third mbtiles database via QGIS
  • Copying the two or three mbtiles files onto the smartphone
  • Updating OruxMaps offline map database

Continue reading “Superatlas Goes Vector! Part II: Creating and Using the Offline Vector Maps”

Superatlas Goes Vector! Part III: How to Modify the OSM Data Selection and/or Mapbox/Maplibre Rendering Styles

In this last (and longest) part of the Superatlas-goes-vector-series I’ll explain how to influence the process of selecting OSM data and adding them to the vector layers. This mainly revolves around a LUA script, which implements the logic of OSM object selection, filtering and attribute processing. I will also explain how a Mapbox style can be modified, and how to adjust the symbols and fonts used by the style. So, if you do not like my style (which I can fully understand 🙂 ), this is a must-read for adjusting everything to your preferences.

The following steps will be covered:

  • Selecting the OSM data for the map
    • The tilemaker configuration file
    • The basic structure of the tilemaker LUA process script
    • Concepts in my LUA script
  • Controlling map data rendering: The Basics
    • Understanding Mapbox style files
    • Map data sources
    • A closer look on sprites
    • Glyphs and how to create them
    • The layer definitions
  • One-Time-Setup for Style Editing
    • Setting up tilemaker-server via an nginx reverse proxy to serve map data to Maputnik
    • Setting up nginx to serve static files (glyphs, sprites)
  • Edit the style
    • Prepare style file for editing
    • Start tilemaker-server
    • Loading the Superatlas style into Maputnik and making changes
    • Bringing back the changes to OruxMaps
  • Putting it all together

Continue reading “Superatlas Goes Vector! Part III: How to Modify the OSM Data Selection and/or Mapbox/Maplibre Rendering Styles”

CEC-like Power Features with Non-CEC-Equipment

With a Raspberry Pico, I monitor my Sony amplifier from the 90s and my 2013 Dell monitor, and switch on my NUC-based media center if any of these devices are switched on. This is comparable to the CEC functionality that more modern devices provide via the HDMI port. I also utilize the USB/serial interface of the Pico to check if any of the two devices is still on to include this into my auto-shutdown script logic.

As a result, my media center boots up as soon as I switch on my amplifier or my monitor, and only auto-shuts down if both are off.

Continue reading “CEC-like Power Features with Non-CEC-Equipment”

Media Center Auto Shutdown and RTC Wakeup Based on tvheadend Recording Schedule

I created a script that runs via cron job that will power off my media center if it is not in use, but will program the real time clock (RTC) on the motherboard to wake up the system in time to run a scheduled recording, and/or to update the EPG data, and from that derive potential new or changed auto-recordings. To determine if the system is currently not in use, I

  • Check if the monitor is off
  • Check if any audio is playing, e.g.,  Spotify or KODI is playing anything
  • Check if the wireless keyboard is connected
  • Check if tvheadend is currently recording something

Also, the shutdown processing can be blocked by creating a flag file. If that file exists, no shutdown will happen.

The wake-up time is either the next recording time plus some allowance for boot time, or every 24 hours, whatever comes first. This makes sure that at least once a day the EPG is updated and tvheadend can update its auto-recording-schedule.

As a result, I reduce power consumption of the media center considerably.

Continue reading “Media Center Auto Shutdown and RTC Wakeup Based on tvheadend Recording Schedule”

My Next Media Center Iteration: Intel NUC8i3BEH

My Raspberry Pi 4 based media center has some issues, which I was able to resolve by switching to an Intel NUC8i3BEH platform. I was able to make the device quiet despite of its fan, and set up everything to have live TV and PVR, a web browser, Spotify and other DRM content in a very usable and performant setup.

Continue reading “My Next Media Center Iteration: Intel NUC8i3BEH”

Simple Capacitive Water Sensor for a Water Container

From simple, standard electric cable I built a capacitive sensor to assess the water level in my water container. While the circuit was replicated from this blog (thanks for sharing!), I’d like to share how I built the actual capacitor.

Continue reading “Simple Capacitive Water Sensor for a Water Container”

Replacing Fabtotum Hybrid Head v1 Hotend with E3D Lite6

I replaced the stock hotend of the Fabtotum Personal Fabricator Hybrid Head v1 by an E3D Lite6 hotend (The full metal V6 should work the same way). In this post I describe the steps to remove the old hotend, get in the new hotend and the simple modifications to the firmware that were required.

Continue reading “Replacing Fabtotum Hybrid Head v1 Hotend with E3D Lite6”

Quick Note: Modify the WordPress Comments Cookie Consent in an Update-stable Way

It always bothered me that I could not modify the text (“Save my name, email, and website in this browser for the next time I comment.”) of the cookie consent checkbox in the WordPress comments section to explicitly mention that it uses cookies. Continue reading “Quick Note: Modify the WordPress Comments Cookie Consent in an Update-stable Way”

Scroll to top