Help with CoAP Client Sample on nRF9160 DK Using Jio NB-IoT SIM

Hi Nordic team,

I'm using the nRF9160 DK with nRF Connect SDK v2.9.1, and trying to run the coap_client sample to send a GET request to the public CoAP test server at coap.me (IP: 134.102.218.18), targeting the resource path /hello.

I'm using a Jio NB-IoT SIM for LTE connectivity.

I’ve configured the sample as follows:

Enabled CONFIG_COAP_CLIENT=y

Set CONFIG_COAP_SERVER_HOSTNAME="coap.me"

Set CONFIG_COAP_SERVER_PORT=5683

Enabled CONFIG_LTE_LINK_CONTROL=y and CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

Using conn_mgr to establish the LTE connection before sending the CoAP request

I would like to ask:

Is there anything specific I need to change to get communication working with a CoAP server like coap.me?

Has anyone successfully used NB-IoT (especially with Jio SIM) to send CoAP requests over UDP?

Are there any known limitations or additional requirements for using NB-IoT for CoAP communication?

Thanks and regards,
Arun

Parents
  • Let me recommend:

    First check, if the modem registers successful to a network, e.g. enable the modem trace and use the cellular monitor.

    Does it register? If not, it's related to you SIM card and the available networks.

    > Has anyone successfully used NB-IoT (especially with Jio SIM) to send CoAP requests over UDP?

    Not with that SIM. With a couple of other SIMs, if there is a subscribed NB-IoT network reachable, it works. UDP is nothing special on that level. I use CoAP via cellular (nRF9160) for a couple of years. It's superior in terms of data-volume and energy, especially, if encryption is required, DTLS 1.2 CID does a good job (RFC9146, I'm one of the co-autors, so I'm biased).

  • Hi,

    My setup:

    • LTE network registration is successful

    • DNS resolution of coap.me works

    • IPv4 address is found

    • But the CoAP request fails with error: -114 (ENETUNREACH)

      Has anyone successfully sent UDP CoAP packets using any Indian NB-IoT SIM (Vodafone, BSNL, etc.)?

  • Your using NCS 2.9.1 and the "nrf/samples/net/coap_client"?

    You only modified the COAP_SAMPLE_SERVER_HOSTNAME and COAP_SAMPLE_RESOURCE?

    (CONFIG_LTE_AUTO_INIT_AND_CONNECT isn't longer valid for NCS 2.9.1).

    build with:

    west build -d build_nrf9160dk_nrf9160_ns -b nrf9160dk/nrf9160/ns --pristine -- -DCONFIG_COAP_SAMPLE_SERVER_HOSTNAME='"coap.me"' -DCONFIG_COAP_SAMPLE_RESOURCE='"hello"'

    log:

    *** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
    *** Using Zephyr OS v3.7.99-ca954a6216c9 ***
    [00:00:00.361,267] <inf> coap_client_sample: The CoAP client sample started
    [00:00:00.361,297] <inf> coap_client_sample: Bringing network interface up and connecting to the network
    [00:00:00.639,953] <inf> coap_client_sample: Waiting for network connectivity
    [00:00:04.856,750] <inf> coap_client_sample: Network connectivity established
    [00:00:11.097,595] <inf> coap_client_sample: Network connectivity lost
    [00:00:12.389,495] <err> coap_client_sample: getaddrinfo, error: -11
    [00:00:12.389,526] <err> coap_client_sample: Failed to resolve server name
    [00:00:12.389,556] <err> coap_client_sample: periodic_coap_request_loop, error: -11
    [00:00:12.389,556] <err> coap_client_sample: Fatal error! Rebooting the device.
    *** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
    *** Using Zephyr OS v3.7.99-ca954a6216c9 ***
    [00:00:00.253,875] <inf> coap_client_sample: The CoAP client sample started
    [00:00:00.253,906] <inf> coap_client_sample: Bringing network interface up and connecting to the network
    [00:00:00.532,379] <inf> coap_client_sample: Waiting for network connectivity
    [00:00:04.866,058] <inf> coap_client_sample: Network connectivity established
    [00:00:12.886,718] <inf> coap_client_sample: Network connectivity lost
    [00:00:15.669,952] <inf> coap_client_sample: Network connectivity established
    [00:00:16.224,029] <inf> coap_client_sample: IPv4 Address found 134.102.218.18
    [00:00:16.224,304] <inf> coap_client_sample: Initializing CoAP client
    [00:00:16.225,921] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:16.312,255] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:21.267,181] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:22.056,579] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:26.308,471] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:26.887,603] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:31.349,761] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:31.965,087] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:36.391,082] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:37.008,239] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:41.432,403] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:42.005,462] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:46.473,693] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:47.044,525] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:51.515,014] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:52.085,845] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:56.556,335] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:58.556,243] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:01:01.597,656] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:01:02.214,294] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:01:06.638,977] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:01:07.635,589] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world

Reply
  • Your using NCS 2.9.1 and the "nrf/samples/net/coap_client"?

    You only modified the COAP_SAMPLE_SERVER_HOSTNAME and COAP_SAMPLE_RESOURCE?

    (CONFIG_LTE_AUTO_INIT_AND_CONNECT isn't longer valid for NCS 2.9.1).

    build with:

    west build -d build_nrf9160dk_nrf9160_ns -b nrf9160dk/nrf9160/ns --pristine -- -DCONFIG_COAP_SAMPLE_SERVER_HOSTNAME='"coap.me"' -DCONFIG_COAP_SAMPLE_RESOURCE='"hello"'

    log:

    *** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
    *** Using Zephyr OS v3.7.99-ca954a6216c9 ***
    [00:00:00.361,267] <inf> coap_client_sample: The CoAP client sample started
    [00:00:00.361,297] <inf> coap_client_sample: Bringing network interface up and connecting to the network
    [00:00:00.639,953] <inf> coap_client_sample: Waiting for network connectivity
    [00:00:04.856,750] <inf> coap_client_sample: Network connectivity established
    [00:00:11.097,595] <inf> coap_client_sample: Network connectivity lost
    [00:00:12.389,495] <err> coap_client_sample: getaddrinfo, error: -11
    [00:00:12.389,526] <err> coap_client_sample: Failed to resolve server name
    [00:00:12.389,556] <err> coap_client_sample: periodic_coap_request_loop, error: -11
    [00:00:12.389,556] <err> coap_client_sample: Fatal error! Rebooting the device.
    *** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
    *** Using Zephyr OS v3.7.99-ca954a6216c9 ***
    [00:00:00.253,875] <inf> coap_client_sample: The CoAP client sample started
    [00:00:00.253,906] <inf> coap_client_sample: Bringing network interface up and connecting to the network
    [00:00:00.532,379] <inf> coap_client_sample: Waiting for network connectivity
    [00:00:04.866,058] <inf> coap_client_sample: Network connectivity established
    [00:00:12.886,718] <inf> coap_client_sample: Network connectivity lost
    [00:00:15.669,952] <inf> coap_client_sample: Network connectivity established
    [00:00:16.224,029] <inf> coap_client_sample: IPv4 Address found 134.102.218.18
    [00:00:16.224,304] <inf> coap_client_sample: Initializing CoAP client
    [00:00:16.225,921] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:16.312,255] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:21.267,181] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:22.056,579] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:26.308,471] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:26.887,603] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:31.349,761] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:31.965,087] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:36.391,082] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:37.008,239] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:41.432,403] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:42.005,462] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:46.473,693] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:47.044,525] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:51.515,014] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:52.085,845] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:00:56.556,335] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:00:58.556,243] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:01:01.597,656] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:01:02.214,294] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world
    [00:01:06.638,977] <inf> coap_client_sample: CoAP GET request sent sent to coap.me, resource: hello
    [00:01:07.635,589] <inf> coap_client_sample: CoAP response: code: 0x45, payload: world

Children
No Data
Related