MQTT on BX310x module


#1

Hi,
I’m doing some tests with a BX3105 module (firmware rev. R1.3.0.201816011422.BX310x_1).
Now I’m trying MQTT communication, but I have a problem connect to a MQTT broker.
I’m using “test.mosquitto.org” test broker (ip address 37.187.106.16), but when I send a connect command a generic error appears after some seconds.
I report below the comand sequence of this test.
Unfortunately, the MQTT section of the AT command reference doc lacks the commands usage scenario.
Can you help me to understand the cause of this problem?
Thanks.
Best regards

==============================================================================

at+srwstacfg=“NETGEAR - 0”,“C5073…”,0
OK

+SRWSTANETCFG=0,“192.168.2.20”,“255.255.255.0”,“192.168.2.250”
OK

AT+SRWSTACON=1
OK

+SRWSTASTATUS: 1,“NETGEAR - 0”,“00:18:4d:b2:fb:36”,13,3

+SRWSTAIP: “192.168.2.20”,“255.255.255.0”,“192.168.2.250”

+KMQTTCFG=0,“37.187.106.16”,1883,4,“clientexample”

+KMQTTCFG: 1

OK

at+kmqttcnx=1

ERROR

==============================================================================


#2

Hi safabio,

I also tried to used mosquitto.org test broker but I haven’t managed to make it work yet (I even managed to make the chip crash!). Anyway, using part of the example provided in the AT reference document I’ve got a working sequence of commands :

AT+KMQTTCFG=0,"broker.hivemq.com",1883,4,"BX3105",60,0,0

+KMQTTCFG: 2

OK
AT+KMQTTCNX=2

OK
AT+KMQTTSUB=2,"sensor/#",0

OK

+KMQTTSUB: "sensor/humidity","25.00"

+KMQTTSUB: "sensor/temperature","24.00"

+KMQTTSUB: "sensor/temperature","27.00"

+KMQTTSUB: "sensor/humidity","28.00"

+KMQTTSUB: "sensor/temperature","25.00"

+KMQTTSUB: "sensor/humidity","31.00"

+KMQTTSUB: "sensor/humidity","18.00"

[...]

#3

Hi Frank,
thank for your reply.
Please, can you post also the commands that you use before the +kmqttcfg command (from the module power-up)?


#4

Yes, sure, here it is :

AT+SRWCFG=2,3
AT+SRWSTACFG="<SSID>","<PASSWORD>",0
AT+SRWSTACON=1

#5

Thanks Frank,
I tried, but I continue to get the error message.
I’ll try again …