The TCP ↔ Serial and Serial ↔ TCP entries of the Network menu carry raw serial data over a TCP connection. Use them when software on the network must reach a serial device connected to the gateway, or when a serial device sits behind a serial-to-Ethernet converter somewhere on the network.
A bridge copies bytes from one side to the other, unchanged. It does not know the protocol: there are no addresses, no polling and no values in the gateway database. That is the difference with a driver.
| You want to… | Use |
|---|---|
| Read and write values of a serial device and route them (Modbus RTU, M-Bus, BACnet MS/TP…) | A driver on the serial port. See Gateways. |
| Let a PC tool (configuration software, commissioning tool) talk to a serial device connected to the gateway | TCP ↔ Serial |
| Give a driver of the gateway a serial port that is actually a remote serial-to-Ethernet converter | Serial ↔ TCP |
The gateway listens on a TCP port. When a client connects, the gateway opens the serial port and forwards the bytes in both directions. The serial port is closed again when the last client disconnects. If several clients are connected at the same time, they all receive the data coming from the serial port.
Open Network › TCP ↔ Serial and click TCP ↔ Serial to add a bridge.
| Field | Default | Description |
|---|---|---|
| Name | Name of the bridge. | |
| Listening port | 8222 |
TCP port of the gateway that the client connects to. Use a different port for each bridge. |
| Serial flush interval (ms) | 0 |
0: the bytes received on the serial port are sent to the client at once. Any other value: they are collected and sent in one block at this interval. Use it when the client expects complete frames rather than single bytes. |
| Serial port | Serial port of the gateway: built-in port or USB adapter. See Serial ports and USB adapters. | |
| Forward Baudrate | 115200 |
2400 to 115200 baud. |
| Forward parity | none |
none, even or odd. |
| Serial stop bits | 1 |
|
| Serial data bits | 8 |
|
| Active | ticked | Starts or stops the bridge. |
Download Windows tool gives a Windows program that creates a virtual COM port on the PC and connects it to the bridge. Configure your PC software on this COM port.
The gateway creates a virtual serial port and connects it to a remote TCP server, typically a serial-to-Ethernet converter. A driver of the gateway can then use this virtual port in its Serial Port field, as if the device were connected locally.
Open Network › Serial ↔ TCP to add a bridge.
| Field | Default | Description |
|---|---|---|
| Name | Name of the bridge. | |
| Host | IP address or name of the remote TCP server. | |
| Port | 5000 |
TCP port of the remote server. |
| serialPort | /dev/virtual1 |
Path of the virtual port created by the gateway: /dev/ followed by letters, digits or _. Enter the same path in the Serial Port field of the gateway that uses it. Use a different path for each bridge. |
| Forward Baudrate | 115200 |
Baud rate of the virtual port. The serial settings of the line itself are set on the converter. |
| Forward parity, Serial stop bits, Serial data bits | none, 1, 8 |
|
| Active | ticked | Starts or stops the bridge. |
Serial ↔ TCP is not available on Windows installations.
Each bridge is shown in a table with its state, updated every second.
| Column | Meaning |
|---|---|
| NET client connected | TCP ↔ Serial: number of clients connected. |
| Target TCP host, Target TCP port | Serial ↔ TCP: remote server. |
| Serial data receive | Bytes per second received on the serial port. |
| NET data received | Bytes per second received from the network. |
| Status | inactive: the bridge is not active. TCP ↔ Serial: waiting net client... (no client connected), ready, or the last error. Serial ↔ TCP: pending until the first data flows, then ready, or the configuration errors. |
The bridges run on the main instance of the device.
| Symptom | Check |
|---|---|
Status Serial : missing serial port |
No Serial port is set in the bridge. |
Status Serial : failed to open serial port … |
The port does not exist (USB adapter unplugged or not detected) or another gateway or bridge already uses it. See Serial ports and USB adapters. |
waiting net client... stays |
The client cannot reach the gateway: check its IP address, the Listening port and the firewall. |
| Data arrives in small pieces and the client rejects the frames | Set a Serial flush interval, for example 50 ms. |
Serial ↔ TCP: INVALID_SERIAL_PORT |
The serialPort path is not of the form /dev/name. |
Serial ↔ TCP: INVALID_HOST or INVALID_PORT |
Check Host and Port. |
| Serial ↔ TCP: the driver gets no answer | Check that the gateway uses exactly the same path as serialPort, that the remote server answers on Host and Port, and the serial settings of the converter. The status stays pending as long as no data flows. |