Open RongTsai4Git opened 2 years ago
sudo apt install mosquitto-clients mosquitto
# /etc/modquitto/conf.d/{my-bridge}.config # Local log_type all port 1884 allow_anonymous false
password_file /etc/mosquitto/pwdfile.cfg
connection iothub-bridge address {iothub name}.azure-devices.net:8883 remote_username {iothub username} remote_password {SAS Token} remote_clientid {device id}
bridge_cafile /etc/ssl/certs/ca-certificates.crt
try_private false cleansession true start_type automatic bridge_protocol_version mqttv311 notifications false bridge_tls_version tlsv1.2
topic # out 0 devices/{device id}/messages/events/ devices/{device id}/messages/events/ topic # in 0 devices/{device id}/messages/devicebound/ devices/{device id}/messages/devicebound/
Tech reference mosquitto-bridge mosquitto-conf mosquitto-bridge-configuration how-mqtt-microsoft-azure-iot-hub-satish-pagare
Using below command to the configuration password file
For first: sudo mosquitto_passwd -c pwdfile.cfg {username}
After first: sudo mosquitto_passwd -b pwdfile.cfg {username} {password}
password_file /etc/mosquitto/pwdfile.cfg
Bridge
connection iothub-bridge address {iothub name}.azure-devices.net:8883 remote_username {iothub username} remote_password {SAS Token} remote_clientid {device id}
To find an available cert file by yourself
bridge_cafile /etc/ssl/certs/ca-certificates.crt
try_private false cleansession true start_type automatic bridge_protocol_version mqttv311 notifications false bridge_tls_version tlsv1.2
Bridge topic
topic # out 0 devices/{device id}/messages/events/ devices/{device id}/messages/events/ topic # in 0 devices/{device id}/messages/devicebound/ devices/{device id}/messages/devicebound/