nrf9160 Custom Board connectivity to nrf cloud

Dear Nordic devzone community,

I am using nrf connect SDK version 1.8.0 for the asset tracker and 2.0.2 for AT client. IDE is Vscode Studio.

I have designed a custom board using nRF9160 and I am able to send and read out certain AT commands which confirms to me that most of the embedded part of the design functions fine.

1)Now in order to use the dashboard of nordic cloud I need to get the IMEI and Pin #, this is normally on the DK indicated with the sticker.

I am able to get the IMEI # by AT+CGSN command, now the issue is how to get 6 digits PIN # ?

2)To connect with the LTE Link monitor with my custom board I am using a Serial to USB converter (FTDI), the LTE Link monitor does not recognize this device. You can see that in the attached images. however, if I open my COMport I can send and receive AT commands..

3)The same is the case with the programmer, I want to load the certificates and modem firmware on a custom board nrf9160 chip .as you can see in the attached image.

4)Custom Board is replying to the AT commands as mentioned in the attached image but not responding to the AT+CPIN command to recognize the SIM. I have attached the schematic of the custom board as well.

A few observations while debugging the HW 

a)1.8V output to SIM card is not provided by NRF9160(using the asset tracker FW, which is provided to the DK)

b)What we left open is DETECT pin from nrf9160. But the 1.8V output pin from NRF9160 is still connected to the SIM card connector.

I followed the following links 

 Programming/Debugging nRF9160 SiP on custom board 

https://devzone.nordicsemi.com/f/nordic-q-a/58055/nrf9160-custom-board---connect-uart-and-send-at-commands/238646#238646

 nrf9160 custom board AT client not working 

 Getting HWID nRF9160 custom HW board and using LTE LINK monitor with custom Hardware 

Thanks in Advance,

Best Regards,

Muhammad Usman

 

If anything is unclear please let me know then I can send more information or support with additional attachments.

Parents
  • Hi Mhumannad,

    Great! Good to hear both SLM and XPING work on your device now.

    Next step, let´s provision your custom nRF9160 device with Just-In-Time Provisioning and run the Assert tracker V2 again.

    I have a guide about nRF Cloud Access Provisioning including Decision flow for nRF Cloud Provisioning. You basically follow the red line in the flowchart.

    Please pay attention that your custom board is not officially supported by Assert Tracker V2, so this application may be not fully functional on your board. but if you build with nRF9160dk_nrf9160_ns, we should at least see the device connect with nRF Cloud if you correctly provision the chip to nRF Cloud correctly. Let me see what you can get.

    Best regards,

    Charlie

Reply
  • Hi Mhumannad,

    Great! Good to hear both SLM and XPING work on your device now.

    Next step, let´s provision your custom nRF9160 device with Just-In-Time Provisioning and run the Assert tracker V2 again.

    I have a guide about nRF Cloud Access Provisioning including Decision flow for nRF Cloud Provisioning. You basically follow the red line in the flowchart.

    Please pay attention that your custom board is not officially supported by Assert Tracker V2, so this application may be not fully functional on your board. but if you build with nRF9160dk_nrf9160_ns, we should at least see the device connect with nRF Cloud if you correctly provision the chip to nRF Cloud correctly. Let me see what you can get.

    Best regards,

    Charlie

Children
  • Hi Charlie 

    Thank you so much for the help!

    Sure I will go through it and update you soon on this my findings after testing on "LTE IoT 4 Click board"

    Thanks & regards,

    Muhammad Usman

  • Hi Charlie!

    Thank you for the help! I followed the flow chart as mentioned 

    https://miro.com/app/board/uXjVPfcfAd8=/

    Asset tracker_V2 prj.config file is 

    #
    # Copyright (c) 2021 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # General config
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_NANO=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_ASSERT=y
    CONFIG_REBOOT=y
    CONFIG_FPU=y
    
    # Heap and stacks
    CONFIG_HEAP_MEM_POOL_SIZE=47250
    CONFIG_MAIN_STACK_SIZE=2048
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    CONFIG_HW_STACK_PROTECTION=y
    # Increase AT monitor heap size to be able to fit both neighbor cell measurement
    # and other AT notifications that may come in rapid succession.
    CONFIG_AT_MONITOR_HEAP_SIZE=1024
    
    # Logging
    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=y
    
    # nRF modem library
    CONFIG_NRF_MODEM_LIB=y
    CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=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
    CONFIG_NET_IPV6=y
    CONFIG_NET_IPV4=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"
    
    # 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
    CONFIG_SECURE_BOOT=y
    CONFIG_BUILD_S1_VARIANT=y
    
    # Watchdog
    CONFIG_WATCHDOG_APPLICATION=y
    
    # Application Event Manager
    CONFIG_APP_EVENT_MANAGER=y
    CONFIG_APP_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
    
    # Location related configuration
    CONFIG_LOCATION=y
    CONFIG_LOCATION_DATA_DETAILS=y
    CONFIG_LOCATION_LOG_LEVEL_WRN=y
    
    # Default cloud transport service
    CONFIG_NRF_CLOUD_MQTT=y
    CONFIG_HW_ID_LIBRARY=y
    CONFIG_HW_ID_LIBRARY_SOURCE_IMEI=y
    
    
    CONFIG_NRF_CLOUD_SEC_TAG= 16842753
    CONFIG_CLOUD_CLIENT_ID_USE_CUSTOM=y
    CONFIG_CLOUD_CLIENT_ID="351358814108376"

    Asset Tracker Log file is 

    *** Booting Zephyr OS build v3.2.99-ncs1 ***<CR><LF>
    I: Starting bootloader<CR><LF>
    I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3<CR><LF>
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3<CR><LF>
    I: Boot source: none<CR><LF>
    I: Swap type: none<CR><LF>
    I: Primary image: magic=bad, swap_type=0x0, copy_done=0x2, image_ok=0x1<CR><LF>
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3<CR><LF>
    I: Boot source: none<CR><LF>
    I: Swap type: none<CR><LF>
    I: Bootloader chainload address offset: 0x28000<CR><LF>
    I: Jumping to the first image slot<CR>
    *** Booting Zephyr OS build v3.2.99-ncs1 ***<CR><LF>
    [00:00:00.486,541] <ESC><inf> app_event_manager: APP_EVT_START<ESC><CR><LF>
    [00:00:00.487,609] <ESC><inf> app_event_manager: MODEM_EVT_INITIALIZED<ESC><CR><LF>
    [00:00:00.555,419] <ESC><inf> app_event_manager: MODEM_EVT_LTE_CONNECTING<ESC><CR><LF>
    %CESQ: 50,2,19,2<CR><LF>
    +CEREG: 2,"141A","02495602",7<CR><LF>
    +CSCON: 1<CR><LF>
    [00:00:01.506,072] <ESC><inf> app_event_manager: DATA_EVT_CONFIG_INIT<ESC><CR><LF>
    [00:00:01.696,533] <ESC><inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE<ESC><CR><LF>
    +CGEV: ME PDN ACT 0,0<CR><LF>
    +CNEC_ESM: 50,0<CR><LF>
    %MDMEV: SEARCH STATUS 2<CR><LF>
    +CEREG: 5,"141A","02495602",7,,,"11100000","11100000"<CR><LF>
    %XTIME: "4A","2221517125634A","00"<CR><LF>
    [00:00:03.705,841] <ESC><err> modem_module: Event: PDP context 0, PDN type IPv4 only allowed<ESC><CR><LF>
    [00:00:03.714,141] <ESC><inf> app_event_manager: MODEM_EVT_LTE_CONNECTED<ESC><CR><LF>
    [00:00:03.714,813] <ESC><inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE<ESC><CR><LF>
    [00:00:03.716,369] <ESC><inf> app_event_manager: CLOUD_EVT_CONNECTING<ESC><CR><LF>
    [00:00:03.722,259] <ESC><inf> app_event_manager: DATA_EVT_DATE_TIME_OBTAINED<ESC><CR><LF>
    [00:00:06.799,407] <ESC><inf> app_event_manager: CLOUD_EVT_CONFIG_RECEIVED<ESC><CR><LF>
    [00:00:06.807,525] <ESC><inf> app_event_manager: DATA_EVT_CONFIG_SEND<ESC><CR><LF>
    [00:00:06.808,288] <ESC><inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS<ESC><CR><LF>
    [00:00:09.647,705] <ESC><inf> app_event_manager: CLOUD_EVT_DISCONNECTED<ESC><CR><LF>
    [00:00:09.648,223] <ESC><err> nrf_cloud_transport: MQTT input error: -128<ESC><CR><LF>
    [00:00:09.648,315] <ESC><err> nrf_cloud_transport: Error disconnecting from cloud: -128<ESC><CR><LF>
    %CESQ: 55,2,23,3<CR><LF>
    +CSCON: 0<CR><LF>
    %CESQ: 54,2,17,2<CR><LF>
    +CSCON: 1<CR><LF>
    [00:00:35.716,369] <ESC><inf> app_event_manager: CLOUD_EVT_CONNECTION_TIMEOUT<ESC><CR><LF>
    [00:00:35.717,041] <ESC><inf> app_event_manager: CLOUD_EVT_CONNECTING<ESC><CR><LF>
    %CESQ: 53,2,22,3<CR><LF>
    [00:00:38.755,310] <ESC><inf> app_event_manager: CLOUD_EVT_CONFIG_RECEIVED<ESC><CR><LF>
    [00:00:38.763,305] <ESC><inf> app_event_manager: DATA_EVT_CONFIG_SEND<ESC><CR><LF>
    [00:00:38.764,068] <ESC><inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS<ESC><CR><LF>
    [00:00:41.601,135] <ESC><inf> app_event_manager: CLOUD_EVT_DISCONNECTED<ESC><CR><LF>
    [00:00:41.601,654] <ESC><err> nrf_cloud_transport: MQTT input error: -128<ESC><CR><LF>
    [00:00:41.601,745] <ESC><err> nrf_cloud_transport: Error disconnecting from cloud: -128<ESC><CR><LF>
    +CSCON: 0<CR><LF>
    %CESQ: 52,2,17,2<CR><LF>
    %CESQ: 51,2,22,3<CR><LF>
    +CSCON: 1<CR><LF>
    [00:01:39.717,041] <ESC><inf> app_event_manager: CLOUD_EVT_CONNECTION_TIMEOUT<ESC><CR><LF>
    [00:01:39.717,712] <ESC><inf> app_event_manager: CLOUD_EVT_CONNECTING<ESC><CR><LF>
    [00:01:42.611,999] <ESC><inf> app_event_manager: CLOUD_EVT_CONFIG_RECEIVED<ESC><CR><LF>
    [00:01:42.619,995] <ESC><inf> app_event_manager: DATA_EVT_CONFIG_SEND<ESC><CR><LF>
    [00:01:42.620,758] <ESC><inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS<ESC><CR><LF>
    [00:01:45.467,254] <ESC><inf> app_event_manager: CLOUD_EVT_DISCONNECTED<ESC><CR><LF>
    [00:01:45.467,773] <ESC><err> nrf_cloud_transport: MQTT input error: -128<ESC><CR><LF>
    [00:01:45.467,895] <ESC><err> nrf_cloud_transport: Error disconnecting from cloud: -128<ESC><CR><LF>
    +CSCON: 0<CR><LF>
    %CESQ: 48,2,17,2<CR><LF>
    [00:02:01.506,683] <ESC><inf> app_event_manager: APP_EVT_DATA_GET_ALL<ESC><CR><LF>
    [00:02:01.507,324] <ESC><inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, MOD_STAT, LOCATION)<ESC><CR><LF>
    [00:02:01.507,965] <ESC><inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE<ESC><CR><LF>
    [00:02:01.508,819] <ESC><inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED<ESC><CR><LF>
    [00:02:01.529,998] <ESC><inf> app_event_manager: LOCATION_MODULE_EVT_AGPS_NEEDED<ESC><CR><LF>
    [00:02:01.563,934] <ESC><inf> app_event_manager: MODEM_EVT_MODEM_STATIC_DATA_READY<ESC><CR><LF>
    [00:02:01.594,024] <ESC><inf> app_event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY<ESC><CR><LF>
    [00:02:01.623,474] <ESC><inf> app_event_manager: MODEM_EVT_BATTERY_DATA_READY<ESC><CR><LF>

    To read the certificates using AT command AT%CMNG=1

    2/15/2022 09:55:02.812 [TX] - <CR><LF>
    
    12/15/2022 09:55:02.919 [RX] - %CMNG: 0,6,"0606060606060606060606060606060606060606060606060606060606060606"<CR><LF>
    %CMNG: 16842753,0,"A86D8BF8D75130765A6453960E0E4E5158E0F3E43F86699EFE36190C463A25CF"<CR><LF>
    %CMNG: 16842753,1,"9A2107CC7A59078994D3039432F18ED541A291180583AF47A883F968BFD9112A"<CR><LF>
    %CMNG: 16842753,2,"62F617CF214BFCF2CDAFD7D168F3BC379907A7E8FA8E3A347C9E4215FFFA1742"<CR><LF>
    %CMNG: 4294967293,10,"2C43952EE9E000FF2ACC4E2ED0897C0A72AD5FA72C3D934E81741CBD54F05BD1"<CR><LF>
    %CMNG: 4294967294,6,"58120DADB439950EA64323883163E0E2D5102ACB10B4C8A0897CDB695982B69D"<CR><LF>
    %CMNG: 4294967292,11,"B2C46C2AE7C81943A8BD6DD4ED2A50B659A225A098A177BACB575459CD57CAEF"<CR><LF>

    nrf cloud 

    I also tested the google ping commands. Response is OK 

    e

    Can you please guide me to where is the issue?

    Thanks & Regards,

    Muhammad Usman

  • Hi, charlie!

    Thank you for the help now Connected!  The issue was that I was not updating the certificates in 

    C:\Nordic\myapps\asset_tracker_v2_2_0\src\cloud-certs

    thank you again for the help!

    Regards,

    Muhammad Usman

  • Hi Muhammad. Can you inform me which part in provisioning process to custom board that I define PIN for registering it to nrf cloud account? I already did provisioning process but still can't connect my custom board to nrf cloud, I receive wrong API Key, but I think I already did the process.

    Thank you.

  • Hi Azwawe

    As for pin # , you can enter any pin # , i entered 654321. have you added the certificates to the asset tracker v2 firmware which you downloaded from the LTE link monitor and nrf cloud ? because it must be necessary to load certificates to the FW else you will not able to connect to nrf cloud or even log in

    Regards,

    Muhammad Usman

Related