asset-tracker v2 on custom PCB/board - Device cannot connect to nRF Cloud, even after provisioning and flashing certificates

Hello,

I'm currently using the nrf9160 for a university project and I'm having problems with connecting my custom PCB with nrf9160 to nRF Cloud using the asset-tracker-v2 example. 

I tried flashing new certificates according to https://docs.nrfcloud.com/Guides/GettingStarted/Devices/#securely-generating-credentials-on-the-nrf9160 and have even used the Device Credentials Installer python script to flash certificates to SECTAG "16842753" (https://github.com/nRFCloud/utils/blob/master/python/modem-firmware-1.3%2B/device_credentials_installer.py) using UART. Non of these methods have allowed my PCB to connect to nRF Cloud, although that the certificate flashing has worked, through UART or through AT-Commands using nrf_modem_at_cmd() functions.

I have also provisioned the device using the provision.csv file, that is created using this script, and I can see the device, with the internal UUID of the modem in nRF Cloud, but a connection never gets established.

I have already tried the asset_tracker_v2 example on my other thingy91 board, and can see it in my nRF Cloud account and see its GPS Location and data and that it is connected (LTE icon is green).

I have set CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID=y in prf.conf file, in order use the internal UUID as stated in the above guide for nRF Cloud.

The Device gets an

[00:00:09.788,299] <dbg> nrf_cloud_transport.nct_mqtt_evt_handler: MQTT_EVT_DISCONNECT: result = -128

error whenever it tries to connect to nRF Cloud. The connection to the internet works, since the download sample in the nrf9160 sample folder works correctly, and a test file gets downloaded correctly.

I am using a Hologram MFF2 Sim, that has a data plan. I can also see that my PCB can connect to the network (in hologram's dashboard) and data is being used successfully and the device can connect to the network (Telekom Deutschland over LTE-M in this case).

Is it even possible to use a custom PCB with the asset_tracker_v2? The board configuration files work correctly and I can compile and flash the asset_tracker_v2 application with some very small modifications like disabling the LEDs, since my custom board has no LEDs, otherwise the asset_tracker_v2 application is untouched. What am I doing wrong here? Are the certificates the problem? Or the Provisioning?

I am currently using CLion to compile, JLINK edu to flash my board and using nrf connect SDK 1.7.0

Here is a sample of RTT log I've captured (IP addresses and Cell IDs removed):

and the device never connects, even after 20min of waiting.

And my prj.conf file:

Thanks!

Parents
  • It looks like you have done all the required steps... one last thing would be to check the dependency for using the internal UUID:

    You probably just need to add CONFIG_MODEM_JWT=y to your prj.conf

Reply
  • It looks like you have done all the required steps... one last thing would be to check the dependency for using the internal UUID:

    You probably just need to add CONFIG_MODEM_JWT=y to your prj.conf

Children
  • Thank you very much! After hours of flashing certificates and provisioning devices in nRF Cloud, the asset tracker v2 works on my PCB! 

  • Hi Makkash,

    Do you mind sharing with me how to create the provision.csv file?  I generated and downloaded all certificates to my board.  I can see (16842753,0), (16842753,1) and (16842753,2) certificates when I used the command at%cmng=1.  But I kept failing provisioning my device to the nRF Cloud.  You help is very much appreciated.

    Thank you,

    Floyd

  • the API documentation displays a some examples of the csv file format.
    https://api.nrfcloud.com/v1#operation/ProvisionDevices

    Here is the example which uses the device ID (required), FOTA capabilities (not required), and device certificate (required):


    The first item is the device ID.  This example uses a UUID format for the device ID.  Replace with your device's ID.

    The APP|MODEM text indicates FOTA capabilities for your device.  You can remove the text if you do not want to include that capability.

    Copy and paste your device certificate in PEM format; it should include the newlines.  Note the required trailing newline.

    Here is a full example for a device with an nrf-<IMEI> formatted device ID with no FOTA capabilities enabled:


    You can upload your csv file using the website: https://nrfcloud.com/#/provision-devices
    Or you can use the REST API as described by the API documentation.

  • Thank you Justin.  Will give that a go.

  • Hi Justin,

    I tried according to your instruction.  I can see my device in nRF Cloud.  But it is "disconnected".

    And in the Provision Devices page, the status is "Successed".  Any idea why?  The main reason I need to connect to the nRF Cloud is to use its A-GPS data.

    Regards,

    Floyd