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.)?

  • west build -d build_nrf9160dk_nrf9160_ns -b nrf9160dk/nrf9160/ns --pristine -- -DCONFIG_COAP_SAMPLE_SERVER_HOSTNAME='"coap.me"' -DCONFIG_COAP_SAMPLE_RESOURCE='"hello"' -DSNIPPET="nrf91-modem-trace-uart"

    will enable the modem trace.

    coap.pcapng.gz

    (My modem uses currently LTE-M, in my experience in Europe, there is no difference according UDP, except that LTE-M has a lower latency.)

  • still facing 

    *** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
    *** Using Zephyr OS v3.7.99-ca954a6216c9 ***
    [00:00:00.389,739] <inf> coap_client_sample: The CoAP client sample started
    [00:00:00.389,770] <inf> coap_client_sample: Bringing network interface up and connecting to the network
    [00:00:00.723,083] <inf> coap_client_sample: Waiting for network connectivity
    [00:01:16.345,245] <wrn> nrf_modem_lib_netif: No IPv4 address given by the network
    [00:01:16.411,895] <inf> coap_client_sample: Network connectivity established
    [00:01:16.616,424] <inf> coap_client_sample: IPv4 Address found 134.102.218.18
    [00:01:16.616,729] <inf> coap_client_sample: Initializing CoAP client
    [00:01:16.618,347] <err> coap_client_sample: Failed to send request: -114
    [00:01:16.618,347] <err> coap_client_sample: periodic_coap_request_loop, error: -114
    [00:01:16.618,347] <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,295] <inf> coap_client_sample: The CoAP client sample started
    [00:00:00.253,326] <inf> coap_client_sample: Bringing network interface up and connecting to the network
    [00:00:00.584,411] <inf> coap_client_sample: Waiting for network connectivity
    [00:01:21.317,138] <wrn> nrf_modem_lib_netif: No IPv4 address given by the network
    [00:01:21.388,763] <inf> coap_client_sample: Network connectivity established
    [00:01:21.738,281] <inf> coap_client_sample: IPv4 Address found 134.102.218.18
    [00:01:21.738,555] <inf> coap_client_sample: Initializing CoAP client
    [00:01:21.740,173] <err> coap_client_sample: Failed to send request: -114
    [00:01:21.740,203] <err> coap_client_sample: periodic_coap_request_loop, error: -114
    [00:01:21.740,203] <err> coap_client_sample: Fatal error! Rebooting the device

  • I forgot to mention — I'm actually using the nRF9151 DK, not the nRF9160.

    From what I understand, the nRF9151 is fully compatible with the nrf9160dk_nrf9160_ns build target, and no changes to the configuration are required for this sample. Please correct me if I'm wrong.

  • west build -b nrf9151dk/nrf9151/ns --pristine -- -DCONFIG_COAP_SAMPLE_SERVER_HOSTNAME='"coap.me"' -DCONFIG_COAP_SAMPLE_RESOURCE='"hello"' -DSNIPPET="nrf91-modem-trace-uart" -DCONFIG_LTE_NETWORK_MODE_NBIOT=y

    (you may skip the -DCONFIG_LTE_NETWORK_MODE_NBIOT=y, I just add this to force my modem in NB-IoT mode.)

    coap-nbiot.pcapng.gz

    Edited: just in the case you're not common with using the modem trace and export capture in wireshark.

    Modem Trace, see DevAcademy - Modem Trace

    Export Captures, see Logs and IP Capturing ‐ How To Provide The Right Information - Wireshark.

  • From what I understand, the nRF9151 is fully compatible with the nrf9160dk_nrf9160_ns build target, and no changes to the configuration are required for this sample. Please correct me if I'm wrong.

    You're wrong. The upwards compatibility is AFAIK only about the AT cmds.

    Anyway, though zephyr is not only about the mcu or modem, it's about the board with the periphery, you should always use the specific board to build.  

Reply
  • From what I understand, the nRF9151 is fully compatible with the nrf9160dk_nrf9160_ns build target, and no changes to the configuration are required for this sample. Please correct me if I'm wrong.

    You're wrong. The upwards compatibility is AFAIK only about the AT cmds.

    Anyway, though zephyr is not only about the mcu or modem, it's about the board with the periphery, you should always use the specific board to build.  

Children
No Data
Related