The Universal Communication Protocol (UCP) is a lightweight, scalable communication framework built on MQTT. It enables real-time, bidirectional communication between devices, making it ideal for IoT, distributed systems, and collaborative device networks.
- MQTT Broker (Fezzan):
- Central hub for message routing using a publish/subscribe model.
- Device Agents:
- Each device runs a Python agent to:
- Subscribe to commands (
ucl/commands/<device_id>
). - Publish status updates (
ucl/status/<device_id>
).
- Subscribe to commands (
- Each device runs a Python agent to:
- Connected Devices:
- Example devices include:
- Odin: MacBook Air for command processing.
- Neue-Sanssouci: Orange Pi for edge computing.
- Hildegard: Raspberry Pi for monitoring.
- Example devices include:
- Lightweight: Minimal resource usage with MQTT.
- Real-Time: Instant messaging and responses.
- Scalable: Easily add devices and expand functionality.
- Modular: Independent device operation through dynamic topics.
On Fezzan:
sudo apt install mosquitto mosquitto-clients
sudo systemctl enable mosquitto
sudo systemctl start mosquitto
Clone the repository and install dependencies:
git clone <repository_url>
cd ucp
pip install -r requirements.txt
Run the server or a client:
# Start the server
python main.py server
# Start a client
python main.py client <device_id>
Publish a test command:
mosquitto_pub -h <broker_ip> -t "ucl/commands/<device_id>" -m '{"action": "ping"}'
Subscribe to responses:
mosquitto_sub -h <broker_ip> -t "ucl/status/<device_id>"
- Commands:
ucl/commands/<device_id>
— Devices receive instructions. - Status:
ucl/status/<device_id>
— Devices send status and responses. - Broadcast:
ucl/broadcast
— System-wide updates.