IEC 104 Connector
What Is It?
The IEC 104 Connector makes your IoT sensor data available to industrial control systems (SCADA). It acts as a server that SCADA clients can connect to in order to read real-time process data — such as temperatures, voltages, or switch states — using the widely adopted IEC 60870-5-104 standard.
In short: the IEC 104 Connector is the outbound gateway that delivers your data to control rooms and monitoring systems.
How It Works
- The connector reads data points from the central data store (Valkey).
- It listens for incoming connections from SCADA clients on a configurable TCP port.
- When a client connects, it can request all current data points or receive live updates as values change.
IoT Sensors → MQTT → Valkey → IEC 104 Connector → SCADA Client
The connector continuously monitors the data store for changes and pushes updates to all connected clients automatically.
Connection Details
| Setting | Default |
|---|---|
| Protocol | TCP/IP |
| Port | 2404 |
| Port Range | 2404–2420 |
| Mode | Server (clients connect to it) |
| Max Clients | Up to 100 simultaneous connections |
The connector only operates as a server. It does not connect to other IEC 104 systems as a client.
IEC 104 Addressing
Every data point in the IEC 104 protocol is identified by two addresses:
| Address | What It Means | Range |
|---|---|---|
| CASDU | Station address — identifies a group or location | 0–65,535 |
| IOA | Data point address — identifies a specific measurement | 0–16,777,215 |
The combination of CASDU and IOA must be unique across the system. Think of CASDU as the "building" and IOA as the "sensor" within that building.
Example:
- CASDU
150, IOA100→ Temperature in Transformer Room 1 - CASDU
150, IOA101→ Pump Status in Transformer Room 1 - CASDU
200, IOA100→ Temperature in Transformer Room 2
Supported Data Types
The connector supports three IEC 104 data types:
| Type | Name | Used For | Examples |
|---|---|---|---|
| Type 1 | Single Point | On/off states | Door open/closed, alarm active/inactive |
| Type 13 | Measured Normalized | Normalized measurements | Proportional values, percentages |
| Type 30 | Single Point with Timestamp | On/off states with time | Switch state changes with exact time |
| Type 36 | Float with Timestamp | Measurements | Temperature, voltage, current, humidity |
Recommendation: Use Type 36 for analog measurements and Type 30 for binary states. Both include a timestamp for traceability.
Configuration
The connector is configured in two ways:
- Management UI / API — The primary method. When you create an IEC 104 connector in the Management UI, the configuration (network settings, protocol parameters, linked mappings) is stored in the database and automatically pushed to the connector via Valkey.
- Command-line / TOML file — For initial startup parameters (connector ID, Valkey connection, log level). A TOML configuration file can be generated with the
config-gensubcommand.
Startup Parameters
These parameters are passed via command line or TOML file when starting the connector:
| Parameter | Description | Required | Default |
|---|---|---|---|
--id | Unique connector ID (from the Management UI) | Yes | — |
--log-level | Log verbosity (trace, debug, info, warning, error, critical, off) | No | info |
--config | Path to a TOML configuration file | No | — |
Redis subcommand — Connection to Valkey:
| Parameter | Description | Default |
|---|---|---|
--host | Valkey host (with optional port, e.g., valkey:6379) | 127.0.0.1 |
--port | Valkey port (overrides port in --host) | 6379 |
--pwd | Valkey password | — |
Managed Settings (via Management UI)
The following settings are configured through the Management UI and pushed to the connector automatically. You do not need to set them manually.
Network Settings:
| Setting | Description | Default |
|---|---|---|
| Host | Which network interface to listen on (0.0.0.0 = all) | 0.0.0.0 |
| Port | TCP port the server listens on | 2404 |
| Max Connections | Maximum number of simultaneous client connections | 1 |
Protocol Timing Parameters:
| Setting | Description | Default |
|---|---|---|
| T1 | Timeout for sent messages awaiting acknowledgment | 15 seconds |
| T2 | Timeout for sending an acknowledgment | 10 seconds |
| T3 | Idle timeout before a test message is sent | 20 seconds |
| K | Maximum number of unacknowledged messages | 12 |
| W | Number of received messages before an acknowledgment is sent | 8 |
In most cases, the default timing parameters do not need to be changed. Only adjust them if your SCADA system vendor recommends specific values.
Dynamic Configuration Updates
When you change a connector's settings or linked mappings in the Management UI, the backend pushes the updated configuration to Valkey. The connector detects the change and automatically restarts its services with the new configuration — no manual restart required.
Configuration Error Handling
The connector includes robust error handling for configuration issues:
- Invalid configuration — If the connector receives an invalid configuration from Valkey, it logs a detailed error message and continues running with the previous valid configuration.
- Partial failures — Network interruptions or malformed data are handled gracefully without crashing the connector.
- Recovery — Once a valid configuration is published, the connector automatically picks it up and reconfigures itself.
Check the connector logs for specific error details when troubleshooting configuration issues.
Data Store Integration
The connector reads data points from the central Valkey data store. The backend publishes connector configuration and mapping data to Valkey under:
connectors:{CONNECTOR_ID}:config — connector settings
connectors:{CONNECTOR_ID}:mapping — linked mapping definitions
Process image data points are stored under:
process:image:casdu:{CASDU}:ioa:{IOA}
When a value changes in the data store, the connector automatically pushes the update to all connected SCADA clients.
Client Interaction
Initial Data Request
When a SCADA client connects and sends a "General Interrogation" request, the connector responds with all current data points. This gives the client a complete snapshot of the current system state.
Live Updates
After the initial data dump, the connector sends updates only when values actually change. This keeps network traffic low while ensuring clients always have the latest data.
Connection Monitoring
The connector and connected clients exchange periodic test messages to verify the connection is still alive. If a client disconnects, its session is cleaned up automatically.
Tested Compatibility
The IEC 104 Connector has been tested with the following SCADA systems and devices:
- Siemens RTU A8000 (ETI4)
- Vivavis HIGHLEIT
- PSIcontrol
Limitations
- Server only — The connector cannot initiate outbound connections to other IEC 104 systems.
- Monitoring types only — Supports Type 1, 30, and 36 for reading data. Write/command operations from the SCADA side are not currently supported.
- Single instance — Each connector instance listens on one port. Use the port range 2404–2420 if multiple instances are needed.
For technical implementation details, see the Wiki - ALP-CONNEX IEC104 Connector.