Bridge Mosquitto mqtt to hivemq

Intro

How to bridge a local mosquitto mqtt broker to a free hivemq cloud bridge

Debian installatie

apt-get install mosquitto

To install the package

Change the mosquitto config file /etc/mosquitto/mosquitto.conf

connection cloudmqtt
address <url>.hivemq.cloud:8883
topic # both 1
bridge_attempt_unsubscribe false
bridge_protocol_version mqttv311
notifications false
remote_username <hivemq_username>
remote_password <hivemq_password>
try_private false
bridge_capath /etc/ssl/certs/

You can add authentication to start mosquitto.conf

per_listener_settings true
allow_anonymous false
password_file /etc/mosquitto/mosquitto.users

And use the mosquitto_passwd command to create and add users to the file (it seems that you need to restart or reload mosquitto after changing password or adding users)

Richard