Page 1 of 1

MQTT with Sim 7000C NB-IoT Network

Unread postPosted:Tue Dec 08, 2020 9:37 am
by najab.haider
I'm trying to use MQTT on Sim 7000C with NB-IoT Network
I can successfully configured my network with this command

AT+CNACT=1,"apn"

and get IP address with this command

AT+CNACT?

Then I'm trying to set parameters of MQTT like broker, port, user, password with these command

AT+SMCONF="URL","m21.cloudmqtt.com:19279"
AT+SMCONF="USERNAME", "user"
AT+SMCONF="PASSWORD", "pass"

But when I trying to establish MQTT connection with my broker with this command

AT+SMCONN

Module stuck and gives nothing.

What I'm doing wrong please any suggestion for me doing this?

Module firmware version: 1351B05SIM7000C

Re: MQTT with Sim 7000C NB-IoT Network

Unread postPosted:Wed Feb 24, 2021 1:53 am
by 347945801
I think you have used the wrong AT commands. I have not seen these commands in the manual or wiki.

Re: MQTT with Sim 7000C NB-IoT Network

Unread postPosted:Wed Apr 28, 2021 5:36 am
by najab.haider
Hi,

When I used this https://www.emqx.io/mqtt/public-mqtt5-broker public MQTT Broker with these set of commands without any Username and Password it worked for me.
But I can't use this in my production I don't have any option to use any broker without Username and Password authentication in my production. :(

Here is my commands with responses.
AT+SMSTATE?
+SMSTATE: 0
OK

AT+CSQ
+CSQ: 22,99

OK

AT+CGDCONT=1,"IP","APN"
OK

AT+CNACT=1,"APN"
OK

+APP PDP: ACTIVE

AT+SMCONF="URL","broker.emqx.io:1883"
OK

AT+SMCONF="CLIENTID","Device001"
OK

AT+SMCONF?
+SMCONF

CLIENTID: "Device001"
URL: broker.emqx.io:1883
KEEPTIME: 60
USERNAME: ""
PASSWORD: ""
CLEANSS: 0
QOS: 0
TOPIC: ""
MESSAGE: ""
RETAIN: 0

OK

AT+SMCONN
OK

AT+SMSUB="update",1
OK

AT+SMPUB="update","5",1,1

hello

OK

+SMSUB: "update","hello"

AT+SMPUB="update","8",1,1

HI Najaf

OK

+SMSUB: "update","HI Najaf"