[BG96 LTE-M MQTT] can open port, can't connect to the server

Hello.
I’m trying to connect to the cloudMQTT server.
I’m able to open port (you can see this on my logcat under).
Modem responds with ERROR when I m trying to connect.
What is wrong?
Please help.

AT

OK

ATE1

OK

AT+CMEE=2

OK

AT+CPIN?

+CPIN: READY

OK
AT+QCFG=“nwscanseq”,02,1

OK

AT+QCFG=“nwscanmode”,3,1

OK

AT+QCFG=“iotopmode”,0,1

OK

AT+QCFG=“band”,0000000F ,80000 ,1

OK

AT+CGDCONT=1,“IP”,“iot1”,

OK

AT+COPS=0

OK

AT+COPS=?

+COPS: (1,“Orange PL”,“Orange”,“26003”,0),(2,“Orange”,“Orange”,“26003”,8),(1,“T-Mobile.pl”,“TM PL”,“26002”,0),(1,“Plus”,“PLUS”,“26001”,0),(1,“Play”,“Play”,“26006”,0),(0,1,2,3,4),(0,1,2)

OK

AT+QNWINFO

+QNWINFO: “CAT-M1”,“26003”,“LTE BAND 20”,6200

OK

AT+CSQ

+CSQ: 17,99

OK
CSQ OK

AT+CREG?

+CREG: 0,1

OK

AT+QMTOPEN=0,“my.hostname.com”,12345

OK
AT+QMTOPEN?

+QMTOPEN: 0,“my.hostname.com”,12345

OK
AT+QMTCONN=0,“rob”,“mYusername”,“mYpassword”

ERROR

1 Like

hi,rab:
I recommend that you test your MQTT server using the MQTTt.fx tool
mqtt.fx tool:https://quectel123-my.sharepoint.cn/:u:/g/personal/ae-fae_dom_quectel_com_cn/EZeg69wHoXJBudSvdFHQZZsBmqyui9ovctcpt9KTE7SfqA?e=T0vznx

1 Like

Hi Herbert.pan-Q.
Thank you for response.
I can connect and send data to the server using mqtt.fx tool so server works fine.

I wonder if this command is correct:
“AT+QMTOPEN=0,“m20.cloudmqtt.com”,mYportnumber\r\n”
?

After 30 seconds modem responds:
+QMTOPEN: 0,4
so it is “Failed to parse domain name”

Also tried in another server but still nothing:
AT+QMTOPEN=1,“liveobjects.orange-business.com”,1883

OK

+QMTOPEN: 1,4

example:AT+QIDNSCFG=0,8.8.8.8,8.8.4.4

1 Like

Thanks again for your patient.

As BG96_TCP/IP_Application_Note_V1.2 says
before send this command: AT+QIDNSCFG=…
I need to SEND AT+QIACT first. But before AT+QIACT i need to send AT+QICSGP ? Is this true?

So I sent:
“AT+QICSGP=1,1,“m20.cloudmqtt.com”,“usrname”,“password”,0\r\n”
OK

but when:
AT+QIACT=1
ERROR

When I send AT+QMTOPEN=1,“liveobjects.orange-business.com”,1883 after ~15 seconds BG96 returns:

OK

+QMTOPEN: 1,2

and after next ~30 sec
+QMTOPEN: 1,4

I also try this:

AT+QMTOPEN=0,“90.84.189.238”,1883
OK
+QMTOPEN: 0,-1

and:
AT+QMTOPEN=0,“90.84.184.31”,1883
OK
+QMTOPEN: 0,-1

What about MQTT.fx? and is SSL secure mode required?

1 Like

I can connect and send data from MQTT.fx to liveobjects.orange-business.com and m20.cloudmqtt.com without any problems.
SSL mode is not required.

hi,rab:
How is your MQTT.FX configured? I have failed all the connections I have tested.

1 Like

You can try check your sim have registor network yet ?

1 Like

Hi, I m sorry for my absence.
The problem was in username…
Correct userame is: “json+device” insted of " json+device". There were one space between quote and “j”.
Thank you for all helpful hints! :slight_smile: