Search code examples
google-cloud-platformraspberry-pi3google-cloud-iot

How to connect Raspberry Pi (3B+) to Google Cloud IoT


I am a beginner to IoT and Cloud IoT especially. I came across this link, which describes, how we can connect a sensor to Google Cloud IoT core, using Raspberry Pi as a gateway

https://cloud.google.com/community/tutorials/cloud-iot-gateways-rpi

I implemented every step carefully. I found here n there some Python 2 vs Python 3 print statement errors... which I fixed somehow

But after doing everything, I am able to only send, but it is getting stuck at waiting for response... basically my Raspberry Pi is not connected to Google Cloud...

Is there any better tutorial for connecting Raspberry Pi to Google Cloud or what all steps I should be careful, so I can connect my Raspberry Pi to GCloud, using same tutorial, which I shared


Solution

  • You may have an easier time starting from the basic Python sample instead of the more complex Gateway demo.

    You should first create a registry and device, next you can connect using the Python sample and the device credentials.

    If NodeJS is more familiar to you, you can try the quickstart from here.

    I will see about updating the community article, we really shouldn't have the legacy print statements in there. You can try to start from what I've done so far here:

    git clone https://github.com/GoogleCloudPlatform/community