Skip to main content

mqtt-bridge

Bridge mqtt <--> websocket

Docker image:

docker run --network=host registry.gitlab.com/roxautomation/components/mqtt-bridge

Configuration

override these environment variables if desired

  • WS_PORT=9095
  • MQTT_HOST=localhost
  • MQTT_PORT=1883

How it works

  • web ui connects to websocket. It then subscibes to topics or publishes data.
  • messages are forwarded between websocket and mqtt.

Note current implementation is quite simple, there is in distinction between topic subscriptions from clients. All clients will receive all subscriptions.

Protocol

The protocol is subset of rosbridge protocol

  • subscribe {"op":"subscribe", "topic":<string>}"
  • publish {"op":"publish", "topic": <string>, "msg":<json>}

Development

  1. open in VSCode devcontainer, develop.
  2. use invoke to lint, build etc.

Testing

There are a lot of moving parts here (mqtt broker, websockets etc.). It is a lot of work to implement descent tests using pytest for this. Therefore we rely more on integration tests located in integration folder. These tests simulate a system consisting of a bridge and mqtt and ws clients.

Tooling

  • Verisoning : bump2version
  • Linting and formatting : ruff
  • Typechecking: mypy

What goes where

  • src/rox_bridge app code. pip install . .
  • docker folder contains dockerfiles for images.
  • .gitlab-ci.yml takes care of the building steps.

Metadata

Release files for rox-bridge 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rox-bridge 1.2.1
File Size Uploaded
rox_bridge-1.2.1.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rox-bridge 1.2.1
File Interpreter ABI Platform
rox_bridge-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.5 kB

Release files / rox_bridge-1.2.1.tar.gz

Download URL rox_bridge-1.2.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1565f776ae6c92ff19f142c3214af36f6bac51a22f6ebf1963f19ad4d31569a6
BLAKE2b-256 checksum
How to use checksums
174cfcf39bfc3f465aedb4584645532c02170461cba380f195c0b89c57473219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release files / rox_bridge-1.2.1-py3-none-any.whl

Download URL rox_bridge-1.2.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5339f0ac6a6b5a67726269e2d10094212ebf7f58ca07b8b72ab789273f1db017
BLAKE2b-256 checksum
How to use checksums
300d538dd18a36f173a2c48dc934bb1a983d4fd15f1266df732401ccb9b64ddf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page