Does the modem need to be APN set by the application before connecting to an LTE network?

I have a client project developed in 9160 which needs to be connected to the network via NB or LTE-M. Before each connection, I read imsi to determine the apn of the carrier and set it into the modem, but I did not find this operation in the official sample project.  Is it because the modem identifies apn of different carriers?  

Parents
  • Now I use the sim card of China Mobile to connect to nb network, I have set its apn, but the connection times out, and the returned result is -116, what does this error mean?  Because I didn't find its definition in error.h.  

  • Hi,

    The APN is usually provided to the modem by the network. So usually, you do not need to set it manually.

    But if you for some reason need to set the APN manually, you can use the +CGDCONT AT command, or the PDN library.

    duxinglang said:
    the returned result is -116, what does this error mean

    ETIMEEDOUT

    Do you have any logs or modem traces you can share?

    Best regards,

    Didrik

  • As far as I know, the correct APN must be set first to connect to the network. Can we assume that the firmware of the modem already contains APN of some mainstream operators?  If there is a new carrier, then we need to manually set up an APN, right?  By the way, my modem firmware version is 1.2.0 .

    Unfortunately, I don't know how to use modem traces, because my client board has occupied UART0, so I can't output LOG information directly through UART, but only through RTT.  

  • duxinglang said:
    As far as I know, the correct APN must be set first to connect to the network. Can we assume that the firmware of the modem already contains APN of some mainstream operators?  If there is a new carrier, then we need to manually set up an APN, right?  By the way, my modem firmware version is 1.2.0 .

    No, usually, the network informs the modem which APN should be used.

    Though there are exceptions, where either the network doesn't provide the APN in the Attach Accept message, or the device want/need to use a different APN than the default.

    duxinglang said:
    Unfortunately, I don't know how to use modem traces, because my client board has occupied UART0, so I can't output LOG information directly through UART, but only through RTT.  

    Modem traces are sent on UART1 by default. In NCS v1.7.0 and newer, it can also be sent over RTT by setting CONFIG_NRF_MODEM_LIB_TRACE_MEDIUM_RTT=y.

Reply
  • duxinglang said:
    As far as I know, the correct APN must be set first to connect to the network. Can we assume that the firmware of the modem already contains APN of some mainstream operators?  If there is a new carrier, then we need to manually set up an APN, right?  By the way, my modem firmware version is 1.2.0 .

    No, usually, the network informs the modem which APN should be used.

    Though there are exceptions, where either the network doesn't provide the APN in the Attach Accept message, or the device want/need to use a different APN than the default.

    duxinglang said:
    Unfortunately, I don't know how to use modem traces, because my client board has occupied UART0, so I can't output LOG information directly through UART, but only through RTT.  

    Modem traces are sent on UART1 by default. In NCS v1.7.0 and newer, it can also be sent over RTT by setting CONFIG_NRF_MODEM_LIB_TRACE_MEDIUM_RTT=y.

Children
No Data
Related