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

Failure connecting to example.com while running sample: https_client

After programming the sample to my nRF9160 DK, I opened the terminal emulator and I observed the following messages:

1. HTTPS client sample started

2. Provisioning certificate

3. Waiting for network..OK

4. Connecting to example.com

5. connect() failed, err 116

I am using the following:

1. nRFD9160 DK v0.8.2

2. Windows10 O.S. version:20H2, OS build:19042.631

3. nRF Connect v 3.7.0

4. nRF Connect SDK v 1.6.1

I attach the log file from the LTE Link Monitor below:

2021-09-04T19:59:12.600Z INFO Application data folder: C:\Users\Administrator\AppData\Roaming\nrfconnect\pc-nrfconnect-linkmonitor
2021-09-04T19:59:12.840Z DEBUG App pc-nrfconnect-linkmonitor v1.1.10 official
2021-09-04T19:59:12.840Z DEBUG App path: C:\Users\Administrator\.nrfconnect-apps\node_modules\pc-nrfconnect-linkmonitor
2021-09-04T19:59:12.840Z DEBUG nRFConnect 3.7.0, required by the app is (^3.6.0)
2021-09-04T19:59:12.840Z DEBUG nRFConnect path: C:\Users\Administrator\AppData\Local\Programs\nrfconnect\resources\app.asar
2021-09-04T19:59:12.841Z DEBUG HomeDir: C:\Users\Administrator
2021-09-04T19:59:12.841Z DEBUG TmpDir: C:\Users\ADMINI~1\AppData\Local\Temp
2021-09-04T19:59:13.059Z VERBOSE Could not fetch serial number for serial port at COM3
2021-09-04T19:59:20.249Z INFO Modem port is opened
2021-09-04T19:59:39.135Z DEBUG modem << *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
2021-09-04T19:59:39.395Z DEBUG modem << Flash regionsDomainPermissions
2021-09-04T19:59:39.399Z DEBUG modem << 00 01 0x00000 0x10000 Securerwxl
2021-09-04T19:59:39.404Z DEBUG modem << 02 31 0x10000 0x100000 Non-Securerwxl
2021-09-04T19:59:39.408Z DEBUG modem << Non-secure callable region 0 placed in flash region 1 with size 32.
2021-09-04T19:59:39.411Z DEBUG modem << SRAM regionDomainPermissions
2021-09-04T19:59:39.413Z DEBUG modem << 00 07 0x00000 0x10000 Securerwxl
2021-09-04T19:59:39.415Z DEBUG modem << 08 31 0x10000 0x40000 Non-Securerwxl
2021-09-04T19:59:39.418Z DEBUG modem << PeripheralDomainStatus
2021-09-04T19:59:39.422Z DEBUG modem << 00 NRF_P0               Non-SecureOK
2021-09-04T19:59:39.424Z DEBUG modem << 01 NRF_CLOCK            Non-SecureOK
2021-09-04T19:59:39.426Z DEBUG modem << 02 NRF_RTC0             Non-SecureOK
2021-09-04T19:59:39.428Z DEBUG modem << 03 NRF_RTC1             Non-SecureOK
2021-09-04T19:59:39.430Z DEBUG modem << 04 NRF_NVMC             Non-SecureOK
2021-09-04T19:59:39.436Z DEBUG modem << 05 NRF_UARTE1           Non-SecureOK
2021-09-04T19:59:39.439Z DEBUG modem << 06 NRF_UARTE2           SecureSKIP
2021-09-04T19:59:39.441Z DEBUG modem << 07 NRF_TWIM2            Non-SecureOK
2021-09-04T19:59:39.443Z DEBUG modem << 08 NRF_SPIM3            Non-SecureOK
2021-09-04T19:59:39.445Z DEBUG modem << 09 NRF_TIMER0           Non-SecureOK
2021-09-04T19:59:39.447Z DEBUG modem << 10 NRF_TIMER1           Non-SecureOK
2021-09-04T19:59:39.465Z DEBUG modem << 11 NRF_TIMER2           Non-SecureOK
2021-09-04T19:59:39.469Z DEBUG modem << 12 NRF_SAADC            Non-SecureOK
2021-09-04T19:59:39.471Z DEBUG modem << 13 NRF_PWM0             Non-SecureOK
2021-09-04T19:59:39.473Z DEBUG modem << 14 NRF_PWM1             Non-SecureOK
2021-09-04T19:59:39.475Z DEBUG modem << 15 NRF_PWM2             Non-SecureOK
2021-09-04T19:59:39.476Z DEBUG modem << 16 NRF_PWM3             Non-SecureOK
2021-09-04T19:59:39.478Z DEBUG modem << 17 NRF_WDT              Non-SecureOK
2021-09-04T19:59:39.480Z DEBUG modem << 18 NRF_IPC              Non-SecureOK
2021-09-04T19:59:39.481Z DEBUG modem << 19 NRF_VMC              Non-SecureOK
2021-09-04T19:59:39.483Z DEBUG modem << 20 NRF_FPU              Non-SecureOK
2021-09-04T19:59:39.487Z DEBUG modem << 21 NRF_EGU1             Non-SecureOK
2021-09-04T19:59:39.489Z DEBUG modem << 22 NRF_EGU2             Non-SecureOK
2021-09-04T19:59:39.491Z DEBUG modem << 23 NRF_DPPIC            Non-SecureOK
2021-09-04T19:59:39.493Z DEBUG modem << 24 NRF_REGULATORS       Non-SecureOK
2021-09-04T19:59:39.494Z DEBUG modem << 25 NRF_PDM              Non-SecureOK
2021-09-04T19:59:39.496Z DEBUG modem << 26 NRF_I2S              Non-SecureOK
2021-09-04T19:59:39.498Z DEBUG modem << 27 NRF_GPIOTE1          Non-SecureOK
2021-09-04T19:59:39.500Z DEBUG modem << SPM: NS image at 0x10000
2021-09-04T19:59:39.503Z DEBUG modem << SPM: NS MSP at 0x20019fb8
2021-09-04T19:59:39.504Z DEBUG modem << SPM: NS reset vector at 0x12b65
2021-09-04T19:59:39.506Z DEBUG modem << SPM: prepare to jump to Non-Secure image.
2021-09-04T19:59:39.508Z DEBUG modem << *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
2021-09-04T19:59:39.510Z DEBUG modem << HTTPS client sample started
2021-09-04T19:59:39.703Z DEBUG modem << Provisioning certificate
2021-09-04T20:09:50.981Z DEBUG modem << Waiting for network.. OK
2021-09-04T20:09:51.195Z DEBUG modem << Connecting to example.com
2021-09-04T20:09:51.360Z DEBUG modem << connect() failed, err: 116
2021-09-04T20:32:18.128Z DEBUG modem << *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
2021-09-04T20:32:18.148Z DEBUG modem << Flash regionsDomainPermissions
2021-09-04T20:32:18.153Z DEBUG modem << 00 01 0x00000 0x10000 Securerwxl
2021-09-04T20:32:18.162Z DEBUG modem << 02 31 0x10000 0x100000 Non-Securerwxl
2021-09-04T20:32:18.179Z DEBUG modem << Non-secure callable region 0 placed in flash region 1 with size 32.
2021-09-04T20:32:18.197Z DEBUG modem << SRAM regionDomainPermissions
2021-09-04T20:32:18.201Z DEBUG modem << 00 07 0x00000 0x10000 Securerwxl
2021-09-04T20:32:18.206Z DEBUG modem << 08 31 0x10000 0x40000 Non-Securerwxl
2021-09-04T20:32:18.208Z DEBUG modem << PeripheralDomainStatus
2021-09-04T20:32:18.211Z DEBUG modem << 00 NRF_P0               Non-SecureOK
2021-09-04T20:32:18.225Z DEBUG modem << 01 NRF_CLOCK            Non-SecureOK
2021-09-04T20:32:18.228Z DEBUG modem << 02 NRF_RTC0             Non-SecureOK
2021-09-04T20:32:18.230Z DEBUG modem << 03 NRF_RTC1             Non-SecureOK
2021-09-04T20:32:18.232Z DEBUG modem << 04 NRF_NVMC             Non-SecureOK
2021-09-04T20:32:18.234Z DEBUG modem << 05 NRF_UARTE1           Non-SecureOK
2021-09-04T20:32:18.236Z DEBUG modem << 06 NRF_UARTE2           SecureSKIP
2021-09-04T20:32:18.238Z DEBUG modem << 07 NRF_TWIM2            Non-SecureOK
2021-09-04T20:32:18.241Z DEBUG modem << 08 NRF_SPIM3            Non-SecureOK
2021-09-04T20:32:18.243Z DEBUG modem << 09 NRF_TIMER0           Non-SecureOK
2021-09-04T20:32:18.265Z DEBUG modem << 10 NRF_TIMER1           Non-SecureOK
2021-09-04T20:32:18.267Z DEBUG modem << 11 NRF_TIMER2           Non-SecureOK
2021-09-04T20:32:18.269Z DEBUG modem << 12 NRF_SAADC            Non-SecureOK
2021-09-04T20:32:18.270Z DEBUG modem << 13 NRF_PWM0             Non-SecureOK
2021-09-04T20:32:18.272Z DEBUG modem << 14 NRF_PWM1             Non-SecureOK
2021-09-04T20:32:18.273Z DEBUG modem << 15 NRF_PWM2             Non-SecureOK
2021-09-04T20:32:18.274Z DEBUG modem << 16 NRF_PWM3             Non-SecureOK
2021-09-04T20:32:18.275Z DEBUG modem << 17 NRF_WDT              Non-SecureOK
2021-09-04T20:32:18.288Z DEBUG modem << 18 NRF_IPC              Non-SecureOK
2021-09-04T20:32:18.291Z DEBUG modem << 19 NRF_VMC              Non-SecureOK
2021-09-04T20:32:18.292Z DEBUG modem << 20 NRF_FPU              Non-SecureOK
2021-09-04T20:32:18.293Z DEBUG modem << 21 NRF_EGU1             Non-SecureOK
2021-09-04T20:32:18.294Z DEBUG modem << 22 NRF_EGU2             Non-SecureOK
2021-09-04T20:32:18.297Z DEBUG modem << 23 NRF_DPPIC            Non-SecureOK
2021-09-04T20:32:18.301Z DEBUG modem << 24 NRF_REGULATORS       Non-SecureOK
2021-09-04T20:32:18.311Z DEBUG modem << 25 NRF_PDM              Non-SecureOK
2021-09-04T20:32:18.313Z DEBUG modem << 26 NRF_I2S              Non-SecureOK
2021-09-04T20:32:18.314Z DEBUG modem << 27 NRF_GPIOTE1          Non-SecureOK
2021-09-04T20:32:18.316Z DEBUG modem << SPM: NS image at 0x10000
2021-09-04T20:32:18.319Z DEBUG modem << SPM: NS MSP at 0x20019fb8
2021-09-04T20:32:18.321Z DEBUG modem << SPM: NS reset vector at 0x12b65
2021-09-04T20:32:18.323Z DEBUG modem << SPM: prepare to jump to Non-Secure image.
2021-09-04T20:32:18.332Z DEBUG modem << *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
2021-09-04T20:32:18.334Z DEBUG modem << HTTPS client sample started
2021-09-04T20:32:18.608Z DEBUG modem << Provisioning certificate
2021-09-04T20:44:24.909Z DEBUG modem << Waiting for network.. OK
2021-09-04T20:44:25.195Z DEBUG modem << Connecting to example.com
2021-09-04T20:44:25.389Z DEBUG modem << connect() failed, err: 116

  • Hello Jacek,

    I just want you to let you know that we are still investigating the issue. It turns out there was some problem with the modem database on my side, showing me errors in the modem trace that do not exist reality, so everything seems to be fine with your modem firmware image.

    Jacek Majda said:
    I then run again the sample: AT_Client, successfully.  I noticed that it took about 25 seconds from the time when the modem was switched ON by the command: AT+CFUN=1, before the connection to the NB-IoT network was made, as confirmed by the response to the  AT+CEREG? command, in the form of: +CEREG; 0,1,"5209","099F990D",9

    Right now we are assuming that this actually might be a timeout issue, maybe because of a slow network. But we have not been able to confirm this yet.

    I will keep you posted! In the meantime, could you please provide me with a complete application log from the Asset Tracker running on your device (from boot until connection to the nRF Cloud has been established and some data has been exchanged)?

    Thanks and regards,

    Markus

  • Hi Markus,

    As requested, I attach the application log from the Asset Tracker running on my device (from boot until connection to the nRF Cloud has been established and some data has been exchanged).

    Regards,

    Jacek

    2021-09-16 LTE Link Monitor log file.txt

  • Hello Jacek,

    I looks like the timeout is related to the modem trying to establish a TCP connection via port 443 (which is the HTTPS port number), but the server denies the request with a TCP RST (reset of TCP connection).

    May I ask you to check with your service provider, if they allow port 443?

    The Asset Tracker is running via MQTTS on port 8883, which explains why this application works on your device.

    Regards,

    Markus

  • Hello Markus,

    I just  received a confirmation from my service provider that:

    1. They don't block any ports on CSGN (C-SGN).

    2. They have confirmed from their core networks team all the way to the firewall that they are not blocking the port on the network side.

    They requested to be given the IP address I wish to connect this port on, in order to be able to investigate this problem further.

    Regards,

    Jacek

  • Hello Jacek,

    Jacek Majda said:

    I just  received a confirmation from my service provider that:

    1. They don't block any ports on CSGN (C-SGN).

    2. They have confirmed from their core networks team all the way to the firewall that they are not blocking the port on the network side.

    Thanks a lot for your feedback!

    Our modem team is quite confident that this issue is not caused by our modem, though. Some router in the path is blocking the TCP connection. The TCP RST packet has TTL 253, which would indicate the response is only two hops away. (Assuming TTL started at 255).

    You might want to try to connect to a different server? Certificate can be arranged as described here, in case conversion to PEM is necessary, it is described how to be done here.

    Regards,

    Markus

Related