Gemalto is now part of the Thales Group, find out more.

You are here

Issue connecting to MQTT broker | Thales IoT Developer Community

May 14, 2020 - 8:28pm, 1885 views

Hi,

I am trying to connect my pls62-w terminal (orange dev kit) to a hiveMQ MQTT broker using SocketTcp. I have written a basic driver for my microcontroller to send AT commands to the terminal using serial communication. I am able to initalise and config the modem to connect to the internet. However, every time I send a connect packet using SocketTcp, I am always presented with the following error.

^SIS: 1,0,48,"Remote peer has closed the connection"

^SISR: 1,2

The following is the commands I send in order to attemp to connect to hivemq broker. I am also using a serilisation MQTT lib by Paho to generate the MQTT packets. 

...........................................................................................................................

AT+CPIN?+CPIN: READY

OK

AT+CSQ+CSQ: 99,99

OK

AT+COPS?+COPS: 0,0,"vodafone UK",2

OK

AT+CGDCONT=1,"IP","wap.vodafone.co.uk"OK

AT+CGATT=1OK

AT^SICA=1,1OK

AT^SISX=HostByName,1,"broker.hivemq.com"^SISX: "HostByName", "18.196.144.22"

OK

AT^SISS=1,srvType,"Socket"OK

AT^SISS=1,conId,1OK

AT^SISS=1,"address","socktcp://18.196.144.22:8000;etx;autoconnect=1;connecttimeout=180"OK

AT^SISO=1OK

^SISW: 1,1

AT^sisi=1^SISI: 1,4,0,0,0,0

OK

at^sist=1CONNECT

OK

^SIS: 1,0,48,"Remote peer has closed the connection"

^SISR: 1,2

AT^sisi=1^SISI: 1,6,0,21,21,0

OK

AT^SISC=1OK

If I am missing anything, please let me know.

Many thanks

Kav