• Water level sensor for coffee machine

    My espresso machine doesn’t have a water level sensor, and when running out of water it starts making horrible noises that don’t sound healthy at all. Since I keep forgetting to check the tank, I decided to make a sensor and send low water level notifications to my phone.

    Read more
  • Checkpoint Charlie sign

    In case you needed a traced vector image of the iconic Berlin Wall sign in SVG format.

  • CO₂ sensor with ESPHome

    It’s getting ridiculously easy to make sensors for your smart home these days. I’ve built a carbon dioxide sensor using Senseair S8 LP (bought here) and ESP8266 NodeMCU board with native Home Assistant integration using ESPHome framework. Here are the steps:

    Read more
  • Bluetooth and dual boot

    If you dual boot on your PC you may have noticed that Bluetooth devices need to be re-connected in each OS after their use in another. That’s super annoying, but can be fixed by syncing the encryption keys in the OSes (Linux and Windows in my case). I tried to do it manually first and it worked for my headphones (Sony WH-1000X M3), but not for my mouse (Logitech MX Anywhere 2S). I searched for an automated solution and found this one. It may not be the simplest (you’ll have to download an extra Windows app and run a command there first), but it worked like a charm. Oh, and you’ll need root/admin access on both OSes.

  • Power struggle

    So I got a TV with an intention of connecting it to the Kodi-based LibreELEC distro running on Raspberry Pi 4. The TV is of course a smart one because the market.

    But things didn’t go that smoothly: LibreELEC is currently having some issues with 4k playback on RPi4 so I decided to wait and use the TV’s smart features instead.

    The TV is running Samsung’s Tizen and can play DLNA/UPnP content e. g. from ReadyMedia server which is easy to set up. The problem was that the TV was randomly disconnecting with the “cable not connected” message. The playback progress was naturally lost. Infuriating.

    Read more
  • WiFi e-paper display

    Recently I’ve put together a simple e-paper (a.k.a. e-ink) display which shows current time and temperature. Why e-paper? Unlike LCD it provides better contrast at any angle and unlike TFT it doesn’t require backlight. The only downside is long screen refresh time (~4 s in my case).

    The idea was to get current time from an NTP server and temperatures from Home Assistant instance which in turn gets them from wireless sensors.

    Read more
  • Extending Li-ion battery life for ThinkPad and Android

    Li-ion batteries don’t like being fully charged. They will retain capacity significantly longer if you charge them up to 80% or less. Check this plot from Battery University:

    If you usually use up all of your laptop battery during the day, gradual battery degradation is something you’ll have to live with. However, if you mostly work with AC charger plugged in, you can set lower limit to your battery charge and prolong its life.

    Read more
  • T460s fingerprint reader in Linux

    Lenovo ThinkPad T460s laptop has a built-in fingerprint reader, but unfortunately until recently there was no way to make it work. You know the story: the manufacturer (Validity, later bought by Synaptic) refuses to release the documentation and says they may release proprietary Linux driver someday. Thankfully, Nikita Mikhailov started reverse engineering these sensors and that work has been adapted by Marco Trevisan to create a functional fprint driver for 2016 ThinkPads (including T460s).
    The procedure to make it work is not very straightforward, so I’ve decided to document it here for posterity.

    Read more
  • Battery powered weather station with ESP8266 and BME280

    I used to use web services such as OpenWeatherMap to monitor outside temperature in openHAB. I found out that sometimes they’re not very accurate and naturally they fail when the internet is down. So I decided to measure the temperature myself. After some searching, I decided to settle with battery powered ESP8266 wireless solution. The advantages are the following:

    • no wires;
    • low cost;
    • easy programming via familiar Arduino IDE;
    • long battery operation with deep sleep mode.
    Read more
  • Fixing DNS leaks in LEDE

    Disclaimer: I’m not an expert in networking, so the instructions below may be flawed. Be warned and proceed with caution! Corrections are highly welcome.

    DNS leaks are nasty. ISPs may tamper with DNS for purposes of censorship or eavesdropping. Luckily, there are public DNS servers, e. g. Google (8.8.8.8), Cisco OpenDNS (208.67.222.222) and Quad9 (9.9.9.10) which may behave better.

    I’ve set up my router to use public DNS servers instead of provider’s. In LEDE (OpenWrt) router firmware this can be done in GUI: go to Network → Interfaces → WAN → Edit → Advanced Settings, uncheck ‘Use DNS servers advertised by peer’ and add custom server IPs below.

    The trouble is that LEDE runs its own DNS server and advertises its address (e. g. 192.168.0.1) to clients via DHCP. When NetworkManager connects to OpenVPN it keeps this address as one of DNS resolvers (even if you add push "dhcp-option DNS 9.9.9.10" to OpenVPN server config). You can check it with

    cat /etc/resolv.conf

    # Generated by NetworkManager
    nameserver 9.9.9.10
    nameserver 208.67.222.222
    nameserver 192.168.0.1

    This way, DNS requests may occasionally be sent to the router which forwards them to configured servers skipping VPN tunnel and making them visible to the ISP (unless you’ve set up DNSCrypt, of course).

    Read more