๐ Zero-touch provisioning for Raspberry Pi fleets - Configure WiFi, SSH, users, hardware peripherals, and manage devices through encrypted mesh networking
Project description
๐ท MeshPi
Zero-Touch Raspberry Pi Fleet Management
๐ Configure WiFi, SSH, users, hardware peripherals, and manage devices through encrypted mesh networking
Install โข Quick Start โข Features โข Docs โข PyPI
๐ Overview
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
# 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.
๐ฑ Client Setup (Raspberry Pi)
๐ง Prerequisites Setup
Before running meshpi scan on your Raspberry Pi, follow these steps:
1. Connect to Internet
# Connect to WiFi using desktop interface or command line
sudo raspi-config
# Navigate to Network Options โ Wi-Fi โ Enter SSID and password
2. Update System
# Update package lists and upgrade system packages
sudo apt update && sudo apt upgrade -y
# Reboot after updates
sudo reboot
3. Install Python pip
# Install pip if not already installed
sudo apt install python3-pip python3-venv -y
# Verify installation
pip3 --version
4. Install MeshPi
# Install MeshPi package
pip3 install meshpi
# Or with LLM support for natural language commands
pip3 install "meshpi[llm]"
5. Run MeshPi Scan
# Discover and connect to MeshPi host
meshpi scan
๐ One-Liner Installation
For 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 scan
๐ What Happens During Scan
When 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
๐ ๏ธ Troubleshooting
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
โจ Features
๐ Encrypted Zero-Touch Provisioning
- RSA-2048 key exchange + AES-256-GCM encryption
- No shared secrets, no cleartext on the wire
- mDNS discovery for automatic host detection
๐ก Real-Time Fleet Management
- WebSocket-based persistent connections
- Push config updates instantly
- Execute shell commands remotely
- Apply hardware profiles on-the-fly
- Trigger reboots with delay
๐ง 49+ Hardware Profiles
| 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 |
# Apply multiple profiles in one command
meshpi hw apply oled_ssd1306_i2c sensor_bme280 gpio_stepper_arm69ak
๐ค LLM-Powered Agent
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 devices
Works with OpenAI, Anthropic, Ollama (local), Azure, Groq, and more.
๐ Full Diagnostics
meshpi diag
Collects CPU load, memory, temperature, GPIO states, I2C scan, USB devices, WiFi signal, services, logs, and more.
๐พ USB Offline Workflow
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
๐ฆ Installation
# 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)
๐๏ธ Architecture
HOST (PC / RPi) CLIENT (fresh RPi)
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ
meshpi config meshpi scan
โ ~/.meshpi/config.env โ mDNS discovery
meshpi host โ RSA key exchange
โ FastAPI REST API โ โ Encrypted config
โ WebSocket /ws/{id} โ โ Apply & reboot
โ mDNS advertisement
โ Dashboard /dashboard
โ
meshpi daemon
โ Diagnostics push (60s)
โ Real-time commands
๐ ๏ธ CLI Reference
| 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 |
๐งช Development
# 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
๐ณ Docker
# Build image
docker build -t meshpi .
# Run host
docker run -p 7422:7422 meshpi
# Docker Compose
docker-compose up -d meshpi-host
๐ License
Apache License 2.0 - see LICENSE for details.
๐ค Author
Tom Sapletta
๐ง tom@sapletta.com
๐ข Softreck - Embedded systems, IoT automation
๐ Links
- ๐ฆ 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
License
Apache License 2.0 - see LICENSE for details.
Author
Created by Tom Sapletta - tom@sapletta.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meshpi-0.1.15.tar.gz.
File metadata
- Download URL: meshpi-0.1.15.tar.gz
- Upload date:
- Size: 61.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8d3ee180240518abadc9cb895e6d098f877e7e7a9f79cfbe992e10c406f9e05
|
|
| MD5 |
7dc4faa92360dfe2842b89e8f0332d86
|
|
| BLAKE2b-256 |
561ca9132a31a11cfda2452b9406452e0a4043cc48ed75d87df15b1fcb78c7be
|
File details
Details for the file meshpi-0.1.15-py3-none-any.whl.
File metadata
- Download URL: meshpi-0.1.15-py3-none-any.whl
- Upload date:
- Size: 57.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07ee8431d6dc71e69aca33370050dbeb0c59ea69532ea52a9fe821b0c4f86900
|
|
| MD5 |
4640b8519f191f81bec89891efa8edfc
|
|
| BLAKE2b-256 |
33a62cc73f772c828a0b42a1a744a308dfb82b6e1ce6b39f44d44811b153373b
|