A configurable Raspberry Pi gateway that turns physical GPIO inputs into UDP messages and UDP commands into GPIO output actions. It includes a browser-based configuration and diagnostics interface.
- Nine configurable GPI channels; BCM 17, 27, 22, 23, and 24 enabled by default
- Dry-contact inputs to GND with internal pull-ups, debounce, and retrigger lockout
- Per-input UDP destination, port, and message
- Four configurable GPO channels with pulse, on, off, and toggle commands
- Optional source-IP restriction per output
- GPIO collision validation across inputs and outputs
- Live state, counters, last results, and a 250-entry event log
- Persistent JSON configuration without committing site-specific addresses
- Rotating 5 MB log with five backups
- systemd service and installer
On Raspberry Pi OS:
git clone https://github.com/sogorman/Raspberry-PI-GPIO-Network-Server.git
cd Raspberry-PI-GPIO-Network-Server
sudo ./install.shThen browse to http://PI-IP:8080.
Useful commands:
sudo systemctl status pi-gpio-network-gateway
sudo systemctl restart pi-gpio-network-gateway
sudo journalctl -u pi-gpio-network-gateway -fThe default listener is UDP port 5005. With GPO 1 enabled, these defaults are available:
GPO1
GPO1 ON
GPO1 OFF
GPO1 TOGGLE
GPO1 pulses the output for 250 ms. Commands and pulse times are editable in the GUI.
Inputs default to active-low with the Pi's pull-up enabled:
GPIO ---- dry-contact switch ---- GND
GPIO outputs are 3.3 V logic and must not directly drive relays, lamps, or other substantial loads. Use a suitable transistor/MOSFET/relay driver with flyback protection where applicable.
Runtime configuration is stored at /opt/pi-gpio-network-gateway/config.json. The real configuration is ignored by Git; config.example.json contains safe defaults.
Environment overrides:
PI_GPIO_GATEWAY_CONFIGPI_GPIO_GATEWAY_LOGPI_GPIO_GATEWAY_MOCK_GPIO=1for development without Raspberry Pi hardware
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
PI_GPIO_GATEWAY_MOCK_GPIO=1 python app.pyThe server intentionally binds its web interface to all interfaces. Use a trusted network or firewall rules; it has no built-in authentication.