Google IoT Core provides a scalable, rapid solution development platform, made up of tightly integrated components that can be customized to help you solve your business challenges. Whether you are collecting data from a Raspberry Pi or industrial machines, the platformcan help you manage your IoT devices in real time. Pairing this powerful IoT platform with SIGNL4 can enhance your daily operations with an extension to your mobile team in the field or on the shop floor.
How it Works
SIGNL4 integrates with Google IoT Core using a simple MQTT flow on the Google Cloud platform.
Tickets and Incidents are sent to SIGNL4
Event categorization, routing and automated delivery
Persistent Notifications by push, text and voice call with Tracking, Escalation and Confirmation to Staff on Duty
HOW TO INTEGRATE
Gathering events from IoT devices and sending team alerts in case of critical incidents is a broad field. Systems can involve simple prototypes using a Raspberry Pi and can expand into industrial IoT scenarios, machine data or distributed systems in the field.
The following example demonstrates the flow of an event captured on a device through to notification of an engineer using SIGNL4 and Google IoT Core together.
SIGNL4 is a mobile alert notification app for powerful alerting, alert management and mobile assignment of work items. Get the app at https://www.signl4.com.
Cloud IoT Core is a fully managed service that allows you to easily and securely manage and connect your IoT devices. The integration with SIGNL4 is straightforward. In the following we will show an example on how to send alert notifications using SIGNL4 in case of MQTT events coming from devices in the field.
A SIGNL4 (https://www.signl4.com) account Access to the Google Cloud Platform (https://console.cloud.google.com)
A Raspberry Pi device (optional) Sample Python code to send MQTT messages (https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/iot/api-client/mqtt_example, optional)
In order to setup the following flow quite some configuration steps are required.
The good news is that the following article describes all the steps very well, except the Cloud Function part.
Therefore, we will focus on the Cloud Function part that is used to send the SIGNL4 alert and only briefly mention the other steps.
Prepare the Google IoT Cloud and Pub/Sub
In Google Cloud IoT Core first create a registry. Then a gateway and a device.
Prepare your Raspberry Pi
A great device for IoT prototyping is the Raspberry Pi. We will use this one as our device and connect it to Google IoT core. As a protocol for sending event data we use MQTT. This is quite an undertaking, however, luckily there is a great sample available already at GitHub:
python-docs-samples/iot/api-client/mqtt_example at main · GoogleCloudPlatform/python-docs-samples · GitHub
This sample included a Python file that can be used as is or you can modify it to match your needs. By default it sends a bunch MQTT messages. You might want to modify the code to send an MQTT messages in case a sensor detects something or a button is clicked.
In order for the Python script to work you need RSA keys you can create it with the following command directly on your Raspberry Pi:
openssl req -x509 -nodes -newkey rsa:2048 -keyout rsa_private.pem -days 1000000 -out rsa_cert.pem -subj "/CN=unused"
And you need the Google certificate you can get with the following command.
Get the root certificate:
Now you are ready to run the script with the following command:
sudo python3 GoogleIoT.py --registry_id=SIGNL4 --cloud_region=europe-west1 --project_id=fair-geography-228811 --device_id=MyRaspberryPi --algorithm=RS256 --private_key_file=./rsa_private.pem --ca_certs=./root.pem --num_messages=4
This will send the MQTT messages to the Google IoT Cloud.
Create the Google Cloud Function
Under Google Cloud Functions you can now create a new function.
Trigger type: Cloud Pub/Sub Topic: SIGNL4TelemetryTopic (The topic you have created under Pub/Sub)
This function is then being triggered by Cloud Pub/Sub. The function will take the data and then send it to SIGNL4 via HTTP POST. The sample source code is available at GitHub.
Please replace by your SIGNL4 team code.
Now you can test it by sending an MQTT message from your Raspberry Pi as described above. You should then receive an alert on your SIGNL4 app.
SIGNL4 can further increase the visibility of alerts through its Signals and Services section. Augmenting the color and icon of alerts will provide more relevant information at a glance without having to open the alert.