Pico LAN Gateway Node — UDP Discovery, HTTP Proxy & Metrics with W5500 (MicroPython)
MicroPython LAN gateway node on Raspberry Pi Pico + W5500. UDP auto-discovery, access rules, HTTP proxy, basic metrics. Lightweight IoT edge gateway. 2025 new.
Overview
This project implements a LAN gateway node on the Raspberry Pi Pico + WIZnet W5500 using MicroPython. It provides four key functions for small network segments: UDP-based automatic device discovery, configurable access rules, an HTTP proxy, and basic network metrics collection. Designed as a lightweight edge IoT gateway, it enables simple traffic control and visibility in home lab or embedded network environments.
Key Features
- UDP auto-discovery — devices on the LAN can discover the gateway automatically via broadcast
- Access rules — configurable policies for which traffic is allowed through the proxy layer
- HTTP proxy — forwards HTTP requests from LAN clients, enabling gateway-controlled internet access
- Basic metrics — collects and reports simple network usage statistics
- MicroPython — all logic in Python, making it easy to modify and extend without C compilation
Hardware
- Board: Raspberry Pi Pico (RP2040)
- Ethernet: WIZnet W5500 module (SPI)
- Language: MicroPython
- Connection: RJ45 via W5500 module
How to Set Up
- Clone:
git clone https://github.com/HIre-Me-For-Unique-Stratergies/pico-lan-gateway-node - Flash MicroPython firmware on Raspberry Pi Pico (latest stable)
- Install W5500 MicroPython driver (urequests-compatible Ethernet library)
- Copy project files to Pico via Thonny or
mpremote - Configure network settings (IP, access rules) in the config file
- Connect W5500 module and RJ45 cable
FAQ
Q1. Why use MicroPython for a gateway instead of C? MicroPython enables rapid prototyping and easy customization. For a gateway node handling moderate traffic in a home lab or IoT segment, the Python overhead is acceptable and the development speed advantage is significant. More demanding production gateways would use C/C++.
Q2. What is UDP auto-discovery used for? Devices on the LAN can send a broadcast UDP probe to discover the gateway's IP address without manual configuration. This is useful for plug-and-play IoT sensors that need to find a gateway dynamically.
Q3. What kind of access rules are supported? The access rules provide basic allow/deny logic based on client address or destination. This is not a full firewall, but enables simple traffic filtering appropriate for embedded edge gateway use cases.
Key Takeaway
This MicroPython gateway node on W5500 + Pico shows how much networking functionality can be packed into a tiny, scriptable embedded system. UDP discovery, HTTP proxy, and metrics collection make it a practical starting point for building custom IoT edge gateways without complex C firmware development.
Source Code: https://github.com/HIre-Me-For-Unique-Stratergies/pico-lan-gateway-node
