Skip to content

Instantly share code, notes, and snippets.

@Mictronics
Mictronics / Active_Antenna_Tuner.ino
Last active April 6, 2026 14:48
Active Antenna Tuner
/*
* SCPI commands send using Linux netcat on command line
* echo "SOUR:FREQ:CW 123457000" | nc -q 1 192.168.178.232 5025
* echo "SOUR:FREQ:CW 31.458 MHz" | nc -q 1 192.168.178.232 5025
* echo "SOUR:FREQ:FIX 31.458 MHz" | nc -q 1 192.168.178.232 5025
* echo "*RST" | nc -q 1 192.168.178.232 5025
* echo "SYST:ERR?" | nc -q 1 192.168.178.232 5025
* echo "*IDN?" | nc -q 1 192.168.178.232 5025
* echo "*OPC?" | nc -q 1 192.168.178.232 5025
* SYSTem:LAN:CONFig <Static IP>, <Static Gateway>, <Static Subnet>, <Port>
@Mictronics
Mictronics / build_all.sh
Last active December 23, 2025 08:31
Build script for Meshtastic firmware with individual user preferences for each owned node.
#!/bin/bash
LONG_VERSION=$(bin/buildinfo.py long)
SHORT_VERSION=$(bin/buildinfo.py short)
BRANCH=$(bin/buildinfo.py branch)
# Use modem preset for all nodes
preset="LONG_FAST"
# Define the owner names and their corresponding device types
@Mictronics
Mictronics / RP2040_Watchdog.ino
Created March 18, 2025 17:09
RP2040/RP2350 External watchdog based on ATtiny10
/**
* RP2040/RP2350 External watchdog
*
*/
#include <avr/sleep.h>
#define WDT_TIMEOUT 180 // Watchdog timeout 180s/3min (flashing the RP2040 must taken into account!)
volatile uint16_t wdt_count = 0;
static void delay(unsigned long millis) {
// ~1ms delay
@Mictronics
Mictronics / status2telegram.py
Last active April 28, 2024 15:58
Python script sends status report to Telegram bot
#!/usr/bin/env python3
from pisugar import *
import asyncio
import os
import sys
import logging
from telegram import Update
from telegram.ext import filters, MessageHandler, ApplicationBuilder, CommandHandler, ContextTypes
import gammu.smsd
@Mictronics
Mictronics / sms2telegram.py
Created April 28, 2024 12:14
Python script forwarding Gammu service SMS to Telegram
#!/usr/bin/env python3
from pisugar import *
import asyncio
import os
import sys
import telegram
async def main():
# Get Pisugar battery level
conn, event_conn = connect_tcp('localhost')
@Mictronics
Mictronics / call2telegram.py
Created April 28, 2024 12:12
Python script forwarding Gammu service caller ID to Telegram
#!/usr/bin/env python3
import asyncio
import os
import sys
import telegram
from datetime import datetime
async def main():
if len(sys.argv) == 1:
print("Phone number missing")
@Mictronics
Mictronics / automation.yaml
Created August 18, 2023 13:29
Home Assistant HASS configuration for chines diesel heater controller Afterburner Mk2
alias: Get Heater Status
description: ""
trigger:
# - platform: homeassistant
# event: start
- platform: time_pattern
# Matches every hour at 5 minutes past whole
minutes: "/1"
condition: []
action:
@Mictronics
Mictronics / dbhub.io.md
Last active August 16, 2023 20:22
dbhub.io development environment setup

Here is how to setup a development environment for dbhub.io.

dbhub.io project on Github

First I tried Docker which was a PITA this time, see issue 211, but ended up with a manual installation on a fresh Alpine Linux image, based von 3.18 edge.

Built and tested with dbhub.io master branch up to commit 5c9e1ab.

Following steps in order to run on the root shell. (initial ALpine Linux login is root without password)

@Mictronics
Mictronics / readsb-mqtt-stats.py
Last active November 23, 2025 11:03
Reads statistics from readsb stats.json or stats.pb and forwards to homeassistant (HASS) via MQTT broker.
#! /usr/bin/python3
# Reads statistics from readsb stats.json or stats.pb and forwards to homeassistant (HASS)
# via MQTT broker.
#
# Dependencies:
# pip3 install paho-mqtt
# pip3 install watchdog
# https://github.com/protocolbuffers/protobuf
@Mictronics
Mictronics / readsb-mqtt-stats-json.py
Last active November 23, 2025 11:03
Reads statistics from readsb stats.json and forwards to homeassistant (HASS) via MQTT broker.
#! /usr/bin/python3
# Reads statistics from readsb stats.json and forwards to homeassistant (HASS)
# via MQTT broker.
#
# Dependencies:
# pip3 install paho-mqtt
# pip3 install watchdog
import sys