This project simulates a realistic embedded system gateway using Python, gRPC, and Protocol Buffers. It models how a mobile/cloud application communicates with a connected embedded product through a gateway — a pattern commonly used in IoT systems (e.g., smart homes, industrial sensors).
- gRPC Server simulating an embedded gateway
- gRPC Client simulating a cloud or mobile app
- Protobuf messages for structured, binary-compatible communication
- Supports RPCs for:
- Setting configuration (e.g., sample rate, WiFi)
- Controlling hardware (e.g., light on/off)
- Getting status
- Streaming telemetry (temperature, humidity)
- Conversion to serialized binary data (e.g., for UART transmission)
+---------------------+
| gRPC Client (Pi) | ← Simulates mobile/cloud
+---------------------+
│
▼
+---------------------+
| gRPC Server (PC) | ← Simulates embedded gateway
| (Logs + Streaming) |
+---------------------+
│
▼
[ Protobuf Binary (UART) ]
.
├── client.py # gRPC client script
├── server.py # gRPC server script
├── protos/
│ └── gateway.proto # Protobuf schema
├── gateway_pb2.py # Auto-generated from .proto (after build)
├── gateway_pb2_grpc.py # Auto-generated from .proto (after build)
├── logs/
│ └── gateway.log # Runtime logs
├── LICENSE # MIT license
├── .gitignore # Git ignored files
└── README.md # You're here!
python -m venv venv
source venv/bin/activate
pip install grpcio grpcio-tools
python -m grpc_tools.protoc \
-I protos \
--python_out=. \
--grpc_python_out=. \
protos/gateway.proto
python server.py
In a new terminal (while server is running):
python client.py
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to fork, open issues, or submit pull requests!