Skip to main content

The universal communication protocol combines the benefits of mqtt, with a bi-directional communication framework like WebSockets

Project description

Universal Communication Protocol (UCP)

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.

Architecture

  1. MQTT Broker (Fezzan):
    • Central hub for message routing using a publish/subscribe model.
  2. Device Agents:
    • Each device runs a Python agent to:
      • Subscribe to commands (ucl/commands/<device_id>).
      • Publish status updates (ucl/status/<device_id>).
  3. Connected Devices:
    • Example devices include:
      • Odin: MacBook Air for command processing.
      • Neue-Sanssouci: Orange Pi for edge computing.
      • Hildegard: Raspberry Pi for monitoring.

Features

  • 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.

Quick Start

1. Install the MQTT Broker

On Fezzan:

sudo apt install mosquitto mosquitto-clients
sudo systemctl enable mosquitto
sudo systemctl start mosquitto

2. Deploy the UCP Agents

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>

3. Test Communication

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>"

Topics

  • Commands: ucl/commands/<device_id> — Devices receive instructions.
  • Status: ucl/status/<device_id> — Devices send status and responses.
  • Broadcast: ucl/broadcast — System-wide updates.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ucp_framework-0.0.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ucp_framework-0.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file ucp_framework-0.0.1.tar.gz.

File metadata

  • Download URL: ucp_framework-0.0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for ucp_framework-0.0.1.tar.gz
Algorithm Hash digest
SHA256 497e11d95c3b1081c9b728b98f44f5aebf980abb83b3b20032a8290f8c307043
MD5 9e2a874cbf28142b56f2d2a47be23765
BLAKE2b-256 de53dcc6eece7f75e56d5bc5505853ae3e98eb74ec4feb82c5b4f0a6e25c4ba0

See more details on using hashes here.

File details

Details for the file ucp_framework-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ucp_framework-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for ucp_framework-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4301fbae4b3e9ae82483ec36cbd8ed52401cf9ffcfecb50216be1d5a3f820e6f
MD5 6004df069dd8b3a466156eb84c80c0a6
BLAKE2b-256 21e7e1a40ab8c3957aa98bc06cc9d50f7b62cdf2b698e709b98299f8d3954468

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page