Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / build_all.sh
Last active April 19, 2026 08:00
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="MEDIUM_FAST"
# Define the owner names and their corresponding device types
@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>