|
3 | 3 |  |
4 | 4 |
|
5 | 5 | [](https://github.com/devkyato/OpenNet/actions/workflows/ci.yml) |
| 6 | +[](https://github.com/devkyato/OpenNet/releases) |
6 | 7 | [](LICENSE) |
7 | 8 | [](docs/protocol.md) |
8 | 9 |
|
9 | | -OpenNet is a small, typed messaging protocol and library for sending JSON, text, |
10 | | -numbers, and arbitrary binary data between ESP32 devices, Raspberry Pi computers, |
11 | | -and backend services over Wi-Fi or Ethernet. |
| 10 | +OpenNet is a dependency-free typed messaging protocol for direct communication |
| 11 | +between ESP32 devices, Raspberry Pi computers, and backend services. It sends |
| 12 | +JSON, text, signed integers, finite doubles, booleans, null, and arbitrary binary |
| 13 | +data over TCP/TLS or another reliable ordered stream. |
| 14 | + |
| 15 | +Version 0.1.1 is an alpha release for real projects and learning. It has a |
| 16 | +documented wire format, bounded resource use, retries and duplicate suppression, |
| 17 | +native Arduino protocol tests, Python tests across 3.9–3.14, reproducible release |
| 18 | +packages, measured local performance, and security guidance. It does not claim |
| 19 | +that a radio or internet route exists when the underlying hardware/network is |
| 20 | +unavailable. |
| 21 | + |
| 22 | +## Why OpenNet |
| 23 | + |
| 24 | +- One small API and one frame format across ESP32 and Python. |
| 25 | +- Typed values without a JSON dependency for every scalar or binary payload. |
| 26 | +- Optional application ACKs, retry with stable message IDs, and bounded |
| 27 | + duplicate suppression. |
| 28 | +- TCP/TLS over Wi-Fi, Ethernet, or routed networks. |
| 29 | +- Generic Arduino `Stream` support for UART, USB serial, and Bluetooth Classic |
| 30 | + SPP on compatible ESP32 hardware. |
| 31 | +- Strict control frames, CRC-32 corruption detection, payload limits, bounded |
| 32 | + queues, connection limits, and partial transport-write handling. |
| 33 | +- CLI tools to serve, send, ping, and benchmark. |
| 34 | +- Arduino IDE, PlatformIO/VS Code, Python, Linux/systemd, and security tutorials. |
| 35 | + |
| 36 | +## Install |
| 37 | + |
| 38 | +Python wheel from the release page: |
| 39 | + |
| 40 | +```sh |
| 41 | +python -m pip install \ |
| 42 | + https://github.com/devkyato/OpenNet/releases/download/v0.1.1/opennet_protocol-0.1.1-py3-none-any.whl |
| 43 | +opennet --version |
| 44 | +``` |
| 45 | + |
| 46 | +For an isolated command: |
12 | 47 |
|
13 | | -The first release deliberately targets one dependable path: an ESP32 client and a |
14 | | -Python 3.9+ client/server communicating over TCP. The wire format is documented and |
15 | | -language-neutral, so additional transports and language bindings can be added |
16 | | -without inventing incompatible message formats. |
| 48 | +```sh |
| 49 | +pipx install \ |
| 50 | + https://github.com/devkyato/OpenNet/releases/download/v0.1.1/opennet_protocol-0.1.1-py3-none-any.whl |
| 51 | +``` |
17 | 52 |
|
18 | | -## What it provides |
| 53 | +For Raspberry Pi/Linux, extract `OpenNet-linux-0.1.1.tar.gz` and run |
| 54 | +`sudo ./install.sh`. It creates a hardened, unprivileged systemd service with a |
| 55 | +loopback-only default. For Arduino IDE, install `OpenNet-0.1.1.zip` through |
| 56 | +**Sketch > Include Library > Add .ZIP Library**. |
19 | 57 |
|
20 | | -- A compact binary frame with versioning, message IDs, type information, CRC-32, |
21 | | - and a 16 MiB defensive payload limit. |
22 | | -- JSON, UTF-8 text, signed integers, IEEE-754 doubles, booleans, null, and raw bytes. |
23 | | -- Async Python client/server APIs for Raspberry Pi and backend systems. |
24 | | -- An Arduino-compatible ESP32 client with reconnect, heartbeat, and delivery ACKs. |
25 | | -- Optional TLS at the transport layer. |
26 | | -- Arduino IDE, PlatformIO, Python, and VS Code examples. |
27 | | -- Protocol conformance tests and cross-platform CI. |
| 58 | +The Python distribution is installable with pip, but v0.1.1 is distributed from |
| 59 | +GitHub Releases rather than the public PyPI index. |
28 | 60 |
|
29 | | -## Five-minute start |
| 61 | +## Five-minute local test |
30 | 62 |
|
31 | | -Run the Python server: |
| 63 | +Terminal one: |
32 | 64 |
|
33 | | -```bash |
34 | | -python -m pip install -e "./python[dev]" |
35 | | -opennet-server --host 0.0.0.0 --port 8765 |
| 65 | +```sh |
| 66 | +opennet serve --echo |
36 | 67 | ``` |
37 | 68 |
|
38 | | -Install this repository as an Arduino library, open |
39 | | -`File > Examples > OpenNet > TelemetryClient`, set the Wi-Fi credentials and |
40 | | -server address, then upload it to an ESP32. |
| 69 | +Terminal two: |
41 | 70 |
|
42 | | -Python clients are equally small: |
| 71 | +```sh |
| 72 | +opennet ping --count 5 |
| 73 | +opennet send sensor/temperature 24.7 --type float |
| 74 | +opennet send device/state '{"online":true}' --type json |
| 75 | +opennet benchmark --count 1000 --payload-size 64 |
| 76 | +``` |
| 77 | + |
| 78 | +Python code is equally small: |
43 | 79 |
|
44 | 80 | ```python |
45 | 81 | import asyncio |
46 | 82 | from opennet import OpenNetClient |
47 | 83 |
|
48 | 84 | async def main(): |
49 | | - async with OpenNetClient("192.168.1.50", 8765) as client: |
50 | | - await client.send("temperature", {"celsius": 24.7}) |
| 85 | + async with OpenNetClient("127.0.0.1") as client: |
| 86 | + message_id = await client.send( |
| 87 | + "lab/temperature", 24.7, retries=2 |
| 88 | + ) |
| 89 | + print("acknowledged", message_id) |
51 | 90 |
|
52 | 91 | asyncio.run(main()) |
53 | 92 | ``` |
54 | 93 |
|
55 | | -See the [getting-started guide](docs/getting-started.md), [protocol |
56 | | -specification](docs/protocol.md), and [compatibility policy](docs/compatibility.md). |
57 | | - |
58 | | -## Project status |
59 | | - |
60 | | -OpenNet is pre-1.0 software. ONP/1 framing is stable for the v0.x series, while |
61 | | -higher-level APIs may improve based on real hardware feedback. Do not represent |
62 | | -untested boards or operating systems as supported; add a compatibility report when |
63 | | -you test one. |
64 | | - |
65 | | -## Contributing |
66 | | - |
67 | | -Student contributions are welcome. Good first tasks are labeled in the issue |
68 | | -tracker, and every feature should include tests or a reproducible hardware test |
69 | | -report. Read [CONTRIBUTING.md](CONTRIBUTING.md) and the |
70 | | -[code of conduct](CODE_OF_CONDUCT.md) before opening a pull request. |
71 | | - |
72 | | -## Security |
73 | | - |
74 | | -CRC detects accidental corruption; it is not encryption or authentication. Use TLS |
75 | | -on untrusted networks. See [SECURITY.md](SECURITY.md) for the threat model and |
76 | | -private reporting instructions. |
77 | | - |
78 | | -## License |
79 | | - |
80 | | -OpenNet is available under the [MIT License](LICENSE). |
| 94 | +The CLI defaults to loopback and refuses remote plaintext unless it is explicitly |
| 95 | +allowed for a trusted development network. Use verified TLS—and mutual TLS when |
| 96 | +device identity matters—outside isolated local testing. |
| 97 | + |
| 98 | +## Evidence and design |
| 99 | + |
| 100 | +- [Measured TCP/TLS and 20-client load results](docs/benchmarks.md) |
| 101 | +- [Comparison with raw TCP, MQTT, WebSocket, and HTTP](docs/comparison.md) |
| 102 | +- [Architecture, ACK retry, and defensive boundaries](docs/architecture.md) |
| 103 | +- [Actual GitHub adoption counters and analytics limits](docs/adoption-analytics.md) |
| 104 | +- [Transport support, including Bluetooth boundaries](docs/transports.md) |
| 105 | + |
| 106 | +Measured loopback results are software baselines, not invented Wi-Fi or hardware |
| 107 | +claims. Hardware field reports are welcome through the |
| 108 | +[compatibility process](docs/compatibility.md). |
| 109 | + |
| 110 | +## Learn and build |
| 111 | + |
| 112 | +- [Tutorials](docs/tutorials.md) |
| 113 | +- [CLI reference](docs/cli.md) |
| 114 | +- [Linux/Raspberry Pi service guide](docs/linux-service.md) |
| 115 | +- [Getting started](docs/getting-started.md) |
| 116 | +- [Development tips](docs/tips.md) |
| 117 | +- [Security guide](docs/security.md) |
| 118 | +- [ONP/1 protocol specification](docs/protocol.md) |
| 119 | +- [Contributing](CONTRIBUTING.md) |
| 120 | + |
| 121 | +Student contributions are welcome. Good changes include a reproducible test, |
| 122 | +clear documentation, or a complete compatibility report. OpenNet follows |
| 123 | +[Semantic Versioning](https://semver.org/) and is licensed under the |
| 124 | +[MIT License](LICENSE). |
0 commit comments