> 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/qtech/cellular-remote-control/sms-controller/controller-to-controller.md).

# Controller-to-controller texting and P2P mode

Control one SMS Controller from another, or mirror inputs to a partner unit in P2P mode.

The ability of an SMSC to send control texts to another SMSC is a useful feature but please be aware of the limitations below. In P2P mode all Digital and Analogue Inputs are copied directly to the Digital and Analogue Outputs on the partner SMSC.

{% hint style="info" %}
**Applies to:** the SMS Controller (PD8611-4G). P2P mode needs firmware v2.06 or later and SMS Messenger Workbench v1.5.7 or later.
{% endhint %}

To text another SMS Controller, select the device type in the address book as either **SMSC** or **SMSC-P2P**.

## Limitations

* Only the Digital Outputs can be controlled. The Analogue Output values cannot be controlled by another SMSC.
* The SMSC does not support sending confirmation texts to another SMSC so you need to ensure that **Reply with confirmation of control** is turned off.

## Point-to-point (P2P) mode

There is a special SMSC-P2P mode that is designed to streamline the configuration of Point To Point sites. When this mode is enabled all Digital and Analogue Inputs are copied directly to the Digital and Analogue Outputs on the partner SMSC. The SMSC will send a text to the partner device each time that a Digital Input changes state.

![Point-to-point mode: automatic I/O transfer between the SMS Controllers at site 1 and site 2](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2FbqbkjgO8eRfd0EXgSsPN%2Fexample-p2p-mode.jpg?alt=media)

### Set up P2P mode

1. On both SMSCs go to the **Address Book** and set the Device Type as **SMSC-P2P**.
2. Ensure that you name all Analogue Inputs and Outputs that are to be used. Analogue I/O need to have a name configured in order to enable the inputs/outputs on that device.
3. Next, go to the **P2P Configuration** screen and enable the P2P mode.

![P2P Configuration: P2P mode, polling mode and comms detection](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2FxiQtMlVxZFMIMAi3YYmQ%2Fworkbench-p2p-configuration.png?alt=media)

| Setting          | What it does                                                                                                                                                                                                                                                                                                |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| P2P Mode Enabled | This setting will enable or disable the P2P mode.                                                                                                                                                                                                                                                           |
| Polling Mode     | When Polling Mode is enabled the SMSC will periodically send a message to its paired device. The **Polling Period** controls how often the SMSC will send the P2P messages.                                                                                                                                 |
| Comms Detection  | When enabled the SMSC will activate the designated Digital Output if it has not received a P2P message for longer than the specified **Timeout Period**. The timeout must be equal to or longer than the polling period set in the paired device (not the device on which you are configuring the timeout). |

### Timing

* An allowance of 5 minutes is made in the timeout to account for latency in message delivery across the telecommunications network. Setting the timeout to say 1 min may take up to 6 minutes for the digital output to actually assert.
* The telecommunications network does not guarantee that SMS messages will be delivered in a timely manner nor that messages are delivered in the order that they are transmitted, especially if hand off from one telco to another is involved. It is recommended that in order to ensure that digital and analogue values are effectively replicated at the destination device, that periodic polling is enabled. This will ensure that regular opportunity is afforded to synchronise the devices’ input/output state information. Periodic polling is essential for analogue value communications. Periodic polling also triggers messages to communicate the state of digital inputs.

{% hint style="warning" %}
**Warning:** Multiple simultaneous or near simultaneous input changes can cause critical race conditions with SMS messages and result in unexpected behaviour at the destination device due to the nature of SMS message delivery. Care should be taken in the design of systems to avoid rapidly changing inputs where the SMS system would not be able to keep up with the changes.
{% endhint %}

### How values are sent

* Analogue values do not generate a change of state. They are sent to the paired SMSC at the polling interval or when a digital input changes. There is no analogue deadband that triggers a message.
* If the analogue output on SMSC#2 does not match the analogue input value on SMSC#1, then SMSC#1 **does not** send an immediate response.
* For digital inputs an immediate response is sent by SMSC#1 if the outputs on SMSC#2 don't match the inputs on SMSC#1. This aims to update the devices as soon as possible.

### When a partner has been out of contact

When polling is configured, if one end of a P2P pair (SMSC2) is not contactable (e.g. turned off) the other end (SMSC1) keeps sending status messages. Once SMSC2 is powered up/in contact again, there will end up being a back log of messages, some with different input values, so as these messages are processed the outputs on SMSC2 may change states several times. See [P2P outputs switch on and off after a unit comes back](https://help.qtech.co.nz/qtech/cellular-remote-control/sms-controller/troubleshooting/p2p-outputs-change-after-outage.md).

### Comms fail output

It is recommended that comms fail indication should NOT be assigned to an output in P2P mode because it can trigger additional messages which cause delays when processing I/O.
