This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to set APN in SDK v1.9.1 "https_client" sample project on nrf9160.

Hi all,

In my SIM, I need to set the APN name, username and password. They are not written to the SIM, so I need to set them.

With the at_client App provided by Nordic, I have already been able to connect to LTE using AT commands.

I think I can connect to LTE if I can set it correctly in the code, but I don't know where to set the APN information in sample project.

1,

I referred to the following thread.

devzone.nordicsemi.com/.../343313

And I added the following to the prj.conf file, but it failed with LTE connect.

# PDN library

CONFIG_PDN=y

CONFIG_PDN_DEFAULTS_OVERRIDE=y

CONFIG_PDN_SYS_INIT=y

CONFIG_PDN_DEFAULT_FAM_IPV4V6=y

CONFIG_PDN_DEFAULT_APN=”APN name

CONFIG_PDN_DEFAULT_USERNAME=”user name

CONFIG_PDN_DEFAULT_PASSWORD=”password

Am I missing something? Or do I need additional Including within the main?

2,(Another way)

I referred to the thread below and thought I could use AT commands in my code.

https://devzone.nordicsemi.com/f/nordic-q-a/70961/set-apn

Do I need to write additional code to use AT commands?

Seems like I need to include <modem/at_cmd.h>.  but can't find <modem/at_cmd.h> .

Is my guess correct that there are two different approaches to setting the APN?

Which is the best way? Is there another way?

My HW : nRF9160DK

MFW : v1.3.1

SDK : v1.9.1

Best regards,

Yukio Oyama

  • Hello, 

    First of all could you please provide the log output from your device ? What error do you receive? What SIM and network are you on?

    And I added the following to the prj.conf file, but it failed with LTE connect.

    This looks correct from what I can see. Note that our PDN library and nRF9160: PDN sample can also be used to configure APN. 

    Thanks. 

    Kind regards,
    Øyvind

  • Hello Øyvind-sann,

    I was able to connect to LTE using #1.

    I mistakenly used some symbolic-character double-byte characters in the string. This is the reason why #1 was not possible. Japanese letter is a double-byte character, but symbolic-character are often mistaken for single-byte characters. Sorry.

    In #2, an error occurs in the "at_cmd_write()" command. Is #2 method impossible?

    Is there a reference manual that describes the information that can be set in the prj.conf file? I couldn't find it.

    The AT command is described in detail. So I think it more effective to use AT commands inline.


    I'm already connected to the LTE network, can the SIM information help me with my questions?

    Thank you.

    Yukio Oyama

  • Hello,

    About # 2
    Now in SDK v1.9.1, the function to execute the AT command seems to be nrf_modem_at_cmd (), not at_cmd_write().
    I have confirmed that "AT + CGDCONT" can be executed. Although I haven't tried setting the APN from the AT command.


    Is there a library reference manual for each SDK version? Searching from the code is not efficient. If it is not used in the sample project, I would not be aware of its existence.

    Best regards,

    Yukio Oyama

  • Yukio-san, 

    OYAMA YUKIO said:
    Is there a library reference manual for each SDK version? Searching from the code is not efficient. If it is not used in the sample project, I would not be aware of its existence.

    Yes, our documentation includes a dropdown menu to choose correct version:

    After selecting correct SDK version, you can navigate to e.g. PDN library (under libraries - modem libraries - PDN). This should provide information about PDN. 

    In regards to at_cmd_write changing to nrf_modem_at_cmd, this is a change in nrfxlib. Moving fra bsdlib to nrf_modem. 

    Not sure if that answers your question. 

    Let me know if you need any more.

    Kind regards,
    Øyvind
     

  • Hello Øyvind-san,

    When I checked last month, the page didn't exist when I selected the older version. Only the latest v1.9.1 had contents. But now there is information even in older versions.

    In the changelog, if a function is deleted, I would like you to be guided to a new function with the same function, but it seems that it is not. I'm disappointed.
    But the old version of the information helps me. thank you.

    At final, please tell me about Kconfig.
    Kconfig also changes depending on the version, but there are a lot of Kconfig items.


    There is a Kconfig list.

    developer.nordicsemi.com/.../index-nrf.html

    However, It's hard to find what I want because there are too many items on the list.

    Is there a way to search systematically? It would be very helpful if it was linked to the argument of the AT command.

    Best regards, 

    Yukio Oyama

Related