Running the example

From the Command Prompt, run the device emulator as follows:

$ node cloudiot_mqtt_example_nodejs.js 
--projectId=iiot-book
--cloudRegion=europe-west1
--registryId=iiot-book-registry
--deviceId=my-iiot-device
--privateKeyFile=../../../certificates/device_private.pem
--algorithm=RS256

The tool will send data to the official GCP MQTT Hub: mqtt.googleapis.com:8883. We can now check the status of our Google Cloud Function:

  1. From the left-hand menu of the homepage, click Google function and then click on our implemented function, ioot-book-function-1 as shown in the following screenshot:

List of implemented Google Functions
  1. We can check the health of the function by looking at the number of errors. Alternatively, we can click on View logs if we need more details. Finally, we can ask for the data stored with the following query:
$ cbt -project iiot-book-<id> -instance iiot-book-data read iiot-book-signals
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset