This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unable to change APN

After struggling quite a bit to get network traffic going on nRF9160 DK using NB-IoT, I've contacted our SIM card provider (Com4 in Norway). They are telling me we need to change the APN from the default "com4" to "iot.com4.net".

However, no matter how I try to save this new APN, it always seem to revert back to "com4" when connecting to the network. Can you see if I'm doing anything wrong?

I've tried to set CONFIG_LTE_PDP_CMD=y, and assign my specific parameters to CONFIG_LTE_PDP_CONTEXT, as described here:

https://devzone.nordicsemi.com/f/nordic-q-a/52077/what-is-the-optimal-way-to-configure-the-modem/211386

Result: You can see the APN being set (lte_lc: PDP Context: AT+CGDCONT=0,"IP","iot.com4.net"), I'm reading AT+CGDCONT? while modem is connecting and APN is set to "iot.com4.net", but when I retry the query right after being connected to the LTE network (Network registration status: 1) the AT+CGDCONT? tells me the APN is "com4" again:

***** Booting Zephyr OS build v1.14.99-ncs3-snapshot2-2647-gd6e67554cfeb *****
[00:00:00.378,112] 
[0m<dbg> nrf9160_gps.init: MAGPIO set: AT%XMAGPIO=1,0,0,1,1,1574,1577
[0m
GF modified Asset tracker started
[00:00:00.390,228] 

[0m<dbg> nrf_cloud_transport.nct_client_id_get: client_id = nrf-352656100223414
[0m
[00:00:00.399,444] 
[0m<dbg> nrf_cloud_transport.nct_topics_populate: shadow_base_topic: $aws/things/nrf-352656100223414/shadow
[0m
[00:00:00.411,102] 
 
[0m<dbg> nrf_cloud_transport.nct_topics_populate: accepted_topic: nrf-352656100223414/shadow/get/accepted
 
[0m


[00:00:00.422,607] 
 
[0m<dbg> nrf_cloud_transport.nct_topics_populate: rejected_topic: $aws/things/nrf-352656100223414/shadow/get/rejected
 
[0m


[00:00:00.435,119] 
 
[0m<dbg> nrf_cloud_transport.nct_topics_populate: update_delta_topic: $aws/things/nrf-352656100223414/shadow/update/delta
 
[0m


[00:00:00.447,998] 
 
[0m<dbg> nrf_cloud_transport.nct_topics_populate: update_topic: $aws/things/nrf-352656100223414/shadow/update
 
[0m


[00:00:00.459,838] 
 
[0m<dbg> nrf_cloud_transport.nct_topics_populate: shadow_get_topic: $aws/things/nrf-352656100223414/shadow/get
 
[0m


Connecting to LTE network. This may take several minutes.


[00:00:00.478,027] 
 
[0m<inf> lte_lc: Using legacy LTE PCO mode...
 
[0m


[00:00:00.484,832] 
 
[0m<inf> lte_lc: PDP Context: AT+CGDCONT=0,"IP","iot.com4.net"
 
[0m


[00:00:00.492,553] 
 
[0m<dbg> lte_lc.w_lte_lc_connect: Network mode: AT%XSYSTEMMODE=0,1,1,0
 
[0m


AT+CGDCONT?


+CGDCONT: 0,"IP","iot.com4.net","",0,0

OK


[00:00:58.821,868] 
 
[0m<dbg> lte_lc.at_handler: recv: +CEREG: 2,"0CEB","020AD91C",9,0,0,"11100000","11100000"


 
[0m


[00:00:58.832,305] 
 
[0m<dbg> lte_lc.parse_nw_reg_status: Network registration status: 2
 
[0m


[00:01:00.568,237] 
 
[0m<dbg> lte_lc.at_handler: recv: +CEREG: 1,"0CEB","020AD91C",9,,,"11100000","11100000"


 
[0m


[00:01:00.578,491] 
 
[0m<dbg> lte_lc.parse_nw_reg_status: Network registration status: 1
 
[0m


Connected to LTE network


[00:01:00.589,172] 
 
[0m<dbg> nrf_cloud_transport.nct_connect: IPv4 Address 50.16.164.33
 
[0m


AT+CGDCONT?


+CGDCONT: 0,"IP","com4","100.64.69.128",0,0


OK


mqtt_connect(): client_connect() returned error code -116


cloud_connect failed: -111


LTE link disconnect


Shutdown modem


***** Booting Zephyr OS build v1.14.99-ncs3-snapshot2-2647-gd6e67554cfeb *****

I also tried another variant, checking out the v1.0.0 version of the ncs repository and trying the at_client sample. Results: First of all, the method (as described in https://devzone.nordicsemi.com/f/nordic-q-a/49581/nrf-9160-dk---asset-tracker-and-ntp-not-working-nrf_cloud_connect_failed-22/198307#198307) of first calling AT+CDGCONT=... and then AT+CFUN=0 folowed by a reset of the device does not seem to store anything. Also, setting the APN after booting but before starting the modem at first seems to work, but when the modem is connected it has reverted back to the old APN:

***** Booting Zephyr OS v1.14.99-ncs2 *****
The AT host sample started
AT
OK
AT+CGDCONT?
OK
AT+CGDCONT=0,"IP","iot.com4.net"
OK
AT+CGDCONT?
+CGDCONT: 0,"IP","iot.com4.net","",0,0
OK
AT+CFUN=0
OK
AT+CGDCONT?
OK
AT+CGDCONT=0,"IP","iot.com4.net"
OK
AT+CFUN?
+CFUN: 4
OK
AT+CFUN=1
OK
AT+CGDCONT?
+CGDCONT: 0,"IP","com4","100.64.4.238",0,0
OK

(I'm running modem FW "mfw_nrf9160_1.0.1")

No matter how I try to save this new APN, it always seem to revert back to "com4" when connecting to the network. Can you see if I'm doing anything wrong? Or do you have any other suggestions?

Thanks for your help.

Parents
  • Hi, 

    Since the APN has quotes in it, you need to explicitly set this as \":

    CONFIG_LTE_PDP_CONTEXT="1,\"IP\",\"test\""

    This will end up as:

    AT+CGDCONT?
    +CGDCONT: 0,"IPV4V6","telenor.iot","10.111.223.35 2A02:2121:0048:8B27:0000:001A:DCA1:2701",0,0
    +CGDCONT: 1,"IP","test","",0,0
    OK
     

    -Amanda H.

  • Hi,

    Thanks for the tips, but I have allready done this. 

    When setting CONFIG_LTE_PDP_CONTEXT in the configuration file I used backslash to escape the quote characters. When sending AT commands directly I do not escape the quotation marks because then it is (as far as I know) not right to do so.

    Either way, when reading back the PDP context from the modem it appears to return the correct string with quotation marks:

    AT+CGDCONT?
    +CGDCONT: 0,"IP","iot.com4.net","",0,0
    OK

    Other suggestions are welcome Slight smile

Reply
  • Hi,

    Thanks for the tips, but I have allready done this. 

    When setting CONFIG_LTE_PDP_CONTEXT in the configuration file I used backslash to escape the quote characters. When sending AT commands directly I do not escape the quotation marks because then it is (as far as I know) not right to do so.

    Either way, when reading back the PDP context from the modem it appears to return the correct string with quotation marks:

    AT+CGDCONT?
    +CGDCONT: 0,"IP","iot.com4.net","",0,0
    OK

    Other suggestions are welcome Slight smile

Children
No Data
Related