There has been some complaints about the SMS capability of the SMS Notifications module that I have seen recently.
Most of these centre around how the Sierra Wireless SMS modems have no feedback on whether an SMS has been sent or if the modem is even connected.
I personally have a couple of issues with the module:
- The Sierra dialler uses UDP, so there is no confirmation a packet ever made it to the unit.
- The dialler cannot have a gateway address configured on it, so it MUST be on the same subnet as the Ignition instance connected to it.
- The Sierra dialler is very clunky to set up and it seems to be not very user friendly.
- The Sierra series of diallers is not very common and getting these units off the shelf is not easy.
- There is no way of reattempting to send an SMS if the system has not received the request.
- There is no way to see what state the dialler is in, signal strength or other options.
- There is no redundancy for these units available.
To work on a solution to these issues, I have had a look around at the offerings that are readily available to me.
Teltonika make a lot of affordable and highly featured units with lots of options on power etc.
I happen to have a Teltonika RUT956 on my desk here, so I have done some work on this unit:
-
This unit is dual SIM, so immediately it is attractive to me as a redundancy option for redundant telecom providers.
-
This unit is properly configurable on the IP front, so you can set this modem up as a simple device on any subnet and also disable mobile data, so you close off the cybersecurity risks on another front.
-
This unit has OPC-UA capability:
Log into the Teltonika and click on Advanced Mode. Navigate toSystem -> Package Manager -> Upload
. Click on the "this repository" link and download theopc_ua_server.tar.gz
file.
Return to theSystem -> Package Manager -> Upload
page and browse to the downloaded file, click upload, and this will install the OPC-UA service. Navigate toServices -> OPC UA Server
and enter "4840" in the port number section, clickEnabled
so that it shows "on" and then clickSave & Apply
In Ignition Gateway, add a new OPC-UA connection, the connection URL will beopc.tcp://<Teltonika IP>:4840
where is your Teltonika devices IP.
Click next to finish setting up the device and also check the box "Read Only" when you are presented with the option. Click Save when done.
At this point you will now be able to browse in your designer to the new OPC-UA server and get these tags onto your project, should you want any of them:
-
This unit also has REST capability for sending SMS messages:
In the Teltonika web config, navigate toServices -> Mobile Utilities -> SMS Gateway
Click on Enable, and set a username and password here. ClickSave & Apply
. In Ignition, Create a new Alarm Pipeline, and add a Script element to it. Paste this code into the Script:
def handleAlarm(event):
logger = system.util.getLogger("SMSLogger")
teltonikaUsername = "user1"
teltonikaPassword = "Sms12345"
teltonikaAddress = "192.168.1.1"
smsNumber = "%2B1234567892"
smsText = "Test SMS"
#set up sms payload
requestData = "username=" + teltonikaUsername + "&password=" + teltonikaPassword + "&number=" + smsNumber + "&text=" + smsText
handler = system.net.httpClient()
response = handler.post("http://"+teltonikaAddress+"/cgi-bin/sms_send",
headers = {"Content-Type": "application/x-www-form-urlencoded"},data = requestData)
if "OK" in response.text :
event.cancelNotification()
else :
logger.info("SMS Failed to send: " + response.text)
Add your details to the username, password and address variables, and save the pipeline.
At this point, if you assign a tag alarm to this pipeline, it will send a text to "001234567892" saying "Test SMS", then it will stop the pipeline. If the sending fails, it will log the response, and the event will be passed to the next item in the pipeline, enabling you to handle failed alarm notifications.
I am sure that you can all see the benefits here of the Teltonika modems in this application, and you can make a lot of mods to what my proof of concept code here does.