Bridge mqtt <--> websocket
Project description
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=9095MQTT_HOST=localhostMQTT_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
- open in VSCode devcontainer, develop.
- use
invoketo 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_bridgeapp code.pip install ..dockerfolder contains dockerfiles for images..gitlab-ci.ymltakes care of the building steps.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rox_bridge-1.2.1.tar.gz.
File metadata
- Download URL: rox_bridge-1.2.1.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1565f776ae6c92ff19f142c3214af36f6bac51a22f6ebf1963f19ad4d31569a6
|
|
| MD5 |
16236bbfae2752238f2e803fc2a6cbed
|
|
| BLAKE2b-256 |
174cfcf39bfc3f465aedb4584645532c02170461cba380f195c0b89c57473219
|
File details
Details for the file rox_bridge-1.2.1-py3-none-any.whl.
File metadata
- Download URL: rox_bridge-1.2.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5339f0ac6a6b5a67726269e2d10094212ebf7f58ca07b8b72ab789273f1db017
|
|
| MD5 |
7cb1f7042321b6e7db7d831de7b0a582
|
|
| BLAKE2b-256 |
300d538dd18a36f173a2c48dc934bb1a983d4fd15f1266df732401ccb9b64ddf
|