This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

MQTT Sample code is not connecting

The sample code at ncs/nrf/samples/nrf9160/mqtt_simple is not connecting. I dod not make any changes to the ode. I am using NB-IoT. LTE is connected. The link monitor, LTE is in green. The error code is ERROR: mqtt_connect -60

Kindly advice to resolve this

Parents
  • ** Booting Zephyr OS build v2.4.0-ncs1  ***Flash regionsDomainPermissions00 00 0x00000 0x08000 Securerwxl01 31 0x08000 0x100000 Non-SecurerwxlNon-secure callable region 0 placed in flash region 0 with size 32.SRAM regionDomainPermissions00 07 0x00000 0x10000 Securerwxl08 31 0x10000 0x40000 Non-SecurerwxlPeripheralDomainStatus00 NRF_P0               Non-SecureOK01 NRF_CLOCK            Non-SecureOK02 NRF_RTC0             Non-SecureOK03 NRF_RTC1             Non-SecureOK04 NRF_NVMC             Non-SecureOK05 NRF_UARTE1           Non-SecureOK06 NRF_UARTE2           SecureSKIP07 NRF_TWIM2            Non-SecureOK08 NRF_SPIM3            Non-SecureOK09 NRF_TIMER0           Non-SecureOK10 NRF_TIMER1           Non-SecureOK11 NRF_TIMER2           Non-SecureOK12 NRF_SAADC            Non-SecureOK13 NRF_PWM0             Non-SecureOK14 NRF_PWM1             Non-SecureOK15 NRF_PWM2             Non-SecureOK16 NRF_PWM3             Non-SecureOK17 NRF_WDT              Non-SecureOK18 NRF_IPC              Non-SecureOK19 NRF_VMC              Non-SecureOK20 NRF_FPU              Non-SecureOK21 NRF_EGU1             Non-SecureOK22 NRF_EGU2             Non-SecureOK23 NRF_DPPIC            Non-SecureOK24 NRF_GPIOTE1          Non-SecureOK25 NRF_REGULATORS       Non-SecureOKSPM: NS image at 0xc000SPM: NS MSP at 0x20024d28SPM: NS reset vector at 0xee79SPM: prepare to jump to Non-Secure image.*** Booting Zephyr OS build v2.4.0-ncs1  ***The MQTT simple sample startedLTE Link Connecting ...+CEREG: 2,"FFFE","FFFFFFFF",7,0,0,"11100000","11100000"+CEREG: 0,"FFFE","FFFFFFFF",7,0,0,"11100000","11100000"+CEREG: 2,"00D8","003AC006",9,0,0,"11100000","11100000"+CSCON: 1+CEREG: 5,"00D8","003AC006",9,,,"11100000","11100000"LTE Link Connected!IPv4 Address found 198.41.30.194ERROR: mqtt_connect -60+CSCON: 0AT+CPSMS?+CPSMS: 0OK+CSCON: 1+CSCON: 0+CSCON: 1+CSCON: 0+CSCON: 1+CSCON: 0+CSCON: 1+CSCON: 0+CSCON: 1+CSCON: 0+CSCON: 1+CSCON: 0+CSCON: 1+CSCON: 0+CSCON: 1+CSCON: 0+CEREG: 5,"FFFE","FFFFFFFF",9,,,"11100000","11100000"+CEREG: 5,"00D8","003AC006",9,,,"11100000","11100000"+CSCON: 1+CSCON: 0+CEREG: 5,"FFFE","FFFFFFFF",9,,,"11100000","11100000"+CEREG: 5,"00D8","003AC006",9,,,"11100000","11100000"+CSCON: 1+CSCON: 0*** Booting Zephyr OS build v2.4.0-ncs1  ***Flash regionsDomainPermissions00 00 0x00000 0x08000 Securerwxl01 31 0x08000 0x100000 Non-SecurerwxlNon-secure callable region 0 placed in flash region 0 with size 32.SRAM regionDomainPermissions00 07 0x00000 0x10000 Securerwxl08 31 0x10000 0x40000 Non-SecurerwxlPeripheralDomainStatus00 NRF_P0               Non-SecureOK01 NRF_CLOCK            Non-SecureOK02 NRF_RTC0             Non-SecureOK03 NRF_RTC1             Non-SecureOK04 NRF_NVMC             Non-SecureOK05 NRF_UARTE1           Non-SecureOK06 NRF_UARTE2           SecureSKIP07 NRF_TWIM2            Non-SecureOK08 NRF_SPIM3            Non-SecureOK09 NRF_TIMER0           Non-SecureOK10 NRF_TIMER1           Non-SecureOK11 NRF_TIMER2           Non-SecureOK12 NRF_SAADC            Non-SecureOK13 NRF_PWM0             Non-SecureOK14 NRF_PWM1             Non-SecureOK15 NRF_PWM2             Non-SecureOK16 NRF_PWM3             Non-SecureOK17 NRF_WDT              Non-SecureOK18 NRF_IPC              Non-SecureOK19 NRF_VMC              Non-SecureOK20 NRF_FPU              Non-SecureOK21 NRF_EGU1             Non-SecureOK22 NRF_EGU2             Non-SecureOK23 NRF_DPPIC            Non-SecureOK24 NRF_GPIOTE1          Non-SecureOK25 NRF_REGULATORS       Non-SecureOKSPM: NS image at 0xc000SPM: NS MSP at 0x20024d28SPM: NS reset vector at 0xee85SPM: prepare to jump to Non-Secure image.*** Booting Zephyr OS build v2.4.0-ncs1  ***The MQTT simple sample startedLTE Link Connecting ...+CEREG: 2,"FFFE","FFFFFFFF",7,0,0,"11100000","11100000"AT+CFUN=1OKAT+CFUN?+CFUN: 1OK+CEREG: 0,"FFFE","FFFFFFFF",7,0,0,"11100000","11100000"+CEREG: 2,"00D8","003AC006",9,0,0,"11100000","11100000"+CSCON: 1+CEREG: 5,"00D8","003AC006",9,,,"11100000","11100000"LTE Link Connected!IPv4 Address found 198.41.30.194id & port: ERROR: mqtt_connect -60+CSCON: 0
    

    This is tghe log of the terminal 

  • The server details - www.beavernews.net Port - 9999. Topic name - data/upload . Message format - (001,941,1755,1726,25300,32.69,0,1710) 

    I used a mobile app https://play.google.com/store/apps/details?id=com.sanyamarya.mqtizermqtt_client  , set the SIM for IPv6 only and we were able to see the data being  posted. The data can be  viewed at http://www.beavernews.net:8090/rawData 

  • Hi,

    The server details - www.beavernews.net Port - 9999

    That domain doesn't support ipv6. Only the ipv4 address is returned:

    $ nslookup www.beavernews.net
    Server:		127.0.0.53
    Address:	127.0.0.53#53
    
    Non-authoritative answer:
    Name:	www.beavernews.net
    Address: 64.111.109.81
    

     

    Please google "ipv6 dns lookup" for online resolvers to verify if your broker has ipv6.

     

    Kind regards,

    Håkon

      

    Kind regards,

    Håkon

Reply Children
No Data
Related