I have a Raspberry Pi in which I have installed Mosquitto broker and MQTT. Pi is connected to sensor and I need to send this data to Adafruit IoT protal. I am able to send all the data when the Pi is connected but when the Pi goes offline, I am only able to transmit data for 20-30 sec. If the Pi is offline for more than 2-3 mins then that data is not transmitted to portal.

I have created a bridge.conf file and add all the configurations to be used my Mosquitto. Here is the content:

connection iothub
address io.adafruit.com:1883
remote_username <username>
remote_password <password>
remote_clientid sensor1
bridge_cafile /etc/ssl/certs/ca-certificates.crt
try_private false
cleansession false
start_type automatic
bridge_insecure false
bridge_protocol_version mqttv311
bridge_tls_version tlsv1
notifications false
max_queued_messages 0
autosave_interval 5

topic # out 2 /sensors/sensor1
topic # in 2 /sensors/sensor1 

I have set the cleansession false and using QOS 2. I have also set max_queued_messages to 0 which means maximum. The problem I am facing is if the Pi is offline for just 1-2 mins, I am able to get all the offline data but if it is offline for more than 3-4 mins, I don't receive any data.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.