BG95 MQTT Mosquitto

I am trying to connect to Mosquitto MQTT server without encryption but I am receiving an error when I try to connect. Any thoughts?

David

ATI

RCV:
**
Quectel
BG95-M3
Revision: BG95M3LAR02A03

OK
**

AT+COPS?

RCV:
**
+COPS: 0,0,“O2 - UK”,0

OK
**

AT+QMTCFG=“version”,3

RCV:
**
+QMTCFG: “version”,3

OK
**

AT+QMTOPEN=?

RCV:
**
+QMTOPEN: (0-5),“host_name”,(0-65535)

OK
**

AT+QMTOPEN=0,“test.mosquitto.org”,1883

RCV:
**
OK
**

AT+QMTOPEN?

RCV:
**
+QMTOPEN: 0,“test.mosquitto.org”,1883

OK
**

AT+QMTCONN=?

RCV:
**
+QMTCONN: (0-5),“clientID”[,“username”[,“password”]]

OK
**

AT+QMTCONN=0,“david122506152”,"",""

RCV:
**
ERROR
**

AT+QMTCONN=?

RCV:
**
+QMTCONN: (0-5),“clientID”[,“username”[,“password”]]

OK
**

AT+QMTSUB=?

RCV:
**
+QMTSUB: (0-5),**

AT+QMTSUB=0,1,“topic/example”,2

RCV:
**,list of [“topic”,qos]

OK
**

1 Like


See if this transaction makes any sense. I used the same server with no security to try the module out as well and on a PC I can get the messages if i subscribe to the topic.

Hi David,
One area I have tripped up on is the quotation characters “”. They are not always the same and interchangeable.

In your above code, you have two (2) different types.
AT+QMTCONN=0,“david122506152”,"",""
I think the type you need is the straight ones in my above 2nd line and what you have at the end of your qmtconn.
Not the open and close type like around your name.

Hi Samuel,

Thanks for your sample. I have it working now although I need to sort out timings in the code. Once I get it sorted I’ll post a solution.

David

Hi PPK,

I have the strings in code and I know that the strings wouldn’t show as a string with the wrong double quote. Perhaps that was a ‘feature’ of the copy paste I did. Thanks for responding.

David