Relaydroid
Connecting a Relaydroid network I/O module: device settings, container parameters, connectors, treatments and commands.
| At a glance | |
|---|---|
| Device | Relaydroid IP relay and I/O module |
| Connection | HTTP (Web API v2), optional status messages over TCP |
| Handler type | Relaydroid |
| Protocol | RelaydroidWebApiV2 |
| Datapoints | created by hand |
| Import | none |
| Treatments and commands | created by hand |
Relaydroid is a small network module with open-collector outputs, digital and analog inputs. Siwenoid reads the state of its connectors over the network and shows them as datapoints, so a contact can raise a status in the signal log and an operator can switch an output from the datapoint hierarchy or a map.
Siwenoid polls the module every 2.5 seconds by default. The module can also send its state changes to the Siwenoid server as they happen; this is optional and makes digital inputs react faster.
Preparing the module
Do these steps in the module's own web interface. Its factory default address is 192.168.2.201: for the first login, put your computer in that subnet.
-
Log in to the web interface with the module's administrator account.

The Relaydroid web interface after login. -
In the network settings, give the module a fixed IP address and port. Siwenoid will connect to this address.

Network settings of the module. -
Under Settings › Users and passwords, set a user name and a password for the web and API account (user #1, web+API). The user name must be filled in before the settings can be saved. Siwenoid needs this password.

The web and API account. -
If the module should send its state changes by itself, open Settings › Connected relaydroid and enter:
- the IP address of the Siwenoid server,
- a free port on the Siwenoid server (the same port you will enter in Siwenoid),
- the cycle: how often, in seconds, the module also sends its full state.
Save the changes.

Sending status messages to the Siwenoid server.
Important
Status messages arrive on the Siwenoid server. Allow the chosen port through the server's firewall.
Creating the container
Create the container in Preferences › Physical structure (see Physical structure for the editor in general). Choose Relaydroid as Handler type and RelaydroidWebApiV2 as Protocol, then fill in the connection parameters.

The container editor with the Relaydroid connection parameters.
| Field | Meaning | Default |
|---|---|---|
| Host IP | IP address of the module. Required. | |
| Port | Port of the module's web interface. Required. | |
| API password | Password of the module's web and API account. Required. | |
| Allow incoming messages | Accept the status messages the module sends by itself. | off |
| TCP address for receiving incoming messages | An address of the Siwenoid server that the module can reach. | |
| Port number for receiving incoming messages | The port set as Connected relaydroid in the module. | 8082 |
| Monitoring the voltage level of AIs | Follow the voltage of the analog inputs. | off |
| Tolerance of deviation of AI voltages (V) | How far a voltage may be from a treatment's value and still match it. | 0.05 |
| Poll period | How often Siwenoid reads the module, in milliseconds. | 2500 |
| Connection timeout | Milliseconds to wait for the connection. | 2500 |
| Socket timeout | Milliseconds to wait for an answer. | 2500 |
| Communication error count threshold | Failed reads in a row before the module is shown as disconnected. | 3 |
An empty optional field uses its default. With a tolerance of 0.5 V, a treatment defined for 2.0 V matches any voltage between 1.5 and 2.5 V.
Save the container and switch its connection on. When the module answers, Siwenoid creates a Device datapoint for it under the container.
Adding the connectors
Relaydroid has no configuration file to import: add a datapoint for every connector you use. Select the device under the container, add a child datapoint, choose its type and enter the connector's number in Connector id.
| Datapoint type | Connector | Commands |
|---|---|---|
| Open Collector | output | yes |
| Digital Input | digital input | no |
| Analog Input | analog input (voltage) | no |
| RX/TX Output | RX/TX line used as an output | no |

A digital input with its connector id.
Treatments and commands
Relaydroid comes with no default treatments or commands and no treatment file: create the treatments and commands of each datapoint type by hand in Preferences › Datapoint types (see Creating and deleting treatments and Commands):
- A treatment matches a Connector state:
0or1for digital connectors, a voltage for analog inputs. - An open-collector command sets the OC state (
0or1). With Timelimit the output returns to its previous state after that time.

A command of the Open Collector type.
Warning
Do not use Import treatments for this handler. The import deletes the treatments and commands created by hand on the handler's types and creates none.
Checking the connection
- Change a digital input on the module and watch the datapoint in the datapoint hierarchy. Without incoming messages the change shows up within one poll period.
- Send a command to an open-collector datapoint and check the output on the module.
- If the module is shown as disconnected, check the IP address, the port and the API password, and that the module's web interface opens from the Siwenoid server.