0

I was trying creating a bridge between the cloud broker (io.adafruit) and mosquitto broker which runs on my Raspberry Pi.
I have successfully tested the local mqtt connection whereas connecting to a cloud broker, I am unable to publish or subscribe to any topic.
I have made the following changes to mosquitto.conf file

connection adafruit
address io.adafruit.com:1883
remote_username xxxxxx
remote_password xxxxxx
start_type automatic
bridge_protocol_version mqttv311
notifications false
try_private true
bridge_insecure false
cleansession false
topic # both 0 

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

Logs during subscription using command mosquitto_sub -d -t mytopic

Client mosqsub|4306-raspberryp sending CONNECT
Client mosqsub|4306-raspberryp received CONNACK (0)
Client mosqsub|4306-raspberryp sending SUBSCRIBE (Mid: 1, Topic: mytopic, QoS: 0)
Client mosqsub|4306-raspberryp received SUBACK
Subscribed (mid: 1): 0

Logs during subscription using command mosquitto_pub -d -t mytopic -m 'Hello'

Client mosqpub|4333-raspberryp sending CONNECT
Client mosqpub|4333-raspberryp received CONNACK (0)
Client mosqpub|4333-raspberryp sending PUBLISH (d0, q0, r0, m1, 'mytopic', ... (5 bytes))
Client mosqpub|4333-raspberryp sending DISCONNECT

Please suggest where I am going wrong.

  • You cannot just subscribe to or publish to just any topic on Adafruit IO. The topic on Adafruit IO should always have the format *USERNAME/feeds/mytopic*. – StarCat Dec 18 '20 at 07:33
  • 1
    I’m voting to close this question because is has nothing to do with Electrical Engineering. – brhans Dec 18 '20 at 14:06
  • I am using topic in same format as suggested like username/feeds/mytopic but I guess problem is with conf file as it is not communicating with cloud broker, can you please suggest if anything I am doing wrong? – Rahul S Saksule Dec 19 '20 at 04:45
  • I really dont’t know how to help you with this particular setup. I’ve done something very similar with the help of my own Node-RED and a Mosquitto broker which allows for very flexible translation of MQTT messages back and forth between my own MQTT broker and Adafruit IO (in addition to many, many other useful things). I’ve stopped using Adafruit IO because I dont’t need it anymore. – StarCat Dec 20 '20 at 08:26

0 Answers0