Asset_tracker_v2 problem: Failed to set legacy PCO mode

Hello,

I am very new at this. I have just started to work with the nrf9160DK board, I am using modem firmware 1.3.1, and nRF Connect SDK 1.8.0. I am trying to test asset_tracker_v2 application to connect the board to nrfcloud. Some changes are needed because I am in Uruguay (South America) so I must use NB-IoT, with Legacy PCO (ePCO is not supported).

I used menuconfig in order to modify .config (and I attached a .config file). Some modification are: CONFIG_LTE_MODE_PREFERENCE_NBIOTCONFIG_LTE_NETWORK_MODE_NBIOT_GPS (for NB-IoT and GNSS), CONFIG_PDN_LEGACY_PCO (for legacy PCO), CONFIG_PDN_DEFAULT_FAM_IPV6 (PDN uses IPv6), CONFIG_LTE_LOCK_BANDSCONFIG_LTE_LOCK_BAND_MASK  (using certain bands), CONFIG_LTE_LOCK_PLMNCONFIG_LTE_LOCK_PLMN_STRING (selecting Uruguayan network). Also, based on another ticket from Nordic, CONFIG_MODEM_JWT was modified  and CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID was selected.

LTE connection is achieved, however, nrfcloud connection fails. After booting the DK board, the following warning appears: pdn: Failed to set legacy PCO mode, err 65536 and then cloud connection is not possible. So I tried AT%XEPCO? and the answer is 1 but I had expected a 0 (Legacy PCO), it is like CONFIG_PDN_LEGACY_PCO=y is not working. If I turn off the modem and send AT%XEPCO=0, when cloud connection is attempted the following error appears: nrf_cloud_transport: MQTT input error: -128.  

First question is how to correctly set the legacy PCO mode. And secondly, how could I fix the MQTT connection.
Thanks a lot, 
I apologize if I was not clear or if any information is missing.
Varinia Cabrera
Parents
  • Varinia Cabrera said:
    I am really sorry but I am not understanding where you found # CONFIG_PDN is not set.

    I found it in build/zephyr/.config when I tried building the application myself. This is what it looks like for me

    3122..config

    I didn't include all your kconfigs, as they most of them didn't seem relevant. This is the prj.conf file I use

    #
    # Copyright (c) 2021 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # General config
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_ASSERT=y
    CONFIG_REBOOT=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_FPU=y
    
    # Heap and stacks
    CONFIG_HEAP_MEM_POOL_SIZE=32768
    CONFIG_MAIN_STACK_SIZE=1280
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    CONFIG_HW_STACK_PROTECTION=y
    
    # Logging
    CONFIG_LOG=y
    
    # DK - Used for buttons and LEDs in UI module.
    CONFIG_DK_LIBRARY_INVERT_LEDS=n
    
    # nRF modem library
    CONFIG_NRF_MODEM_LIB=y
    
    # AT Host library - Used to send AT commands directy from an UART terminal and to allow
    #		    integration with nRF Connect for Desktop LTE Link monitor application.
    CONFIG_AT_HOST_LIBRARY=y
    
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_OFFLOAD=y
    
    # LTE link control
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
    ## Power saving timers.
    ### 320 hours PSM.
    CONFIG_LTE_PSM_REQ_RPTAU="11000001"
    ### 20 seconds active time.
    CONFIG_LTE_PSM_REQ_RAT="00001010"
    
    # Modem info library to obtain information about network and device
    CONFIG_MODEM_INFO=y
    
    # Settings - Used to store real-time device configuration to flash.
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_FCB=y
    CONFIG_FCB=y
    
    # FOTA
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_DFU_TARGET=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
    CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128
    
    # Flash - Used in FOTA, settings and storage for P-GPS.
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_STREAM_FLASH=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    # MCUBOOT
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    # Watchdog
    CONFIG_WATCHDOG_APPLICATION=y
    
    # Event Manager
    CONFIG_EVENT_MANAGER=y
    CONFIG_LINKER_ORPHAN_SECTION_PLACE=y
    CONFIG_EVENT_MANAGER_LOG_EVENT_TYPE=n
    
    # cJSON - Used in cloud data encoding.
    CONFIG_CJSON_LIB=y
    
    # CAF - Common Application Framework
    CONFIG_CAF=y
    CONFIG_LED=y
    CONFIG_CAF_LEDS=y
    CONFIG_CAF_INIT_LOG_LED_READY_EVENTS=n
    CONFIG_CAF_INIT_LOG_LED_EVENTS=n
    CONFIG_CAF_INIT_LOG_MODULE_STATE_EVENTS=n
    
    # Default cloud transport service
    CONFIG_NRF_CLOUD_MQTT=y
    
    CONFIG_PDN_LEGACY_PCO=y

    It makes sense, because I can't see that CONFIG_PDN=y is set in prj.conf or using menuconfig.

    You can try an advice from another thread with a similar issue;

    When you are not auto-connecting during bootup, with this config:

    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

    You need to manually initialize the pdn library.

    You should then set config "CONFIG_PDN_SYS_INIT=n" and call pdn_init() prior to calling "lte_lc_init_and_connect()".

Reply
  • Varinia Cabrera said:
    I am really sorry but I am not understanding where you found # CONFIG_PDN is not set.

    I found it in build/zephyr/.config when I tried building the application myself. This is what it looks like for me

    3122..config

    I didn't include all your kconfigs, as they most of them didn't seem relevant. This is the prj.conf file I use

    #
    # Copyright (c) 2021 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # General config
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_ASSERT=y
    CONFIG_REBOOT=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_FPU=y
    
    # Heap and stacks
    CONFIG_HEAP_MEM_POOL_SIZE=32768
    CONFIG_MAIN_STACK_SIZE=1280
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    CONFIG_HW_STACK_PROTECTION=y
    
    # Logging
    CONFIG_LOG=y
    
    # DK - Used for buttons and LEDs in UI module.
    CONFIG_DK_LIBRARY_INVERT_LEDS=n
    
    # nRF modem library
    CONFIG_NRF_MODEM_LIB=y
    
    # AT Host library - Used to send AT commands directy from an UART terminal and to allow
    #		    integration with nRF Connect for Desktop LTE Link monitor application.
    CONFIG_AT_HOST_LIBRARY=y
    
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_OFFLOAD=y
    
    # LTE link control
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
    CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
    ## Power saving timers.
    ### 320 hours PSM.
    CONFIG_LTE_PSM_REQ_RPTAU="11000001"
    ### 20 seconds active time.
    CONFIG_LTE_PSM_REQ_RAT="00001010"
    
    # Modem info library to obtain information about network and device
    CONFIG_MODEM_INFO=y
    
    # Settings - Used to store real-time device configuration to flash.
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_FCB=y
    CONFIG_FCB=y
    
    # FOTA
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_DFU_TARGET=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
    CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128
    
    # Flash - Used in FOTA, settings and storage for P-GPS.
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_STREAM_FLASH=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    # MCUBOOT
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    # Watchdog
    CONFIG_WATCHDOG_APPLICATION=y
    
    # Event Manager
    CONFIG_EVENT_MANAGER=y
    CONFIG_LINKER_ORPHAN_SECTION_PLACE=y
    CONFIG_EVENT_MANAGER_LOG_EVENT_TYPE=n
    
    # cJSON - Used in cloud data encoding.
    CONFIG_CJSON_LIB=y
    
    # CAF - Common Application Framework
    CONFIG_CAF=y
    CONFIG_LED=y
    CONFIG_CAF_LEDS=y
    CONFIG_CAF_INIT_LOG_LED_READY_EVENTS=n
    CONFIG_CAF_INIT_LOG_LED_EVENTS=n
    CONFIG_CAF_INIT_LOG_MODULE_STATE_EVENTS=n
    
    # Default cloud transport service
    CONFIG_NRF_CLOUD_MQTT=y
    
    CONFIG_PDN_LEGACY_PCO=y

    It makes sense, because I can't see that CONFIG_PDN=y is set in prj.conf or using menuconfig.

    You can try an advice from another thread with a similar issue;

    When you are not auto-connecting during bootup, with this config:

    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

    You need to manually initialize the pdn library.

    You should then set config "CONFIG_PDN_SYS_INIT=n" and call pdn_init() prior to calling "lte_lc_init_and_connect()".

Children
  • Hello,

    Thank you again.

    I still do not understand where it is correct to modify the different configurations. I had thought that   only changing the .config through  menuconfig was enough. If it is, I am not doing it right. 

    Then I left .config unchanged (asset_tracker_v2 original) and added the configurations in prj.conf, and it did not work.

    So, I have changed both prj.conf and .config through menuconfig. It works now. I am attaching the application folder.

    6457.asset_tracker_v2.rar

  • Varinia Cabrera said:
    I still do not understand where it is correct to modify the different configurations. I had thought that   only changing the .config through  menuconfig was enough. If it is, I am not doing it right. 

    As far as I know, using either prj.conf or menuconfig should work fine. They essentially do the same thing.

    Varinia Cabrera said:
    So, I have changed both prj.conf and .config through menuconfig. It works now.

    Good stuff! Just reach out if you need more assistance.

Related