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

How do we use nrf9160DK with google cloud MQTT Pub/Sub?

Hi

We are a group of students working with the nRF9160dk.

We want to try connecting the nRF9160dk to google cloud and send data through MQTT.

We have tried to follow this guide (link to guide), but the setup does not work and we assume that it is because it's developed using an older SDK version.

We saw a repository (repository) in the comments of the guide which is more up to date.

Based on the newer repository, we have made a project that is similar in structure to the guide.

It builds and runs, but we don't know how it is supposed to subscribe to a topic we've made in the Pub/Sub service.

In addition we aren't sure if it's actually connected to our Google cloud project since the output in link monitor tells us we've got a connection, but it can't publish messages.

System info:

Operative System: Windows 10

Hardware: nRF9160dk, firmware 

Software: ncs v1.4.99-dev1

Zipped code & log from Link Monitor:

nrfgcloud_new.7z

Google cloud setup:

- Project Info
 

- Registry Info

- Device info

- Pub/Sub     topic & subscription & member/role

Parents
  • Hi!

    Continuing our offline discussion here. I notice two things in your log:
    1. The application tries to (seemingly) connect to GCP before the LTE connection is established. This may be because LOG messages are less prioritized than printk. Does LED1 turn on before gcloud_connect(...) is called?
    2. The gcloud_thread is not started at all. The code you have based your application on has implemented some changes to how the threads are started, though they are removed in your code. Try to add them again so that the thread is started properly. Alternatively you can uncomment line 72, 73 and 74 in gcloud.c.

    Best regards,
    Carl Richard

Reply
  • Hi!

    Continuing our offline discussion here. I notice two things in your log:
    1. The application tries to (seemingly) connect to GCP before the LTE connection is established. This may be because LOG messages are less prioritized than printk. Does LED1 turn on before gcloud_connect(...) is called?
    2. The gcloud_thread is not started at all. The code you have based your application on has implemented some changes to how the threads are started, though they are removed in your code. Try to add them again so that the thread is started properly. Alternatively you can uncomment line 72, 73 and 74 in gcloud.c.

    Best regards,
    Carl Richard

Children
Related