Send Alerts to a Mobile Phone
Estimated reading time: 3 minutes
This page details OT Link Platform flows use cases for sending SMS alerts to Mobile Phones.
OT Link Platform Use Case
Send alerts from the shop floor to workers who need to respond to critical conditions:
- Read tags from a PLC.
- Define alerts (conditions/rules/levels) in Flows.
- Route alerts to specific cell phones or user groups.
Strategies for Sending Alerts
Use an SMS Converged edge system for Messaging
- SMPP-based SMS Converged edge system: Use the SMPP (Short Message Peer-to-Peer) protocol for an SMS (Short Message Service) Converged edge system to generate alerts. Use either a Converged edge system available in a data center or deploy an open source solution, such as Jasmin SMS Converged edge system, which you can install in a OT Link Platform Marketplace.
- Hardware SMS Converged edge system: Deploy a device with a SIM card to serve as an SMS Converged edge system. Use Flows to send messages to this SMS Converged edge system when an alert is triggered.
- Online SMS Converged edge system: Use an online, cloud-based SMS Converged edge system, such as AWS SNS (Simple Notification Service) or Twilio.
Send Messages over WiFi/Network
Install a Notification Receiving mobile app. Several MBaaS (Mobile Backend-as-a-Service) applications (such as Kinvey, Cloudkit for iOS, or Firebase) provide this capability.
- OT Link Platform becomes the Notification Server.
- The app connects to Flows to receive notifications.
Create a Twilio Flow to Send an SMS Alert
The following example provides_ high-level guidance_ for configuring outgoing Twilio messaging in Flows. Because each enterprise has unique requirements and configurations, customize this example for your environment.
- Know how to configure flows in Flows. See OT Link Platform Flows.
- Install a Twilio Node in the Flows Palette.
- Register for a Twilio account here (if you do not have an account), to enable the Twilio Node in a Flow.
Twilio bills for message activity.
Install a Twilio Node in the Flows Palette
To add a Twilio node to the Flows palette:
- Take the steps described in Manage the Nodes Palette.
- Search for the node-red-node-twilio node and click Install.
Although this node supports phone calls, this documentation covers only text messaging.
Configure the Twilio Node
Configure connectivity parameters for the Twilio Node:
- In Flows, drag a Twilio Node onto the canvas.
Double-click the node to edit it.
- In the edit node dialog, select SMS output and enter a phone number (no spaces or special characters) for the person who will receive the text messages.
- Do not click Done yet.
In the edit node dialog, click the pencil icon (next to the Twilio field) to configure the connection parameters for the Twilio Node.
To retrieve the values for configuring a Twilio connection, go to your Twilio account and access the Programmable SMS Dashboard.
- Account SID - Find this security ID in the Twilio account dashboard.
- From - Use the Twilio-assigned phone number found in your Twilio account.
- Token - Find this authentication token in the Twilio account dashboard.
- Name - Enter an optional user-defined name.
- Click Update to return to the edit node dialog.
- In the edit node dialog, click Done.
- Save the flow.
Create a Flow to Test Connectivity
Create a basic flow to test connectivity to Twilio.
To create a flow to test Twilio connectivity:
- In Flows, continue with the flow that you just configured in the previous procedure.
- Drag a Function node onto the canvas and wire it to the Twilio Node.
Double-click the Function node to edit it. Enter a basic message to send as a text message. Click Done.
msg.payload = "Alert: This is a test message from the manufacturing floor."; return msg;
Drag an Inject node onto the canvas and wire it to the Function node. This node will initiate sending the text to the phone.
- Save the flow.
- Inject a timestamp to trigger the alert. Then, check your phone for the text message.