Can't connect to MQTT broker


I’m trying to establish a TCP connection with the HiveMQ MQTT broker ( using the HL7802 module.
I have succesfully connected to a local PC but when i try to connect to an online broker (Hive MQ, Losant), i get a TCP connection error atco . Any ideas as to what i’m doing wrong?

Hi @hkiol

I can make the TCP connection successfully, according to your commands. Below is the log of my commands

17:51:45.036 on 01-Feb-2021> at+kcnxcfg=1,“GPRS”,“lp.fota.swir”
17:52:02.434 on 01-Feb-2021>
17:52:02.434 on 01-Feb-2021> OK
17:52:02.434 on 01-Feb-2021> at+ktcpcfg=1,0,“”,1883
17:52:04.500 on 01-Feb-2021>
17:52:04.500 on 01-Feb-2021> +KTCPCFG: 1
17:52:04.500 on 01-Feb-2021>
17:52:04.500 on 01-Feb-2021> OK
17:52:04.500 on 01-Feb-2021> at+ktcpcnx=1
17:52:07.493 on 01-Feb-2021>
17:52:07.505 on 01-Feb-2021> OK
17:52:07.505 on 01-Feb-2021>
17:52:07.505 on 01-Feb-2021> +KCNX_IND: 1,1,0
17:52:07.524 on 01-Feb-2021>
17:52:08.886 on 01-Feb-2021> +KTCP_IND: 1,1
17:52:08.886 on 01-Feb-2021>

Could you please help to send the below commands to get more information about the issue you faced:
- AT+KCNXCFG=1,“GPRS”,“your APN here”
- AT+KTCPCFG=1,0,“”,1883

1 Like

Thanks for the swift reply.
Here’s what i see:

So it connects but disconnects immediately.

Hi @hkiol,

According to your image, I observe that your device still does not connect to server “” successfully, it showed KTCP_NOTIF: 1,5 - TCP Connection error
The successful connection should be KTCP_IND: 1,1 as Donald’s above log.
I suspect that your device’s registered network cannot reach to the IP address “” via port 1883. Could you please help to check again?


1 Like

Hi @Donald ,

Which FW are you using for this test?

Hi @jyijyi,

I used the latest published FW for H7802: HL7802.

Please refer to below for more detail

16:26:49.564 on 02-Feb-2021>
16:26:49.564 on 02-Feb-2021> HL7802.4.6.6
16:26:49.564 on 02-Feb-2021> HL78xx.
16:26:49.593 on 02-Feb-2021> 2020/12/21 19:23:17
16:26:49.593 on 02-Feb-2021> IMEI-SV: 3594590900062613
16:26:49.593 on 02-Feb-2021> Legato RTOS: 18.09.6.ALT1250.rc4 2020/10/06 17:52:39
16:26:49.593 on 02-Feb-2021> atSwi: 42.00
16:26:49.593 on 02-Feb-2021> UBOOT: 01.03
16:26:49.593 on 02-Feb-2021> Apps: RKAPP_02_01_02_00_115__cf01697c56fbf87c1ff30fa676646f6cd010ca02
16:26:49.593 on 02-Feb-2021> MAC: ALT1250_02_01_02_00_112_2G
16:26:49.593 on 02-Feb-2021> PHY: 12.50.241281
16:26:49.594 on 02-Feb-2021> PMP: 248903
16:26:49.594 on 02-Feb-2021> SBUB: 1
16:26:49.594 on 02-Feb-2021> SBFW: 1
16:26:49.594 on 02-Feb-2021> RPuK: 53F7A48A
16:26:49.594 on 02-Feb-2021> FPuK: 139A8E70
16:26:49.594 on 02-Feb-2021> RBUB: 0
16:26:49.594 on 02-Feb-2021> RBFW: 0
16:26:49.594 on 02-Feb-2021>
16:26:49.594 on 02-Feb-2021> OK
16:26:49.594 on 02-Feb-2021> ATI3
16:26:49.611 on 02-Feb-2021>
16:26:49.611 on 02-Feb-2021> HL7802.
16:26:49.611 on 02-Feb-2021>
16:26:49.611 on 02-Feb-2021> OK
16:26:49.611 on 02-Feb-2021> at+kcnxcfg=1,“GPRS”,“lp.fota.swir”
16:27:00.413 on 02-Feb-2021>
16:27:00.413 on 02-Feb-2021> OK
16:27:00.413 on 02-Feb-2021> at+ktcpcfg=1,0,“”,1883
16:27:02.991 on 02-Feb-2021>
16:27:02.991 on 02-Feb-2021> +KTCPCFG: 1
16:27:02.991 on 02-Feb-2021>
16:27:02.991 on 02-Feb-2021> OK
16:27:02.991 on 02-Feb-2021> at+ktcpcnx=1
16:27:05.496 on 02-Feb-2021>
16:27:05.519 on 02-Feb-2021> OK
16:27:05.519 on 02-Feb-2021>
16:27:05.519 on 02-Feb-2021> +KCNX_IND: 1,1,0
16:27:05.519 on 02-Feb-2021>
16:27:06.873 on 02-Feb-2021> +KTCP_IND: 1,1
16:27:06.873 on 02-Feb-2021>

@hkiol: Besides the checking about network policy, Could you please also give a try on this latest FW?


1 Like

Agree, better try with same FW.

I will check about the network policy as you suggested.
The FW i am running is 4.5.4, so i’ll get the latest one and try again.

Edit: I can’t find the version you mention.

Thanks guys/gals

Hi @hkiol,
This latest published FW was just released yesterday. You can upgrade FW for your module with FOTA method thorugh AirVantage.

If not, please wait a few days for this FW to be released on sierra source.


1 Like

Alright, i updated to The results are still the same.
I am contacting my carrier.


It was a carrier issue as you guys mentioned.