Skip to main content

๐Ÿš€ 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

Python PyPI Downloads CI Status Coverage License Code Style

๐Ÿš€ 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:

  1. ๐Ÿ” Discover Host - Uses mDNS to find MeshPi hosts on your network
  2. ๐Ÿ”‘ Key Exchange - Generates RSA key pair and exchanges with host
  3. ๐Ÿ” Download Config - Receives encrypted configuration
  4. โš™๏ธ Apply Settings - Configures WiFi, SSH, users, locale
  5. ๐Ÿ”„ 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


โฌ† Back to Top

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meshpi-0.1.19.tar.gz (76.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meshpi-0.1.19-py3-none-any.whl (73.3 kB view details)

Uploaded Python 3

File details

Details for the file meshpi-0.1.19.tar.gz.

File metadata

  • Download URL: meshpi-0.1.19.tar.gz
  • Upload date:
  • Size: 76.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for meshpi-0.1.19.tar.gz
Algorithm Hash digest
SHA256 16c63abbb7f41ed3210ee699f7cbbe10cb974a223c824206a905345e48c3ef4b
MD5 af9dc5c88ea522a2a979d6020c1a3926
BLAKE2b-256 13926952db2ca99c03d02d5f9dcf7978b67e4efeca24970c6660d7385c12cd1b

See more details on using hashes here.

File details

Details for the file meshpi-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: meshpi-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 73.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for meshpi-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 db914c1fd3af3861a474cd2ce17460952b2559830493ad49ff095bef82323695
MD5 6e6f042777e0ffcab60fea4295ef4002
BLAKE2b-256 53a42fd389b2d2944f5d630ced16350e9e7b966a643f8af5a82365e2e88f3d44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page