Keil Logo

Google Cloud

Learning Platform

IoT end-node devices collect, process, and exchange data. Such devices are usually connected to a cloud service that provides processing power, data analytics, and storage capabilities. One of these services is the Google Cloud IoT Core.

Users of MDK-Middleware, which includes the IPv4/IPv6 network component and Mbed TLS, can use our IoT Client for communication with the Google Cloud Platform. This makes deployment of IoT end-node devices easy, reliable, and secure.

Software flow

Software flow for Google Cloud

First, the application initializes and starts the CMSIS-RTOS v2 based real-time operating system. Then, it initializes and prepares the network stack which should be active at that point.

Note: The MQTT client in this case uses TLS sockets (for a secure connection) through the ::Security:mbed TLS interface. The latter also uses the ::IoT Utility:Socket (API) for underlying TCP sockets or the native interface in case of the network component of MDK-Professional.

The MQTT client is then used through its API: MQTTClient.h, MQTTPlatform.h, and MQTTPacket.h:

  • The client connects to the server on socket level by calling the functions NetworkInit and NetworkConnectTLS (for a secure connection) (from MQTTPlatform.h). The CA certificate for server verification can be provided and optionally a client certificate and private key for client authentication (if requested by the server) (refer to the user code template ::IoT Client:MQTTClient-C:Certificates).
  • Provide a private key for the Jason Web Tokens (JWT) (template ::IoT Client:Google:Device Private Key).
  • The JWT is generated with the function google_iot_jwt (from google_iot.h)
  • The MQTT client connects on MQTT level using MQTTClientInit and MQTTConnect (MQTTClient.h), using the GOOGLE_IOT_CLIENT_ID macro for the client ID and the JWT as the password.
  • The MQTT client exchanges messages using MQTTPublish and MQTTSubscribe (MQTTClient.h)
  • Disconnect the MQTT from the server on socket level by calling NetworkDisconnect (MQTTPlatform.h)

The user code template ::IoT Client:Google:Simple Demo provides a starting point for your own implementations. A step-by-step guide is available in the software pack’s Doc folder: Google_IoT_MDK.html.

The Google IoT cloud defines specific topics. More information is available here:

Building blocks

The following MDK-Packs provide the basic building blocks that are required to connect to the Google Cloud IoT Core. These software packs are available from the Pack Installer:

Software Packs for Google Cloud Platform
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.