What are the API's can be used to send and receive packets on NIDD in NRF9160

Hi. 

I'm using PDN example code on zephyr nrf sdk. Please take a look on below log. 

Can somebody help me to figure out what are the API can be used to send and receive packets on NIDD.

15:27:22.791 -> *** Booting Zephyr OS build v2.6.99-ncs1-2245-g35654ffa6d06  ***
15:27:22.824 -> PDN sample started
15:27:22.824 -> AT+CNEC
15:27:22.824 -> AT+CGEREP
15:27:22.824 -> PDN Init
15:27:22.824 -> lte_lc_init_and_connect
15:27:23.822 -> [00:00:00.241,027] <dbg> lte_lc.init_and_config: System mode (2) and preference (0) are already configured
15:27:26.051 -> [00:00:02.446,319] <dbg> lte_lc.at_handler: +CEREG notification: +CEREG: 2,"C084","003F7592",9
15:27:26.051 -> 
15:27:26.051 -> [00:00:02.446,563] <dbg> lte_lc_helpers.parse_cereg: Network registration status: 2
15:27:26.051 -> [00:00:02.446,594] <dbg> lte_lc_helpers.parse_cereg: LTE mode: 9
15:27:26.051 -> [00:00:02.702,606] <dbg> lte_lc.at_handler: +CSCON notification
15:27:27.049 -> notify +CGEV: ME PDN ACT 0,1

15:27:27.049 -> Event: PDP context 0 activated
15:27:27.049 -> lte_lc_init_and_connect
15:27:27.049 -> Default APN is #####
15:27:27.049 -> Created new PDP context 1
15:27:27.049 -> PDP context 1 configured: APN #####, Family IPV4V6
15:27:27.082 -> notify +CGEV: ME PDN ACT 1,1


15:27:27.082 -> Event: PDP context 1 activated
15:27:27.215 -> notify +CGEV: IPV6 0


15:27:27.215 -> Event: PDP context 0 IPv6 up
15:27:27.215 -> notify +CGEV: IPV6 1

15:27:27.215 -> Event: PDP context 1 IPv6 up
15:27:28.046 -> [00:00:04.457,611] <dbg> lte_lc.at_handler: +CEREG notification: +CEREG: 1,"C084","003F7592",9,,,"00100001","0~
15:27:28.079 -> [00:00:04.457,946] <dbg> lte_lc_helpers.parse_cereg: Network registration status: 1
15:27:28.079 -> [00:00:04.457,97PDP Context 0, PDN ID 0
15:27:28.079 -> 7]PDP Context 1, PDN ID 0
15:27:28.079 -> Bye
15:27:28.079 ->  <dbg> lte_lc_helpers.parse_cereg: LTE mode: 9
15:27:58.344 -> [00:00:34.742,767] <dbg> lte_lc.at_handler: +CSCON notification

  • Hi,

     

    The PDN example, which it looks like you're running, will showcase how to setup a specific PDN. This seems to be successful at your end, which is a good starting point. However, it does not do anything wrt. NIDD.

     

    the modem_shell can do NIDD. Please see this thread on how to use NIDD with the modem shell:

    https://devzone.nordicsemi.com/f/nordic-q-a/76364/nidd-testing-with-modem-shell---nrf9160-nb-iot

    The above thread refers to the raw socket, as also listed with examples in the modem shell documentation:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/modem_shell/README.html#id5

     

    Could you try this and see if that works at your end?

     

    Kind regards,

    Håkon

  • I have one doubt.
    When I configure the PDN example to Non-IP it shows "PDN type IPv6 only allowed". Is it mean that my SIM does not support NIDD? 

    17:07:32.696 -> Created new PDP context 1
    17:07:32.729 -> PDP context 1 configured: APN ****, Family Non-IP
    17:07:32.729 -> Event: PDP context 1, PDN type IPv6 only allowed
    17:07:32.729 -> notify +CGEV: RESTR 3,1
    17:07:32.729 -> pdn_activate() failed, err -8 esm 51 PDN type IPv6 only allowed
    17:07:32.862 -> notify +CGEV: IPV6 0
    17:07:32.862 -> Event: PDP context 0 IPv6 up

  • Hi,

     

    pdn_activate() returns -8 (ENOEXEC), which seems to indicate that enabling the specific APN is not successful:

    https://github.com/nrfconnect/sdk-nrf/blob/v1.9.1/lib/pdn/pdn.c#L345-L348

     

    Manu_Devappa said:
    When I configure the PDN example to Non-IP it shows "PDN type IPv6 only allowed". Is it mean that my SIM does not support NIDD? 

    The ESM cause code indicates that your APN only support ipv6.

    The activation of the other APN fails, indicating that you are having issues enabling the APN/PDN for NIDD. This could be due to wrong settings, or incorrect authentication (for instance SIM issues).

     

    Kind regards,

    Håkon

  • I followed Modem Shell example and this is my log, 

    17:47:20.519 -> Functional mode set successfully: power off
    17:47:20.519 -> mosh:~$ link defcont -e -a "SimAPI" -f "non-ip"
    17:47:57.960 -> link defcont enabled
    17:47:57.960 -> link_sett_save_defcont_apn: key mosh_link_settings/defcont_apn with value SimAPI saved
    17:47:57.960 -> Key "mosh_link_settings/defcont_ip_family" with value "3" / "non-ip" saved
    17:47:57.960 -> mosh:~$ link funmode --normal
    17:48:20.462 -> Functional mode set successfully: normal
    17:48:20.462 -> mosh:~$ Network registration status: searching
    17:48:23.256 -> mosh:~$ LTE cell changed: Cell ID: 4158866, Tracking area: 49284
    17:48:23.256 -> mosh:~$ Currently active system mode: NB-IoT
    17:48:23.256 -> mosh:~$ RRC mode: Connected
    17:48:23.489 -> mosh:~$ RRC mode: Idle
    17:48:24.785 -> mosh:~$ sock connect -f packet -t raw
    17:49:07.080 -> Socket open and connect family=3, type=3, port=0, bind_port=0, pdn_cid=0, address=
    17:49:07.080 -> Socket created socket_id=0, fd=4
    17:49:07.080 -> mosh:~$ sock send -d foodata2 -i 0
    17:49:17.914 -> Socket data send:
    17:49:17.914 -> 	foodata2
    17:49:17.914 -> Error from socket id=0 (fd=4), closing
    

Related