π Configure WiFi, SSH, users, hardware peripherals, and manage devices through encrypted mesh networking
Install β’ Quick Start β’ Features β’ Docs β’ PyPI
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π MESHPI FLEET MANAGEMENT β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β GRUPY RPi βββββΆβ PROFILE HW βββββΆβ INSTALACJA βββββΆβ MONITORING β
β β β β β β β β
β β’ office_sensorsβ β β’ OS + Drivers β β β’ Pakiety β β β’ Prometheus β
β β’ warehouse_autoβ β β’ Biblioteki β β β’ ModuΕy β β β’ Grafana β
β β’ lab_gpio β β β’ Konfiguracja β β β’ Uprawnienia β β β’ Alerting β
β β’ home_automationβ β β β β β β’ Audit Logs β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β β
βΌ βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β LOGIKA β β KONFIGURACJA β β DEPLOYMENT β β OBSERWOWALNOΕΔβ
β β β β β β β β
β β’ Logiczne β β β’ YAML profiles β β β’ SSH Remote β β β’ Real-time β
β β’ Zbiory β β β’ Kategorie β β β’ Batch Install β β β’ Historical β
β β’ Przeznaczenie β β β’ Tagi β β β’ OTA Updates β β β’ Alerting β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π₯ FLOW PRACY MESHPI β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββ βββββββββββ βββββββββββ βββββββββββ βββββββββββ
β PLAN βββββΆβ KONFIG βββββΆβ WYBΓR βββββΆβ INSTAL βββββΆβ MONITOR β
β β β β β β β β β β
β Grupy β β UrzΔ
dz. β β Profile β β Pakiety β β Metryki β
β Profile β β SSH β β Hardwareβ β ModuΕy β β Alerty β
β Scenarizβ β SieΔ β β Drivers β β Uprawn. β β Logs β
βββββββββββ βββββββββββ βββββββββββ βββββββββββ βββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π’ TYPOWE WDROΕ»ENIE - BIURO β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ
β HOST PC β βββΆ meshpi host (port 7422)
β 192.168.1.10 β
βββββββββββββββββββ
β
βΌ SSH + ENCRYPTION
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β RPi #1 β β RPi #2 β β RPi #3 β
β 192.168.1.100 β β 192.168.1.101 β β 192.168.1.102 β
β β β β β β
β β’ BME280 Sensor β β β’ BME280 Sensor β β β’ BME280 Sensor β
β β’ OLED Display β β β’ OLED Display β β β’ OLED Display β
β β’ WiFi Config β β β’ WiFi Config β β β’ WiFi Config β
β β’ SSH Keys β β β’ SSH Keys β β β’ SSH Keys β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π PROMETHEUS + GRAFANA β
β β
β β’ CPU/Memory/Temperature Metrics β
β β’ Sensor Data (temp/humidity/pressure) β
β β’ Device Status & Health β
β β’ Alert Rules (offline, high temp, low memory) β
β β’ Historical Data & Trends β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
MeshPi eliminates the manual work of configuring Raspberry Pi devices from factory defaults. Whether deploying one device or an entire fleet, MeshPi handles:
- πΆ WiFi credentials - No monitor/keyboard needed
- π SSH keys - Secure remote access out of the box
- π€ User accounts - Create users, set passwords
- π Locale & timezone - Regional settings applied automatically
- π§ Hardware peripherals - 49+ profiles for displays, sensors, GPIO devices
- π Real-time monitoring - CPU, memory, temperature, network status
- π€ LLM-powered management - Natural language fleet commands
All secured with RSA-2048 + AES-256-GCM encryption. No credentials ever travel in plaintext.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π QUICK START FLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β HOST PC β β MESHPI HOST β β CLIENT RPi β
β β β β β β
β β’ Install MeshPiβ βββΆ β β’ Config Wizard β βββΆ β β’ Scan & Join β
β β’ Run Config β β β’ Start Service β β β’ Auto-Setup β
β β’ Start Host β β β’ Port 7422 β β β’ Reboot Ready β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
# Install
pip install meshpi
# On HOST machine (your PC or a dedicated RPi)
meshpi config # Interactive configuration wizard
meshpi host # Start the host service
# On each CLIENT Raspberry Pi (fresh from factory)
meshpi scan # Auto-discovers host, configures itself, rebootsπ― Done! Your Raspberry Pi is now configured and ready.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π± RASPBERRY PI SETUP FLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β FACTORY RPi βββββΆβ CONNECT NET βββββΆβ UPDATE SYSTEM βββββΆβ SCAN & JOIN β
β β β β β β β β
β β’ Fresh OS β β β’ WiFi/Network β β β’ apt update β β β’ meshpi scan β
β β’ Default Configβ β β’ Internet β β β’ apt upgrade β β β’ Auto-discover β
β β’ No Config β β β’ Access β β β’ reboot β β β’ Auto-setup β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
Before running meshpi scan on your Raspberry Pi, follow these steps:
# Connect to WiFi using desktop interface or command line
sudo raspi-config
# Navigate to Network Options β Wi-Fi β Enter SSID and password# Update package lists and upgrade system packages
sudo apt update && sudo apt upgrade -y
# Reboot after updates
sudo reboot# Install pip if not already installed
sudo apt install python3-pip python3-venv -y
# Verify installation
pip3 --version# Install MeshPi package
pip3 install meshpi
# Or with LLM support for natural language commands
pip3 install "meshpi[llm]"# Discover and connect to MeshPi host
meshpi scanFor experienced users, here's the complete setup in one command:
sudo apt update && sudo apt upgrade -y && sudo apt install python3-pip -y && pip3 install meshpi && meshpi scanWhen you run meshpi scan, the client will:
- π Discover Host - Uses mDNS to find MeshPi hosts on your network
- π Key Exchange - Generates RSA key pair and exchanges with host
- π Download Config - Receives encrypted configuration
- βοΈ Apply Settings - Configures WiFi, SSH, users, locale
- π Reboot - Restarts to apply all changes
No hosts found?
- Ensure host machine is running
meshpi host - Check both devices are on the same network
- Verify firewall allows mDNS (port 5353)
Installation issues?
# Update pip to latest version
pip3 install --upgrade pip
# Install with specific version
pip3 install meshpi==0.1.14βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π₯ MESHPI FEATURE MATRIX β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β ENCRYPTION β β FLEET MGMT β β HARDWARE β β MONITORING β
β β β β β β β β
β β’ RSA-2048 β β β’ WebSocket β β β’ 49+ Profiles β β β’ Prometheus β
β β’ AES-256-GCM β β β’ Real-time β β β’ Group Mgmt β β β’ Grafana β
β β’ mDNS Discoveryβ β β’ Push Updates β β β’ Auto-Install β β β’ Alerting β
β β’ Zero-Touch β β β’ Remote CMD β β β’ Custom Config β β β’ Audit Logs β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- RSA-2048 key exchange + AES-256-GCM encryption
- No shared secrets, no cleartext on the wire
- mDNS discovery for automatic host detection
- WebSocket-based persistent connections
- Push config updates instantly
- Execute shell commands remotely
- Apply hardware profiles on-the-fly
- Trigger reboots with delay
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π οΈ HARDWARE PROFILES CATALOG β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β DISPLAYS β β SENSORS β β MOTORS β β HATs β
β β β β β β β β
β β’ OLED SSD1306 β β β’ BME280 β β β’ A4988 Stepper β β β’ Sense HAT β
β β’ TFT ILI9341 β β β’ DS18B20 β β β’ PCA9685 Servo β β β’ PiSugar UPS β
β β’ e-Paper β β β’ MPU-6050 β β β’ DC Motors β β β’ RTC DS3231 β
β β’ HDMI 4K β β β’ INA219 β β β’ Relays β β β’ Adafruit HAT β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β CAMERAS β β AUDIO β β NETWORKING β β GPIO β
β β β β β β β β
β β’ RPi Camera v2 β β β’ HiFiBerry DAC β β β’ CAN Bus β β β’ Distance β
β β’ USB UVC β β β’ I2S Microphoneβ β β’ RS-485 β β β’ Ultrasonic β
β β’ IR NightVisionβ β β’ PWM Speakers β β β’ LoRa β β β’ IR Sensors β
β β’ MIPI CSI β β β’ Bluetooth β β β’ nRF24L01 β β β’ Touch Sensors β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
| Category | Examples |
|---|---|
| π₯οΈ Display | OLED SSD1306, TFT ILI9341, e-Paper, HDMI 4K |
| ποΈ GPIO | Steppers (A4988), relays, servos (PCA9685), distance sensors |
| π‘οΈ Sensors | BME280, DS18B20, MPU-6050, INA219 |
| π· Camera | RPi Camera v2/HQ, USB UVC, IR night vision |
| π Audio | HiFiBerry DAC+, I2S MEMS microphone |
| π‘ Networking | CAN, RS-485, LoRa, nRF24L01 |
| π© HATs | Sense HAT, PiSugar UPS, RTC DS3231 |
# Quick interactive installation
meshpi hw quick-install --interactive
# Browse hardware catalog
meshpi hw catalog --category sensor --popular
# Apply to device groups
meshpi group create sensors
meshpi group add-device sensors pi@192.168.1.100
meshpi group hw-apply sensors sensor_bme280 sensor_ds18b20
# Remote management via SSH
meshpi ssh hw-apply --target pi@192.168.1.100 hat_sense
meshpi ssh hw-search oled --category displayNew Features:
- π― Quick Install Wizard - Interactive hardware selection and installation
- π Hardware Catalog - Browse and filter 49+ profiles with tags
- π₯ Device Groups - Batch operations on multiple devices
- π SSH Remote Management - Control hardware on remote devices
- π¨ Custom Profiles - Create and share your own hardware configurations
pip install "meshpi[llm]"
meshpi agent
> show me all online devices
> what's wrong with rpi-kitchen?
> enable OLED display on rpi-bedroom
> push new WiFi password to all devicesWorks with OpenAI, Anthropic, Ollama (local), Azure, Groq, and more.
meshpi diagCollects CPU load, memory, temperature, GPIO states, I2C scan, USB devices, WiFi signal, services, logs, and more.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π MESHPI MONITORING STACK β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β AUDIT LOGS β β PROMETHEUS β β ALERT ENGINE β β GRAFANA β
β β β β β β β β
β β’ JSONL Format β β β’ Metrics API β β β’ 9 Rules β β β’ Dashboards β
β β’ Operations β β β’ Time Series β β β’ Temperature β β β’ Visualization β
β β’ Device Events β β β’ Device Health β β β’ Memory β β β’ Historical β
β β’ Timestamps β β β’ System Stats β β β’ Offline β β β’ Alerting β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β β
βΌ βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π CENTRALIZED MONITORING β
β β
β β’ Real-time Metrics Collection β
β β’ Historical Data Storage β
β β’ Alert Notifications β
β β’ Visual Dashboards β
β β’ Fleet Health Overview β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
MeshPi includes built-in monitoring with Prometheus metrics, alerting, and audit logging:
# View audit log
meshpi audit
# Check alert status
meshpi alerts status
# Push OTA update
meshpi ota push --image ./image.img --devices rpi-001,rpi-002Features:
- π Audit Logging - All fleet operations logged to JSONL
- π Prometheus Metrics - CPU, memory, temperature, device count
- π¨ Alert Engine - 9 default rules (temperature, memory, offline, etc.)
- π OTA Updates - Staged rollout with A/B partition rollback
- π Grafana Dashboards - Pre-built visualization templates
Docker Monitoring Stack:
# Start with Prometheus + Grafana
docker compose --profile monitoring up
# Access endpoints
open http://localhost:7422/metrics # Prometheus metrics
open http://localhost:9090 # Prometheus UI
open http://localhost:3000 # Grafana (admin/meshpi)For air-gapped environments:
meshpi pendrive seed # Client: write public key to USB
meshpi pendrive export # Host: encrypt config to USB
meshpi pendrive apply # Client: apply config from USB# Core package
pip install meshpi
# With LLM agent support
pip install "meshpi[llm]"
# Development dependencies
pip install "meshpi[dev]"
# Everything
pip install "meshpi[all]"Requirements: Python 3.9+, Linux (host), Raspberry Pi OS (client)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π MESHPI INSTALLATION FLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ
β HOST PC β β CLIENT RPi β
β β β β
β meshpi config β β meshpi scan β
β β β β β β
β ~/.meshpi/ β β mDNS discovery β
β config.env β β β β
β β β RSA key exchangeβ
β meshpi host βββββββββββββββββββββββ β β
β β β Encrypted config β Apply settings β
β FastAPI API ββββββββββββββββββββββΆβ β β
β β β β Reboot β
β WebSocket β β β β
β β β β Ready! β
β Dashboard β β β
β β β β β
β mDNS Adv β β β
βββββββββββββββββββ βββββββββββββββββββ
β Persistent Connection
ββββββββββββββββββββββββββββββββββββββββββ
β MESHPI DAEMON β
β β
β β’ Diagnostics push (60s interval) β
β β’ Real-time commands β
β β’ Status updates β
β β’ Health monitoring β
ββββββββββββββββββββββββββββββββββββββββββ
| Command | Description |
|---|---|
meshpi config |
Interactive configuration wizard |
meshpi host |
Start host service (FastAPI + mDNS) |
meshpi scan |
Discover hosts, download config |
meshpi daemon |
Persistent WebSocket connection |
meshpi diag |
Show device diagnostics |
meshpi hw list |
List hardware profiles |
meshpi hw apply <id> |
Apply hardware profile |
meshpi agent |
Launch LLM management agent |
meshpi info |
Show local keys/config state |
meshpi pendrive * |
USB offline workflow |
MeshPi supports extensive configuration through environment variables. Copy .env.example to .env and customize.
# Host service
MESHPI_PORT=7422
MESHPI_BIND=0.0.0.0
# Client configuration
MESHPI_HOST_IP=localhost
MESHPI_HOST_PORT=7422
MESHPI_DEVICE_ID=meshpi-clientEnvironment variables with MESHPI_CFG_ prefix are automatically converted to config.env:
# WiFi
MESHPI_CFG_WIFI_SSID="MyNetwork"
MESHPI_CFG_WIFI_PASSWORD="MyPassword"
MESHPI_CFG_WIFI_COUNTRY="PL"
# SSH
MESHPI_CFG_RPI_USER="pi"
MESHPI_CFG_RPI_PASSWORD="raspberry"
MESHPI_CFG_SSH_ENABLE="yes"
# System
MESHPI_CFG_RPI_HOSTNAME="meshpi-node"
MESHPI_CFG_RPI_TIMEZONE="Europe/Warsaw"# LiteLLM configuration
LITELLM_MODEL=gpt-4o-mini
LITELLM_API_KEY=sk-...
LITELLM_API_BASE=https://api.openai.com/v1
# Alternative providers
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...See .env.example for all available variables including:
- Docker & Deployment: Port, binding, client settings
- Configuration: SSH, WiFi, hostname, hardware interfaces
- LLM Agent: Multiple provider support
- Testing: Test devices, SSH keys, timeouts
- Security: Key paths, crypto settings
- Monitoring: Log levels, file paths
For standardized documentation on device groups and hardware profiles, see:
- Complete Deployment Guide - Comprehensive step-by-step deployment guide
- Cheat Sheet - Quick reference commands and scenarios
- Standard Documentation - Complete guide to groups (devices) and profiles (OS/drivers)
- Standards Table - Quick reference table of all standards
- Hardware Group Management - Advanced group operations
- SSH Hardware Management - Remote hardware control
meshpi/
βββ test/ # Test scripts and utilities
β βββ batch-rpi-test.sh # Batch testing for multiple RPis
β βββ test-doctor.sh # Doctor functionality tests
β βββ test-enhanced-cli.sh # CLI feature tests
β βββ test-list.sh # List functionality tests
β βββ test-restart.sh # Restart functionality tests
β βββ test-ssh-host.sh # SSH host tests
β βββ test-ssh-scan-identify.sh # SSH scan tests
β βββ run-rpi-tests.sh # Main Docker test runner
βββ scripts/ # Tooling and utility scripts
β βββ diagnose-rpi.sh # Comprehensive RPi diagnostics
β βββ fix-rpi-meshpi.sh # Automated common issue fixes
β βββ monitor-repair.py # Real-time repair status monitor (Python)
β βββ project.py # Code analysis tool (Python)
β βββ remote-rpi-test.sh # Remote RPi testing via SSH
β βββ rpi-service-manager.sh # Service management
β βββ show-repair-status.py # Visual repair status display (Python)
βββ meshpi/ # Core Python package
βββ docker/ # Docker configurations
βββ docs/ # Documentation
βββ tests/ # Unit tests
# Clone and setup
git clone https://github.com/pyfunc/meshpi.git
cd meshpi
make venv
make dev
# Run tests
make test
# Build package
make build
# Publish to PyPI
make publish# Build image
docker build -t meshpi .
# Run host
docker run -p 7422:7422 meshpi
# Docker Compose
docker-compose up -d meshpi-hostApache License 2.0 - see LICENSE for details.
Tom Sapletta
π§ tom@sapletta.com
π’ Softreck - Embedded systems, IoT automation
- π¦ PyPI: pypi.org/project/meshpi
- π» GitHub: github.com/pyfunc/meshpi
- π Documentation: github.com/pyfunc/meshpi#readme
- π Issues: github.com/pyfunc/meshpi/issues
- π Sponsor: github.com/sponsors/pyfunc
Made with β€οΈ for the Raspberry Pi community
Apache License 2.0 - see LICENSE for details.
Created by Tom Sapletta - tom@sapletta.com