> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/alarms/test-sms.md).

# Test alarm texts from Supervisor

Set up an SMS test area that operators use in DATRAN Supervisor to check Datashed and SMS Direct, and work out which part is failing.

DATRAN can be configured to provide a Test area for SMS messaging in the DATRAN Real Time Database (TBD). The common test scenarios are: check that the connection to Datashed is present; send an SMS test message to a designated operator via Datashed (using an SMS annunciator, as alarm messages would typically be sent); send an SMS test message to a designated operator via SMS Direct (using an SMS Direct annunciator); force an SMS test message to be sent via SMS Direct when it would normally be sent via Datashed; and run periodic tests each day or week to check the state of the SMS system.

{% hint style="info" %}
**Applies to:** DATRAN VI systems with Datashed, SMS Direct, or both. Experienced administrators who are familiar with configuring DATRAN using DATRAN Browser set up the test area; operators can undertake SMS system testing using DATRAN Supervisor.
{% endhint %}

## The test nodes

An SMS test area is a set of nodes created in the TBD usually under a site that represents the Base Station (the DATRAN machine), often called `BASE STATION` or something similar. They are added as `_View_` nodes so that they can be seen in the Supervisor application and, if necessary, with view digital values set to `digital=1` so that the node can be changed by an operator in Supervisor. The node names do not have to use the exact wording; they can be personalised for the particular customer. For best use, the node should be put in a site with a `_comms_object_` to be visible and listed in the Supervisor Site List in order to be editable in Supervisor.

| Node                               | What it does                                                                                                                                                                                                                                          |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Datashed Connected                 | Reads and Displays the State of the connection to Datashed from the XDI service (read only), normally equals 1 if the connection to Datashed is healthy (0 if the connection is down)                                                                 |
| Send SMS test alarm via Datashed   | Emulates sending a typical alarm message sent via Datashed without having to create a real alarm                                                                                                                                                      |
| Send SMS test alarm via SMS Direct | Emulates sending a typical alarm message sent via SMS Direct without having to create a real alarm                                                                                                                                                    |
| Force manual override on           | Set to 1 to override the connection to Datashed and send all messages via SMS Direct (set to 0 to turn the override off). See [Force DATRAN to use SMS Direct](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/alarms/force-sms-direct.md). |
| Periodic SMS test via Datashed     | Periodically scheduled alarm message (typically every morning) to allow operators to check that SMS messages are getting to their phone                                                                                                               |
| Periodic SMS test via SMS Direct   | Periodically scheduled alarm message (typically every week if SMS Direct is a backup system) to allow operators to check that SMS messages are getting to their phone                                                                                 |

A sample of the TBD and the template used to reset an alarm is provided. The script for turning off the Datashed connection is also provided in the application note [Force DATRAN to use SMS Direct](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/alarms/force-sms-direct.md). For additional help setting up and configuring SMS Message testing please contact <techsupport@qtech.co.nz>.

### Choose who gets the test texts

Each DATRAN System holds a list of operators. Generic operators are created using an Alias. For SMS Message testing it may be useful to create an alias called `Backup SMS Test` or something similar and assign a real operator to it. The test messages themselves should be configured to send messages to the alias and not an individual.

In Supervisor, to change the recipient of the test messages, open the Operator Roster tab, double-click the `Backup SMS Test` operator alias in the list and select a new operator from the list in the dialogue box that pops up. You may wish to choose from a selection of operators that are either key personnel or are known to have phone numbers on various mobile networks.

## Send a test

1. In Supervisor, open the **Site List** and double-click the base station site.
2. To send a message, click the spanner tool then set the value to 1 to assert an alarm, which will send the message.
3. There is a template that can be applied to reset the alarm to normal, or you can click the spanner again and set it to 0 to reset the alarm. A message is sent each time the alarm is asserted.

Similarly, forcing manual override on and off is a case of setting it to 1 and later setting it back to 0 when manual override is no longer needed.

## Find which part isn't working

Follow these steps to run through a sequence of tests if there is a concern that the SMS messaging system is not working properly. It is expected that the message recipient is available and aware that test messages are attempting to be sent. Use the truth table below to try to isolate the issue.

| Step | Do this                                                                                                                                                                                         | What it tells you                                                                                                                                                                                                                                                                                             |
| ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1    | Check the state of the Datashed Connected node                                                                                                                                                  | If 1 it should be normal so you would expect to send a message via Datashed and it should be received. If 0 the connection is down but SMS Direct should automatically act in failover and a message sent via Datashed will be sent via SMS Direct and received.                                              |
| 2    | Send a test message via Datashed                                                                                                                                                                | If the message is not received at all then either Datashed is not working, SMS Direct is not working, or both, or it is mobile network related.                                                                                                                                                               |
| 3    | Send a test message via SMS Direct                                                                                                                                                              | If the message is not received then there could be a problem with SMS Direct.                                                                                                                                                                                                                                 |
| 4    | If messages aren't going through, check message recipients on different mobile networks (Vodafone, Spark, 2 Degrees). The problem may lie with one of the gateway connections to these networks | Try to isolate the problem if you use multiple mobile network operators for your messages. Change the recipient (operator) and ensure they have a phone on a different network. If messages are being received on some networks but not others the problem is with Datashed and the issue should be reported. |
| 5    | If messages via Datashed are not getting through but it appears Datashed is connected, turn the manual override on (click spanner, change to 1), then send a message via Datashed               | If the message is received then there is a problem with Datashed and SMS Direct has been forced into a failover backup state so operations can continue until the Datashed issue is resolved.                                                                                                                 |
| 6    | Check periodic messages are being received as and when they should                                                                                                                              | Try to select the message recipients (operators) so that they are on different mobile networks if you use multiple networks, so that if one of the recipients does not receive a message this could indicate a latent issue at Datashed.                                                                      |

### State truth table

Try to determine the state of the messaging system by executing the test messages (which should pass or fail).

| State | Datashed Connected | Datashed test message | SMS Direct test message | Manual override | Result                                                                                                          |
| ----- | ------------------ | --------------------- | ----------------------- | --------------- | --------------------------------------------------------------------------------------------------------------- |
| 1     | 1                  | PASS                  | PASS                    | OFF             | System normal                                                                                                   |
| 2     | 0                  | PASS (note 1)         | PASS                    | OFF             | Datashed down but SMS Direct backup working, report issue to QTech                                              |
| 3     | 1                  | PASS                  | FAIL                    | OFF             | Datashed OK but SMS Direct down, restart modem and check diagnostics, report issue if it continues              |
| 4     | 1                  | FAIL                  | PASS                    | OFF             | Datashed may be down and backup SMS Direct not failed over, try manual override, report Datashed issue to QTech |
| 5     | 1                  | PASS (note 1)         | PASS                    | ON              | Datashed internal problem from previous state (4) but SMS Direct now forced into failover state and working     |
| 6     | 0                  | FAIL                  | FAIL                    | ON              | Datashed down (report issue to QTech) and SMS Direct not working, try remedy per state (3)                      |

Note 1. It is sometimes hard to determine if messages via Datashed are getting through, because it could be that Datashed is in a good condition or it could be that it is in an unhealthy condition and SMS Direct has failed over so messages seem to be getting through. The way to tell the difference is that the message recipient will be getting a message from a Shortcode number (a short 4 or 5 digit number) if it is going via Datashed and it will appear to be coming from a mobile number (the phone number of the SIM in the SMS Direct Modem) if messages are going via SMS Direct. This can help you to determine whether SMS Direct is in the failover state or needs to be forced into the failover state.

For example, in state 2 above if Datashed appears disconnected but the Datashed test message passes and the recipient receives the message from a mobile phone number then SMS Direct has sent the message on behalf of Datashed and the system is automatically in failover.

For example, in state 5 above if Datashed appears connected but the Datashed test message passes and the recipient receives the message from a mobile phone number then SMS Direct has sent the message on behalf of Datashed and the system has been forced into failover.

The second way to check if messages are going via Datashed is to log on to your Datashed account on the web and look at the transaction logs, which will show if messages are coming from DATRAN but not being delivered to mobile numbers (operators).

If SMS Direct can't start the modem, see [SMS Direct can't initialise the CM910](https://help.qtech.co.nz/datran/datran-telemetry/cm910-cellular-modem/troubleshooting/sms-direct-cannot-initialise.md).
