A lightweight bridge that links the Mobilus Cosmo GTW and a target MQTT broker. It subscribes to MQTT topics on the Cosmo GTW and publishes them into a standard MQTT structure, making integration with external systems (e.g. Loxberry, Home Automation platforms) much easier.
- OpenSSL v3
- Mosquitto v2.x (v1.x optionally supported)
The moblink operates on 4 MQTT topics.
Subscription topics:
mobilus/devices/{deviceId}/state— current device state (emitted after a command is executed)mobilus/devices/{deviceId}/error— errors occurred during command executionmobilus/devices/{deviceId}/pending-command— received commands that are pending execution
Publish topics:
mobilus/devices/{deviceId}/command— for sending commands to a specific device
{deviceId} is an integer assinged by the Cosmo GTW
You can change the default root topic: mobilus to anything else by providing env ROOT_TOPIC.
By default, if no ENV vars are set, moblink connects to the Cosmo GTW Mosquitto broker and publishes translated messages to the corresponding topics. You can change this behavior by setting the appropriate ENV vars.
[ENV_VAR=value ...] ./moblink| Variable | Description |
|---|---|
MOBILUS_DSN |
DSN for Cosmo GTW (mqtt:// or mqtts://) |
MOBILUS_USERNAME |
Username for Cosmo GTW |
MOBILUS_PASSWORD |
Password for Cosmo GTW |
TARGET_DSN |
DSN for MQTT broker where messages should be published from Cosmo GTW |
ROOT_TOPIC |
Root MQTT topic that is appended for all topics |
MOBILUS_DSN="mqtts://mobilus:8883" \
MOBILUS_USERNAME="admin" \
MOBILUS_PASSWORD="admin" \
TARGET_DSN="mqtt://127.0.0.1:1883" \
ROOT_TOPIC="mobilus" \
./moblinkDownload the latest moblink-*.deb from the Releases and install it:
sudo apt install ./moblink-*.debAdjust config parameters in /etc/moblink.conf
Restart:
sudo systemctl restart moblinkAnd verify that it's running:
sudo systemctl status moblinkInstallation is performed on the Cosmo GTW via SSH. How to enable SSH access, you'll find here.
Once you login via SSH, you need to download and install the runtime by running:
wget --no-check-certificate -qO- https://raw.githubusercontent.com/piku235/mobilus-gtw-runtime/main/install.sh | shThen, you can install the moblink with this simple command:
/opt/jungi/bin/pkg install moblinkAdjust config parameters in /opt/jungi/etc/moblink.conf and start the service:
/etc/init.d/moblink startYou can inspect its logs by running:
logread -e moblinkDownload moblink-Linux.tar.gz from the Releases page and copy the files inside the package on your filesystem.
tar -xzvf moblink-Linux.tar.gz
cd moblink-LinuxThen, enable the moblink service and start it:
sudo systemctl daemon-reload
sudo systemctl enable moblink
sudo systemctl start moblinkAnd verify that it's running:
sudo systemctl status moblinkThis project uses CMake as its build system.
To build the project:
cmake -B build
cmake --build build