New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with bridging mosquitto MQTT broker to AWS IoT #2889
Comments
It's slightly hard to follow the configuration due to all the formatting. But since you obviously have intermittment connections / disconnections, one typical suspect in such behaviour is using the same clientid for multiple connections. Guessing here since there isn't much to walk on. (no logs) Are you by any chanse using the same config somewhere else? |
Thank you for commenting Here is the complete configuration: connection awsiot topic $aws/things/+/shadow/update out 1 bridge_protocol_version mqttv311 cleansession true allow_anonymous true bridge_cafile /etc/mosquitto/certs/rootCA.pem 1. How to make clientid dynamic for each connection |
I haven't used AWS IoT and I don't know your setup requirements, so i cannot give an exact answer on how to make it dynamic, that said; just changing the If the clientid is checked in the cert, then you'd have to generate another set of cert / keys and have |
Thank you for the response. Same clientid for more than one instance was one of the reason. It also seems that issue was due to MQTT version. I updated MQTT version from 3.1.1. to 5.0 and now its working |
A Mosquitto MQTT broker bridged to AWS IoT have been made using the information provided on
https://aws.amazon.com/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/
The configuration, I am using for my mosquitto MQTT broker is as follows:
============================================================
Bridge to AWS IOT
============================================================
connection awsiot
#<Paste your AWS IoT Core ATS endpoint retrieved from the AWS CLI in the form of xxxxxxxxxxxxxxx-ats.iot..amazonaws.com:8883
address a3fu7wrc8e12x7-ats.iot.us-east-1.amazonaws.com:8883
Specifying which topics are bridged and in what fashion
topic $aws/things/+/shadow/update out 1
topic $aws/things/+/bytepayload/update out 1
topic $aws/things/+/shadow/update/delta in 1
Setting protocol version explicitly
bridge_protocol_version mqttv311
bridge_insecure false
Bridge connection name and MQTT client Id, enabling the connection automatically when the broker starts.
cleansession true
clientid bridgeawsiot
start_type automatic
notifications false
log_type all
#Adding broker config
allow_anonymous true
listener 1883
============================================================
Certificate based SSL/TLS support
============================================================
#Path to the rootCA
bridge_cafile /etc/mosquitto/certs/rootCA.pem
Path to the PEM encoded client certificate
bridge_certfile /etc/mosquitto/certs/cert.crt
Path to the PEM encoded client private key
bridge_keyfile /etc/mosquitto/certs/private.key
#END of bridge.conf
The issues I am facing in the mosquitto MQTT broker are:
1. While publishing messages through mosquitto broker to AWS IoT, some of the messages are getting published on AWS IoT but at the same time, some of the messages are not getting published on AWS IoT.
2. Mosquitto broker is getting frequently disconnected from the AWS IoT.
Please help me to resolve this issue.
The text was updated successfully, but these errors were encountered: