One machine listens as the server; other devices connect as clients. On a home or lab network, a Raspberry Pi is a convenient always-on server. OpenNet does not bypass routers, firewalls, captive portals, or internet service outages.
I like starting on loopback first because it separates application mistakes from Wi-Fi, certificates, and firewall rules. Once that works, move the exact same ONP/1 messages onto the real transport.
OpenNet supports Python 3.9 or newer on operating systems supported by Python. This includes current Raspberry Pi OS releases on Pi boards capable of running a supported Python version.
python -m pip install \
https://github.com/devkyato/OpenNet/releases/download/v0.2.0/opennet_protocol-0.2.0-py3-none-any.whl
opennet serveOn Windows, activate with .venv\Scripts\activate.
The default is loopback-only. Follow the security guide to configure verified or mutual TLS before exposing the service.
- Download the release ZIP.
- In Arduino IDE, choose Sketch > Include Library > Add .ZIP Library.
- Install Espressif's
esp32board package. - Open File > Examples > OpenNet > TelemetryClient.
- Set Wi-Fi name, password, and the server's LAN IP address.
- Select your exact ESP32 board and upload.
Call client.poll() frequently from loop(). OpenNet avoids blocking delays after
the TCP connection is established.
Clone the repository and open the folder in VS Code with PlatformIO installed. Build the included example:
pio run -e esp32devFor another project:
lib_deps =
https://github.com/devkyato/OpenNet.git#v0.2.0Topics describe what a value means:
client.sendText("lab/status", "online");
client.sendJson("lab/telemetry", "{\"temperature\":24.7}");
client.sendBinary("camera/chunk", bytes, byteCount);
client.sendInt("counter", 42);
client.sendDouble("voltage", 3.3);
client.sendBool("door/open", false);Validate incoming JSON against an application schema and bound binary payload sizes for the receiving device.
Continue with the step-by-step tutorials and development tips. When a server accepts more than one device, add topic authorization instead of treating a valid certificate as permission to use every topic.