Devices with a TCP interface can be controlled via a TCP gateway. Register a TCP Gateway (Device) for controlling the device. You have to go in the setup program part on the devices and create a new device with the button. Then you press the «Add manually» button and choose «TCP Gateway» as Device Type.
No matching from Mac address to IP can be determined on devices with Android version 10 and higher and on iOS devices. In this case, a TCP Gateway must be registered with a fixed IP (you have to configure on the router).
Now you enter names and an ID for the device and configure the network access with Mac or IP and the port over which the device is controlled. You will learn more about this in the chapter Network configuration.
Commands
Now the commands must be registered, which finally control the device. The exact sequences can be found in manual of your device or you have got thm from the manufacturer of the device.
Enter an ID for the command as well as the sequence of operations (Steps). There are the following types of operations:
OPEN_SOCKET | This operation is to establish a Connection. It should be at the first position. |
RECEIVE_DATA | Reads data from the device. |
SEND_DATA | Sends date to the device |
SEND_RECEIVE_DATA | A combination of SEND_DATA and RECEIVE_DATA. First data is sent, then read. |
CLOSE_SOCKET | The connection is terminated |
OPEN_SEND_RECEIVE_CLOSE |
A combination with all operation types. First the connection is
established, then data is sent, read and finally the connection is
terminated. In most cases, this operation will be sufficient.
|
For TCP operations involving a transmission, you have to enter the
Transmission sequence. Binary control data or characters that are not in
the normal character set are captured as \x00, where the two 0
correspond to the hexadecimal value of the character (for example, \x0d
for a carriage return).
When using the wheel control, the absolute value can be taken over into the sequence. For this, the placeholder»\p» is configured. If special formatting is required for the call, this placeholder can be extended with «\p000#», where the digits 0 are filled with the value, with the absolute value.
For the TCP operations, which include reading, a response event can be created, with which you can react to the response from the device.
An event with Sender ID from TCP Device is sent with and the corresponding parameter and value configured here.
The response is evaluated with the regular expression. There are 2. Different ways to get used to:
-
Match
- Search
With the «Test» function, the TCP Command can be run for test purpose and the result of the Response Event can be displayed. The whole command (with all steps) will be executed
If an ID is entered for the request event, the command can also be used as Dynamic Attribute.