2017-04-27 12:34 PM
SPWF04SC
MQTT Unable to connect to any MQTT Server
According
UM2114 User manual
In Section 6.54
AT+S.MQTTCONN=test.mosquitto.org,,,,,,,,,,,
AT-S.ERROR:111:Request failed
+WIND:87:MQTT Closed:0:0+WIND:87:MQTT Closed:0:0I have also test other mqtt server broker.hivemq.com
AT+S.MQTTCONN=broker.hivemq.com,,,,,,,,,,,
AT-S.ERROR:111:Request failed
+WIND:87:MQTT Closed:0:0+WIND:87:MQTT Closed:0:0The module have internet connection
AT+S.PING=5,,test.mosquitto.org
AT-S.Start:37.187.106.16AT-S.Reply:56:111AT-S.Reply:56:111AT-S.Reply:56:111AT-S.Reply:56:111AT-S.Reply:56:112AT-S.Stop:0:111AT-S.OKAnd i have test successfully the insecure and secure connection with computer software client MQTT.fx on port 1883 on both servers
broker.hivemq.com
test.mosquitto.org
I have test also with ips instead of hostname
35.157.21.220
37.187.106.16
AT+S.MQTTCONN=35.157.21.220,,,,,,,,,,,
AT-S.ERROR:111:Request failed
+WIND:87:MQTT Closed:0:0+WIND:87:MQTT Closed:0:0I have also test a full set of options both with dns name and ip
AT+S.MQTTCONN=35.157.21.220,1883,/,0,,,testId,60,15,0,/home/1,test
AT-S.ERROR:111:Request failed+WIND:87:MQTT Closed:0:0+WIND:87:MQTT Closed:0:0
I have also successfully connect with other module esp8266 and esp32 secure with TLS @ port 8883 and insecure
on both servers above.
Would you please provide some help ..
Thanks in advance.
Solved! Go to Solution.
2017-04-28 02:50 AM
Hi,
MQTT client is built on top of websockets. Please check brokers option (if it accepts websocket clients) and port (if not specified, module will use 1883).
Mosquitto accepts websockets on 8080 (currently down...), Hivemq on 8000 (connection succeeds).
Example: at+s.mqttconn=broker.hivemq.com,8000,/mqtt,0,,,SPWF04SA,60,15,0,testwilltopic,hello hello my last will
BR
j
2017-04-28 02:50 AM
Hi,
MQTT client is built on top of websockets. Please check brokers option (if it accepts websocket clients) and port (if not specified, module will use 1883).
Mosquitto accepts websockets on 8080 (currently down...), Hivemq on 8000 (connection succeeds).
Example: at+s.mqttconn=broker.hivemq.com,8000,/mqtt,0,,,SPWF04SA,60,15,0,testwilltopic,hello hello my last will
BR
j
2017-04-29 08:02 AM
Thank you very much for your quick and accurate response.
2017-08-03 01:32 AM
Hi
I have managed to connect to the hivemq.com broker, with the example presented above.
But I can’t publish a mqtt messages using: AT+S.MQTTPUB=0,panduro,1,1,8<cr>hello world
AT+S.MQTTPUB=0,panduro,1,1,8
If I send 8 bytes, I get:
AT-S.ERROR:111:Request failed
+WIND:87:MQTT Closed:0:0
If I only try to send 7 bytes I don’t get any reply, until I send the last byte, and the I get the same error as above.
I have tried using teraterm and putty for testing.
Hope anyone has an input, thanks..