link-iec104 is a pure Java implementation of the IEC 60870-5-104 telecontrol network protocol, built on top of Netty for high-performance asynchronous I/O.
For questions or issues, feel free to open an issue or submit a pull request.
- Complete IEC 60870-5-104 protocol — ASDU encoding/decoding, APCI framing, and transport layer
- Master (client) & Slave (server) roles with clean API separation
- Netty 4 based — fully async, non-blocking NIO transport
- All standard TypeIDs — single-point, double-point, step position, bitstring, measured values (normalized/scaled/float), integrated totals, protection events, file transfer, and more
- Command types — single/double commands, regulating step commands, setpoints (normalized/scaled/float), bitstring commands, parameter activation
- CP56Time2a / CP24Time2a timestamp support with millisecond precision
- Redundancy groups — multiple connections per group, automatic failover
- Periodic tasks — general/counter interrogation, clock synchronization, configurable per group
- File transfer — directory listing, file download, file upload, and file delete
- Java 8 compatible
git clone https://github.com/openlink2/java-link-iec104.git
cd java-link-iec104
mvn clean install -pl link-iec104 -DskipTestsThen add the dependency to your pom.xml:
<dependency>
<groupId>com.openlink2</groupId>
<artifactId>link-iec104</artifactId>
<version>1.0.1</version>
</dependency>MasterConfig config = new MasterConfig("127.0.0.1", 2404)
.setCommonAddress(1)
.setGiInterval(30);
Iec104Master master = Iec104.newMaster(config);
master.setDataListener(asdu -> {
System.out.println("Received: " + asdu.getTypeId());
});
master.setConnectionListener(connected -> {
if (connected) {
System.out.println("Connected");
master.sendInterrogation();
}
});
master.connect();SlaveConfig config = new SlaveConfig()
.setPort(2404)
.setCommonAddress(1);
Iec104Slave slave = Iec104.newSlave(config);
slave.setDataListener(asdu -> {
System.out.println("Received: " + asdu.getTypeId());
// Process interrogation, command, etc.
});
slave.start();Requires JDK 8+ and Maven 3.
mvn clean package -DskipTestsThe core library JAR will be in link-iec104/target/.
The link-iec104-example module is a Spring Boot web application with a REST API and a simple web-based dashboard. It demonstrates core library usage and serves as a quick testing panel for IEC 104 masters and slaves.
cd link-iec104-example
mvn spring-boot:runOpen http://localhost:8090 in your browser.
This project is licensed under the Apache License, Version 2.0 — see the LICENSE file for details.