How to Make A Proper Connect between Raspberry pi and gcloud-IoT

General News

Summary

Authentication is done by JSON Web Token, gcloud-IoT core handles by pyjwt it’s based on the python library called cryptography. Here we are going to make a communication between device so MQTT protocol is more convenient On stack driver logging choose your device logging which you wish to store Clone the Google cloud tutorials code from the git by running the following command We can use Raspberry pi or your computer as a gateway for the gateway setup process, Here we are using JWT for authentication, for getting the JWT authentication needed to generate Private and public key pairs. Clone the repository from the Google Cloud community for initial setup for gateway Go to the directory of cloud-iot-gateways-rpi Generate the public and private key pair by running the following command Step3: Go to the registry tab, click on gateway Step 7: Select the public key format in our case which is RS256_X509 Step8: Click on create button and let other as it is Step 9: Modify the run-gateway by the arguments which you provide while you create such as , registry_id and device_id and so on Step 10: Generate the root certificate by running the following command You can create virtual environment in gcloud-IoT core to seperate your projects from your other cloud projects, Follow the below command Step 11: Install the requirements-gateway.txt by running the following command.Ensure that you are in the directory of the file is requirements-gateway Step 12: Run the gateway code with your modified arguments by following the command Create your device in the IoT core section as mentioned in the below screenshot. Publish your telemetry data from your gateway Step 3: To ensure the gateway is running in your raspberry by follow the below command Step 4: You can see your data in your terminal which published to the MQTT broker after running the above command Search pub/sub in the search box and create a subscription by giving required parameters as mentioned in the screenshot. Here you would need to select the pubsub topic which you created earlier, delivery type is “Pull” as we getting the data from our gateway device (Raspberry pi) open the gcloud shell terminal and run the following Finally you would be able to can see the data subscribed from the device in gcloud shell terminal if everything is done.

Classifications

industries
Fintech & Banking
applications
E-Commerce & Retail

AskAI Classifications

Labels
Software Integration Platform ERP Integration SaaS

Linked Companies

DCKAP
$10M to $25M
GitHub, Inc.
$1M to $5M