MYCSS

2026-10-04

Project Sound Monitor for detect target operational states

Sound Monitor is an IoT sound and acoustic pattern monitoring tool designed to capture live audio, analyze spectral characteristics (PSD / Power), detect target operational states (e.g., compressor/device ON/OFF), and record state transitions to a SQLite database. 

STFT spectrogram of a compressor sound recorded in advance using a smartphone’s digital microphone.
PSD Welch 60-1000Hz

2026-10-03

Project Seven Segment Monitor - visually monitoring the refrigerator’s power consumption

🛎️ A hobby involving collecting provisions includes monitoring passive Bluetooth temperature, analyzing sound with PSD and FFT tools, and now adding visual monitoring through a webcam focused on seven-segment indicators.

Why 

The previous project for detecting the on/off state of the kitchen refrigerator by sound analyses has been stopped. The built-in microphone’s sound quality was so poor and noisy that I decided to abandon it and switch to a more reliable method: visually monitoring the refrigerator’s power consumption by reading the amperage, with 00.0A indicating OFF and 00.7A or 00.8A indicating ON.

How

📼 Seven Segment Monitor is a computer vision and IoT tool that continuously captures images from a USB or V4L2 camera, or static frames, of seven-segment displays. It uses OpenCV to extract and recognize numeric readouts, then stores the parsed readings in an SQLite database with automated retention and cleanup.
Example of a development result
A development laptop with sunglasses used as a pre-filter for the webcam to reduce lighting from seven-segment LED indicators on a surge voltage device.

Features

  • Multi-threaded Architecture:
    • Camera Producer: Captures frames asynchronously from a V4L2/USB camera or loads them from disk for testing or simulation.
    • Vision Worker: Handles automatic rotation correction, color and brightness filtering, shear de-skewing, digit box slicing, and segment state recognition.
    • Database Writer Worker: Batches writes and saves timestamped readings and alert/state statuses to SQLite.
    • Database Cleanup Worker: Purges records older than a configurable retention period automatically.
  • Multiple Color & Mask Extraction Algorithms:
    • WITHOUT_GREEN: Difference-based channel masking for red LED displays.
    • RED: Dual-band HSV color masking.
    • RED_ADAPTIVE: Adaptive thresholding based on the green-to-red pixel ratio.
  • Display Layout Customization:
    • Configurable rows and digits per row (NUM_DIGITS_ROWS, NUM_DIGITS_PER_ROW).
    • Shear angle compensation for slanted italicized digits (DIGIT_SHEAR_ANGLE).
    • Digit density and segment activation threshold tuning.
  • Deployment Ready:
    • Run directly via Python CLI (sevensegmentmonitor).
    • Run containerized via headless Docker Compose with optional Grafana integration.

Repositories: 

2026-09-13

Project Thermometer Monitor - Bluetooth Low Energy Passive Monitoring

Thermometer Monitor is a Python-based asynchronous Bluetooth Low Energy (BLE) environmental monitoring app and telemetry logger. It continuously listens for BLE advertising packets from smart thermometers, filters out duplicate readings, and saves the data to a local SQLite database.

Thermostat of refrigerator 

Why 

This series of projects (Thermometer Monitor, Sound Monitor, Seven Segments Monitor) originated from the stated problem of restoring the working condition of a kitchen refrigerator. Need to understand how mechanical tuning of the thermostat range in a refrigerator relates to temperature and the corresponding on and off cycle times of the compressor.

How

It constantly listens for BLE advertising packets in passive mode from smart thermometers and hygrometers (like the Xiaomi Mijia / LYWSD03MMC running custom ATC or PVVX firmware), decodes the sensor data, removes duplicate readings, and saves everything to a local SQLite database.

It supports cross-platform operation (Linux, macOS, Windows) out of the box via Bleak, with an automatic Linux raw HCI socket fallback for passive mode in legacy adapters or specialized container setups. If passive mode isn’t available, like on macOS, it switches to active listening mode. In active mode, the listener device requests extra responses from the target device’s advertising packets, such as details like the device name. These additional responses drain the BLE device’s battery more, so it’s best to use passive scanning whenever possible.

It comes with ready-to-use Docker Compose setups and a Grafana dashboard integration for real-time visualization.

This project is a continuation of other projects focused on monitoring BLE devices:
- Моніторинг температури та сповіщення про критичні значення.
- Скрипт для показу значень температури та вологості Bluetooth BLE термометра Xiaomi

Grafana Example View:


2026-08-13

DHCPv6 Cloned VM - Ubuntu

The main problem with a cloned VM is that the DUID doesn’t change, which causes issues when trying to get a new DHCPv6 address.

Netplan

dhcp6: true
dhcp-identifier: mac
/etc/netplan/00-installer-config.yaml
network:
  ethernets:
    ens18:
      addresses:
      - 10.10.10.106/24
      mtu: 9000
      dhcp6: true
      dhcp-identifier: mac
      match:
        macaddress: bc:24:11:12:11:3b
      nameservers:
        addresses:
        - 10.10.10.1
        search:
        - example.net
      routes:
      - to: default
        via: 10.10.10.1
      set-name: ens18
  version: 2

DUIDType or Reset Machine ID

Instead of clearing the unique machine identifier, you can set it up to use the link-layer MAC for DHCPv6.
sudo mkdir -p /etc/systemd/networkd.conf.d 
sudo nano /etc/systemd/networkd.conf.d/10-dhcp6-duid.conf
[DHCPv6]
   DUIDType=link-layer
Check the result:
sudo systemctl restart systemd-networkd 
networkctl status ens18
...
DHCPv6 Client DUID: DUID-LL:0001bc241112113b

Reset Machine ID

Clear the unique machine identifier so a new one generates on next boot:
sudo rm -f /etc/machine-id
sudo systemd-machine-id-setup

2026-07-27

Add Boot Driver for DualBoot Ubuntu and MacOS with OpenCore

Передісторія

У доньки є старенький MacBook Air моделі 7.2 2017 року, який вона використовує для простих завдань.
З часом я вже ремонтував його, замінивши SSD на Samsung M.2 EVO 970Plus 500 ГБ через
перехідну плату. Це остання модель MacBook Air котра дозволяла це робити. 
Тож тепер місця стало значно більше, ніж на рідному диску обсягом 120 ГБ.

 SSD Samsung M.2 через перехідну плату

Модель MacBook Air 7.2 2017 року це:

  • процесор: Intel i5 
  • оперативної пам'яті: 8 ГБ 
  • відеоадаптер: Intel HD 6000
  • Wi-Fi адаптер:  Broadcom BCM4360 802.11ac Dual Band Wireless [14e4:43a0] (rev 03)
Під час заміни диска я також встановив за допомогою "OpenCore Legacy Patcher" версію macOS "Sonoma" з доданими усіма відсутніми драйверами. Але забула вона, що оновлювати її більше не можна, і нове оновлення macOS стерло драйвери Wi-Fi адаптера, тож система залишилася без Wi-Fi, адже він, Broadcom BCM4360, не підтримується у macOS "Sonoma".
І вона вимушена була відновила стару версію macOS "Mojave" що була при виробництві через Recovery tools.

І ось, коли донька приїхала в гості, мені знову довелося вирішувати ту ж задачу з "OpenCore Legacy Patcher" та macOS "Sonoma", але цього разу я вирішив встановити ще й альтернативну операційну систему - Ubuntu 26.04 LTS.

Встановлення операційних систем

Встановив macOS "Sonoma" з нуля через USB-інсталяцію, створену за допомогою OpenCore Legacy Patcher GUI tools.
Потім розділив диск 512 ГБ на 60 ГБ у форматі FAT для Ext4 та 8 ГБ FAT для Swap. На 60 ГБ розділ встановив Ubuntu 26.04 LTS як "/", а на 8 ГБ розділ - "Swap". 
Проте Wi-Fi (BCM4360) не запрацював, тож я роздав інтернет через Bluetooth зі свого мобільного телефону, щоб оновити систему та встановити потрібне.

Bluetooth з мобільного телефону в Ubuntu

Коли забув ти рідну мову, біднієш духом ти щодня...
When you forgot your native language you would become a poor at spirit every day ...

Д.Білоус / D.Bilous
Рабів до раю не пускають. Будь вільним!

ipv6 ready

Популярні публікації