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,

    As of now, we do not have any official updated example where the nRF9160 connects to Google Cloud. The first guide you linked to was a student project, and as such has not been updated. I believe it was built using NCS v0.4.0, so it's very outdated, and you're correct that this causes it to not work. The SDK has changed a lot since that version, so it might not be straightforward to get it to work with a newer version of NCS. Something you can also do is to look at the samples we have in NCS that connects to other cloud services and uses MQTT, such as Simple MQTT and Cloud client, to see how this is done with other cloud services than Google.

    You should be able to see whether your device is connected or not in the Google Cloud Platform. When you go to IoT Core -> <your_registry> -> Devices, you should be able to see a list over your devices and when they were last seen. If they haven't been seen yet, you haven't been able to connect to Google Cloud and communicate with it. You can also see active devices under Monitoring in IoT Core. From your log it seems like it wasn't able to connect to Google Cloud. It started connecting, but there's no log that you successfully connected, and it says that you're trying to publish data while not connected.

    Best regards,

    Marte

Reply
  • Hi,

    As of now, we do not have any official updated example where the nRF9160 connects to Google Cloud. The first guide you linked to was a student project, and as such has not been updated. I believe it was built using NCS v0.4.0, so it's very outdated, and you're correct that this causes it to not work. The SDK has changed a lot since that version, so it might not be straightforward to get it to work with a newer version of NCS. Something you can also do is to look at the samples we have in NCS that connects to other cloud services and uses MQTT, such as Simple MQTT and Cloud client, to see how this is done with other cloud services than Google.

    You should be able to see whether your device is connected or not in the Google Cloud Platform. When you go to IoT Core -> <your_registry> -> Devices, you should be able to see a list over your devices and when they were last seen. If they haven't been seen yet, you haven't been able to connect to Google Cloud and communicate with it. You can also see active devices under Monitoring in IoT Core. From your log it seems like it wasn't able to connect to Google Cloud. It started connecting, but there's no log that you successfully connected, and it says that you're trying to publish data while not connected.

    Best regards,

    Marte

Children
No Data
Related