Skip to content

PiWiFiAP is a .NET 9 solution for Raspberry Pi that enables users to easily configure WiFi via an AP hotspot and QR code. When offline, the device starts an access point, displays a QR code, and serves a local web portal for WiFi setup. All configuration is template-driven and platform-aware, making first-time or headless setup seamless.

License

maker-community/PiWiFiAP

Repository files navigation

🌐 ApWifi

Smart WiFi Configuration for Raspberry Pi

.NET Raspberry Pi License Status

Seamlessly configure WiFi on your Raspberry Pi through an intuitive web interface with automatic AP hotspot fallback

πŸ‡ΊπŸ‡Έ English β€’ πŸ‡¨πŸ‡³ δΈ­ζ–‡θ―΄ζ˜Ž β€’ πŸ“– Documentation β€’ 🀝 Contributing β€’ πŸš€ Quick Start


πŸš€ Quick Start

ApWifi is a robust .NET 9 solution designed for Raspberry Pi devices that transforms WiFi configuration into a seamless experience. When your device is offline, it automatically creates an access point named "RaspberryPi5-WiFiSetup", displays an interactive QR code on your SPI screen, and serves a beautiful web interface for WiFi setup.

Tested on Raspberry Pi 5, compatible with other Raspberry Pi models

✨ Key Benefits

  • πŸ”„ Zero-touch setup - Automatic fallback to AP mode when offline
  • πŸ“± Mobile-friendly - Scan QR code with any smartphone
  • 🌍 Multi-language - Support for 5+ languages with auto-detection
  • 🎨 Modern UI - Responsive design that works on all devices
  • πŸ”§ Production ready - Thoroughly tested on real hardware

πŸ“Έ Screenshots

πŸ”Œ Offline Mode - QR Code Display

QR Code Display

Device automatically displays QR code on SPI screen when no network is available

πŸ“± WiFi Configuration Interface

English Interface
πŸ‡ΊπŸ‡Έ English Interface
Chinese Interface
πŸ‡¨πŸ‡³ Chinese Interface

βœ… Configuration Success

Success English
πŸ”„ Restarting (English)
Success Chinese
πŸ”„ Restarting (Chinese)

🌐 Connected State

Connected State

After successful connection, device displays its IP address on the SPI screen



πŸ“š Table of Contents

⭐ Features

πŸ”₯ Core Functionality

  • βœ… Auto AP Hotspot - Creates "RaspberryPi5-WiFiSetup" network
  • βœ… QR Code Display - Rendered via SkiaSharp on SPI screen
  • βœ… Responsive Web UI - Beautiful, mobile-optimized interface
  • βœ… System Integration - Direct WiFi configuration via OS commands
  • βœ… Auto Restart - Seamless transition to configured network

🌟 Advanced Features

  • βœ… Multi-language - English, Chinese, German, French, Japanese
  • βœ… Hardware Integration - .NET IoT libraries for SPI displays
  • βœ… Configuration Management - Liquid templates & JSON config
  • βœ… Production Ready - Thoroughly tested on Raspberry Pi 5
  • βœ… Auto-detection - Smart language and network detection

🎯 How It Works

graph TD
    A[πŸ”Œ Device Starts] --> B{🌐 Network Available?}
    B -->|No| C[πŸ“‘ Create AP Hotspot<br/>RaspberryPi5-WiFiSetup]
    B -->|Yes| D[βœ… Show IP Address<br/>on SPI Screen]
    C --> E[πŸ“± Display QR Code<br/>on SPI Screen]
    E --> F[🌍 User Scans QR Code<br/>Opens Web Interface]
    F --> G[βš™οΈ User Enters WiFi<br/>Credentials]
    G --> H[πŸ’Ύ Save Configuration<br/>to System]
    H --> I[πŸ”„ Automatic Reboot]
    I --> D
Loading

πŸ“Ά Network Disconnected Mode

  • πŸš€ Device automatically starts "RaspberryPi5-WiFiSetup" AP hotspot
  • πŸ–₯️ QR code is rendered using SkiaSharp and displayed on SPI screen
  • 🌐 Local web server runs on AP network for configuration

πŸ”§ WiFi Configuration Process

  • πŸ“± Mobile-optimized web interface with real-time validation
  • 🌍 Auto-language detection with support for 5+ languages
  • ⚑ Instant feedback and error handling

βœ… Post-Configuration

  • πŸ’Ύ WiFi settings written directly to system configuration
  • πŸ”„ Automatic reboot to apply network changes
  • πŸ“‘ Connects to specified WiFi and displays IP address on screen

πŸ› οΈ Tech Stack & Requirements

πŸ’» Core Technologies

.NET C# SkiaSharp IoT

πŸ“‹ Requirements

Component Specification Status
Platform Raspberry Pi (all models) βœ… Compatible
Tested On Raspberry Pi 5 βœ… Verified
OS Raspberry Pi OS (64-bit) βœ… Verified
Runtime .NET 9 SDK βœ… Required
Display SPI-connected screen βœ… Supported
Libraries .NET IoT + SkiaSharp βœ… Included
Permissions Root access for network ops ⚠️ Required

πŸ§ͺ Tested Environment

  • Primary Hardware: Raspberry Pi 5 (ARM64)
  • Compatibility: All Raspberry Pi models with compatible OS
  • Operating System: Raspberry Pi OS 64-bit
  • Display: SPI-connected screen with .NET IoT drivers
  • Graphics: SkiaSharp rendering engine
  • Networks: Various WiFi configurations tested

πŸš€ Installation & Deployment

πŸ’» Development Setup

# Clone the repository
git clone https://github.com/maker-community/PiWiFiAP.git
cd PiWiFiAP

# Build the project
dotnet build

# Run locally (for development)
dotnet run --project ApWifi.App/ApWifi.App.csproj

πŸ”§ Production Deployment

πŸ“¦ Step 1: Build for ARM64
# Create optimized build for Raspberry Pi
dotnet publish ApWifi.App/ApWifi.App.csproj \
  -c Release \
  -r linux-arm64 \
  --self-contained \
  -o ./publish
πŸ“€ Step 2: Upload to Raspberry Pi
# Using SCP (replace with your Pi's IP)
scp -r ./publish pi@192.168.1.100:/home/pi/ApWifi

# Or use FileZilla, WinSCP, or similar tools
# Target directory: /home/pi/ApWifi
βš™οΈ Step 3: Configure Auto-start Service
# SSH into your Raspberry Pi
ssh pi@192.168.1.100

# Create systemd service
sudo nano /etc/systemd/system/apwifi-app.service

# Enable and start the service
sudo systemctl enable apwifi-app.service
sudo systemctl start apwifi-app.service

# Check status
sudo systemctl status apwifi-app.service

πŸ“– Detailed instructions: See scripts/README.md


🀝 Contributing

We welcome contributions! Here's how you can help make ApWifi even better:

Issues Pull Requests Contributors

🎯 Ways to Contribute

  • πŸ› Report bugs or suggest features via Issues
  • 🌍 Add translations for new languages
  • πŸ“– Improve documentation
  • πŸ”§ Submit pull requests with enhancements
  • ⭐ Star the project if you find it useful!

πŸ“ License

This project is licensed under the MIT License - see the LICENSE.txt file for details.


πŸ’¬ Support & Community

Found this project helpful? Give it a ⭐!

GitHub stars GitHub forks


Questions? Issues? Ideas?

πŸ’¬ Start a Discussion β€’ πŸ› Report a Bug β€’ πŸ“§ Contact


Made with ❀️ for the Raspberry Pi community

About

PiWiFiAP is a .NET 9 solution for Raspberry Pi that enables users to easily configure WiFi via an AP hotspot and QR code. When offline, the device starts an access point, displays a QR code, and serves a local web portal for WiFi setup. All configuration is template-driven and platform-aware, making first-time or headless setup seamless.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published