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

Set APN on nrf9160

Hi, 

I am developing a program about using MQTT service. It needs to set the APN. I used the following code to set APN. The first step is to set APN, it always fails. But when the second step is to read the APN, it will show the right APN. At the same time, the MQTT service cannot be used and it means the APN does not work correct. How can I set it?

    if(at_cmd_write("AT+CGDCONT=0,\"IP\",\"arkessalp.com\"", tmpbuf, sizeof(tmpbuf), NULL) != 0)
    {
        LOG_INF("set apn fail!\n");
    }
        
    if(at_cmd_write(CMD_GET_APN, tmpbuf, sizeof(tmpbuf), NULL) != 0)
    {
        LOG_INF("Get apn fail!\n");
        return;
    }
    LOG_INF("apn:%s\n", tmpbuf);
 

Parents Reply Children
Related