Send a SMS without PDN configured

Hi, 

I have a question about the SMS sample (https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/samples/cellular/sms/README.html). I can use this sample to send and receive SMS, but when I configured the PDN with the different APN, the sample cannot send or receive SMS. Is it possible to send SMS without PDN configured? 

I think the function used in this sample to connect to LTE network (lte_lc_connect()), connects to LTE network with PDN already configured. If so, is it possible to send SMS without PDN configured?

Regards, 

GoncaloS

Parents Reply Children
  • Hi,

    In theory, you don't need an active data connection to send SMS, you just need the device to be connected to an LTE network. In the SMS example provided by Nordic, the device connects to an LTE network using the lte_lc_connect() function and then the modem is able to send and receive messages if the apn is previously configured. If you change to a different apn than the one supported (using the pdn_ctx_configure function), the example of sending messages no longer works. So it seems that the example using the lte_lc_connect function connects to an LTE network with an active data connection, whereas for SMS you don't need an active data connection, you just need to be connected to an LTE network. Another question is, when we use the lte_lc_connect function, does the device connect to an LTE network with an active data connection or not?

    I am using Modem FW 2.0.1 and the nRF Connect SDK v2.6.1.

    Regards,

    GoncaloS

  • GoncaloS said:
    If you change to a different apn than the one supported (using the pdn_ctx_configure function), the example of sending messages no longer works.

    Do  you activate the PDN afterwards with pdn_activate()?

    Are you able to share your project?

  • I use this code for testing and only use the pdn_ctx_configure function to configure and activate pdn.

    sms_sample.zip

    Regards,

    GoncaloS

  • Hello, sorry for the late follow-up. Could you please retrieve application logs and modem traces from the device with the working SMS sample and the failing one, 

    Thank you!

    Kind regards,
    Øyvind

  • Hello, 

    I have tested the application with the correct and incorrect APN names for the same SIM card. I hide the phone number in the correct APN name logs. 

    *** Booting nRF Connect SDK 3758bcbfa5cd ***
    [00:00:00.403,869] <inf> SMS_sample: SMS sample starting
    [00:00:00.654,968] <inf> nrf_modem_lib_trace: Trace thread ready
    [00:00:00.656,768] <inf> nrf_modem_lib_trace: Trace level override: 2
    [00:00:00.661,956] <inf> SMS_sample: Initialize the Modem library and turn on the modem
    [00:00:00.696,380] <inf> SMS_sample: Initialize the modem information module
    [00:00:00.696,380] <inf> SMS_sample: Initialize the structure that stores modem information
    [00:00:00.698,303] <inf> SMS_sample: LTE mode = 4; LTE preference = 1
    [00:00:00.704,986] <inf> SMS_sample: PDN context 0 configured: APN: wrong_apn_name
    [00:00:00.705,657] <inf> SMS_sample: Default APN: wrong_apn_name
    [00:00:00.757,171] <dbg> pdn: on_cfun: Subscribing to +CNEC=16 and +CGEREP=1
    +CGEV: EXCE STATUS 0
    +CEREG: 2,"BE46","000DDD0C",7
    [00:00:02.546,875] <inf> SMS_sample: Not registered. Trying to attach or searching for an operator
    [00:00:02.546,905] <inf> SMS_sample: Network registration code: Connected - roaming
    +CSCON: 1
    [00:00:02.618,682] <inf> SMS_sample: RRC mode: Connected
    +CNEC_ESM: 27,0
    +CEREG: 2,"BE46","000DDD0C",7,0,19
    +CSCON: 0
    [00:00:03.268,280] <inf> SMS_sample: RRC mode: Idle
    
    *** Booting nRF Connect SDK 3758bcbfa5cd ***
    [00:00:00.385,955] <inf> SMS_sample: SMS sample starting
    [00:00:00.637,329] <inf> nrf_modem_lib_trace: Trace thread ready
    [00:00:00.639,129] <inf> nrf_modem_lib_trace: Trace level override: 2
    [00:00:00.644,287] <inf> SMS_sample: Initialize the Modem library and turn on the modem
    [00:00:00.678,710] <inf> SMS_sample: Initialize the modem information module
    [00:00:00.678,741] <inf> SMS_sample: Initialize the structure that stores modem information
    [00:00:00.680,633] <inf> SMS_sample: LTE mode = 4; LTE preference = 1
    [00:00:00.687,316] <inf> SMS_sample: PDN context 0 configured: APN: correct_apn_name
    [00:00:00.687,988] <inf> SMS_sample: Default APN: correct_apn_name
    [00:00:00.739,501] <dbg> pdn: on_cfun: Subscribing to +CNEC=16 and +CGEREP=1
    +CGEV: EXCE STATUS 0
    +CEREG: 2,"BE46","000DDD0C",7
    [00:00:02.485,961] <inf> SMS_sample: Not registered. Trying to attach or searching for an operator
    [00:00:02.485,992] <inf> SMS_sample: Network registration code: Connected - roaming
    +CSCON: 1
    [00:00:02.557,861] <inf> SMS_sample: RRC mode: Connected
    +CGEV: ME PDN ACT 0
    +CEREG: 1,"BE46","000DDD0C",7,,,"11100000","00000101"
    [00:00:03.375,976] <inf> SMS_sample: Network registration code: Connected - home network
    [00:00:03.379,150] <inf> SMS_sample: SMS sample is ready for receiving messages
    [00:00:07.362,121] <wrn> SMS_sample: Time to receive SMS: 4.0 s
    [00:00:07.362,152] <inf> SMS_sample:    SMS received:
    [00:00:07.362,182] <inf> SMS_sample:    Time:   24-10-23 10:55:56
    [00:00:07.362,213] <inf> SMS_sample:    Text:   'Test1'
    [00:00:07.362,213] <inf> SMS_sample:    Length: 5
    +CMT: "phone number",24
    0791539126010000040C9153917668753000004201320155654005D4F29C1E03
    +CSCON: 0
    [00:00:12.810,302] <inf> SMS_sample: RRC mode: Idle
    +CSCON: 1
    [00:00:17.518,432] <inf> SMS_sample: RRC mode: Connected
    [00:00:17.773,620] <wrn> SMS_sample: Time to receive SMS: 14.4 s
    [00:00:17.773,620] <inf> SMS_sample:    SMS received:
    [00:00:17.773,651] <inf> SMS_sample:    Time:   24-10-23 10:56:06
    [00:00:17.773,681] <inf> SMS_sample:    Text:   'Test2'
    [00:00:17.773,681] <inf> SMS_sample:    Length: 5
    +CMT: "phone number",24
    0791539126010000040C9153917668753000004201320165604005D4F29C2E03
    +CSCON: 0
    [00:00:22.733,520] <inf> SMS_sample: RRC mode: Idle
    +CSCON: 1
    [00:00:25.198,638] <inf> SMS_sample: RRC mode: Connected
    [00:00:25.613,555] <wrn> SMS_sample: Time to receive SMS: 22.2 s
    [00:00:25.613,586] <inf> SMS_sample:    SMS received:
    [00:00:25.613,616] <inf> SMS_sample:    Time:   24-10-23 10:56:12
    [00:00:25.613,647] <inf> SMS_sample:    Text:   'Test3'
    [00:00:25.613,647] <inf> SMS_sample:    Length: 5
    +CMT: "phone number",24
    0791539126010000040C9153917668753000004201320165214005D4F29C3E03
    +CSCON: 0
    [00:00:30.250,732] <inf> SMS_sample: RRC mode: Idle
    

    For the modem traces, I activated the CONFIG_NRF_MODEM_LIB_TRACE and CONFIG_AT_HOST_LIBRARY flags and used Cellular Monitor v2.4.1 from the nRF Connect for Desktop v5.0.2 application, but I got the following error:

    Error when creating trace: unable to locate db directory plugin path: C:\Users\xxx\.nrfconnect-apps\node_modules\pc-nrfconnect-cellularmonitor\node_modules\@nordicsemiconductor\nrf-monitor-lib-js\Release\win32-x64\nrfml-insight-source.nrfml

    How can I solve this problem?

    Regards, 
    GoncaloS

Related