Resolving Siemens IOT2040 TCF Connection Failed: Gateway Fix

David Krause8 min read
Industrial NetworkingSiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Problem: "Failed to Connect to TCF" on SIMATIC IOT2040

The SIMATIC IOT2040 (and its successor IOT2050) is a ruggedized industrial edge gateway based on the Intel Quark/ARM architecture, running a Yocto-based Linux image. Engineering access is performed from the Eclipse IDE (SIMATIC IOT2000 SDK / Eclipse IDE for C/C++) over the Target Communication Framework (TCF), an Eclipse-maintained, TCP/IP-based protocol for embedded debugging, file transfer, and process control. The TCF agent runs on the IOT2040 as a system service and exposes port 1534 for the IDE to discover and attach.

When the engineering PC cannot reach the TCF agent, the Eclipse "Debug Configurations" dialog shows:

Failed to connect to TCF: 'TCF Agent (192.168.200.1)'

This error means Eclipse discovered the target entry (or a manually entered host) but could not complete the TCF handshake within the configured timeout (default 10 s). The error is independent of whether a real debug session is started; it is raised on test connection and on adding a new "TCF Agent" launcher.

Affected Hardware and Firmware

Parameter Value
Affected device SIMATIC IOT2040 (6ES7647-0AA00-0YA2)
Also applies to SIMATIC IOT2050 (6ES7647-0BA00-0YA2) — same TCF agent stack
Ethernet ports X1 (left, eth0, primary engineering port), X2 (right, eth1, fieldbus / external)
Default TCF port TCP/1534
Example SDK image SIMATIC IOT2000 SD-Card Image (Debian/Yocto) with tcf-agent ≥ 1.7.0
Engineering IDE Eclipse IDE for C/C++ Developers + SIMATIC IOT2000 plug-ins

Root Cause: Misconfigured Default Gateway

The TCF handshake opens a TCP connection from the engineering PC to port 1534 on the IOT. The IOT's Linux networking stack will accept the SYN regardless of routing — but the kernel also attempts to route the returning SYN-ACK. If the IOT has a gateway configured that is unreachable from the engineering subnet, the return path silently fails. The IDE then logs a connect timeout and surfaces it as "Failed to connect to TCF".

In a typical point-to-point setup the engineer assigns:

Host IP address Subnet mask Gateway
IOT2040 (eth0 / X1) 192.168.200.1 255.255.255.0 none
Engineering PC 192.168.200.2 255.255.255.0 none

The most common misconfiguration is to pre-fill the gateway field with the conventional 192.168.200.254 (the .254 broadcast-adjacent address). Because no such router exists on the point-to-point cable, every outbound packet from the IOT to anything outside 192.168.200.0/24 is queued for the missing gateway. The TCF return packets that originate from the IDE back to the IOT do not need a gateway (they are in the same subnet), but TCF's peer-discovery and time-sync sub-protocols exchange traffic that the IOT's agent tries to route through the default gateway. With a black-hole gateway, the handshake stalls.

Key insight: The TCP SYN from the IDE reaches the IOT, the agent responds, but the response is dropped by the kernel's routing logic when no route back exists. A ping from the PC to the IOT can still succeed because the PC has no such problem — the direction that fails is IOT → PC.

Diagnostic Procedure

Follow this sequence to confirm the gateway misconfiguration before changing anything.

  1. Verify physical layer. Use the left port (X1, eth0) on the IOT2040. The right port (X2, eth1) is reserved for fieldbus/production networks and the TCF agent binds to eth0 by default on a fresh image.
  2. Check the link. The X1 LEDs must show solid green (link) and flashing yellow (activity). If both LEDs are off, the cable or port is bad.
  3. Ping the IOT from the PC.
    C:\> ping 192.168.200.1
    Pinging 192.168.200.1 with 32 bytes of data:
    Reply from 192.168.200.1: bytes=32 time<1ms TTL=64
    If ping fails, the problem is link/IP and not TCF.
  4. Read the IOT's network configuration. Log in via the local serial console (115200 8N1 on X30) or via attached monitor + USB keyboard and run:
    root@iot2040:~# ip addr show eth0
    root@iot2040:~# ip route show default
    If ip route show default returns a non-empty line such as default via 192.168.200.254 dev eth0, the gateway is set.
  5. Verify the agent is listening.
    root@iot2040:~# systemctl status tcf-agent
    root@iot2040:~# ss -lntp | grep 1534
    LISTEN 0  10  0.0.0.0:1534  0.0.0.0:*  users:(("tcf-agent",pid=...))
    If port 1534 is not listening, the agent service is stopped; start it with systemctl start tcf-agent and systemctl enable tcf-agent.
  6. Test from the PC to port 1534 directly.
    C:\> Test-NetConnection 192.168.200.1 -Port 1534
    ComputerName: 192.168.200.1
    RemoteAddress: 192.168.200.1
    RemotePort: 1534
    InterfaceAlias: Ethernet
    TcpTestSucceeded: True
    If the port is unreachable but ping works, the misconfiguration is on the IOT side — almost always the default gateway.

Solution: Clear the Default Gateway

For a point-to-point engineering connection the gateway must be empty. Apply the fix in one of the two methods below depending on whether you configure the IOT from the console or from a DHCP/static file.

Method A — From the IOT console (temporary, lost on reboot)

root@iot2040:~# ip route del default via 192.168.200.254 dev eth0
root@iot2040:~# ip route show default
(empty result confirms fix)

Method B — Persist the change in the SD-card image

Mount the IOT's bootable SD card on a Linux PC and edit the network configuration file that the systemd-networkd / ifupdown scripts consume.

# /etc/systemd/network/eth0.network (on the IOT's rootfs)
[Match]
Name=eth0

[Network]
Address=192.168.200.1/24
# Gateway intentionally left commented
# Gateway=192.168.200.254

Reboot the IOT and re-verify with ip route show default (must be empty).

Method C — From the Engineering PC side

Equivalently, the PC must also leave its gateway blank or point to a real router on the same subnet. On Windows:

Control Panel \ Network and Sharing Center
  -> Ethernet Properties
     -> Internet Protocol Version 4 (TCP/IPv4)
        IP address:       192.168.200.2
        Subnet mask:       255.255.255.0
        Default gateway:   <blank>

Adding the TCF Agent in Eclipse

With both endpoints on the same /24 subnet and no spurious gateway, Eclipse will discover the agent automatically or you can add it manually:

  1. Open Run → Debug Configurations….
  2. Right-click C/C++ Remote ApplicationNew Configuration.
  3. On the Main tab click New… next to "Connection".
  4. In the New Connection dialog choose TCF as the type and enter:
    Host name or IP address: 192.168.200.1
    Port: 1534
  5. Click Test Connection. The dialog must show "Connection to TCF: 'TCF Agent (192.168.200.1)' is established".
  6. Click Finish and proceed to deploy/debug.

Verification Checklist

Check Expected result Command / Location
Link LEDs on X1 Green solid, yellow blink Visual
Ping IOT from PC Reply, TTL=64 ping 192.168.200.1
IOT default route Empty ip route show default
TCF agent running active (running) systemctl status tcf-agent
TCP/1534 listening LISTEN 0 0.0.0.0:1534 ss -lntp | grep 1534
PC → IOT:1534 TcpTestSucceeded : True PowerShell Test-NetConnection
Eclipse Test Connection "established" Run → Debug Configurations

Troubleshooting Matrix for Related Failure Modes

Symptom Likely cause Fix
Ping fails, no link LED Wrong port, bad cable, NIC disabled Use X1, replace cable, enable NIC
Ping works, port 1534 closed tcf-agent not running systemctl enable --now tcf-agent
Ping works, port open, Eclipse fails after 10 s Default gateway misconfiguration (this article) Clear gateway on IOT and PC
Connection succeeds, deploy fails with "permission denied" User root disabled in TCF policy Edit /etc/tcf-agent.conf and restart agent
Connection succeeds, build fails on Windows Path with spaces or non-ASCII characters Use ASCII-only workspace path
Random disconnects after 60 s Power management on PC NIC Disable "Allow the computer to turn off this device to save power"
Error: "TCF: connection refused" Firewall on PC blocks 1534 Allow inbound 1534 in Windows Defender Firewall

Background: Target Communication Framework (TCF)

TCF is a vendor-neutral, Eclipse-maintained protocol defined in the Eclipse TCF Protocol Specification. It is a TCP-based, JSON-encoded, multi-channel protocol that exposes services for memory/register access, file system operations, process control, run control, and breakpoints. TCF uses a single TCP listener (default 1534) on the target; the IDE is a peer that opens secondary data channels negotiated over the initial handshake.

Because TCF is TCP/JSON, it is sensitive to path-MTU, ARP, and routing exactly like any other TCP application. Anything that breaks the return path (firewall, asymmetric routing, ARP suppression, black-hole gateway) will surface as "Failed to connect to TCF" even when the initial SYN reaches the target.

The Eclipse TCF specification and the reference tcf-agent implementation are open source under the EPL. A cross-platform VS Code client is available as the Eclipse TCF agent repository.

Safety and Commissioning Notes

  • Apply this fix only to the engineering port. On a commissioned IOT2040/2050, the fieldbus port (X2) must keep its plant gateway. Always document which interface is which in the network drawing.
  • Before clearing the gateway on a production device, take a backup of the SD card image with dd or the Siemens PRONETA tool.
  • If the IOT is managed centrally (SIMATIC Automation Tool, SINEC NMS, or Siemens Industrial OS), change the gateway in the management system, not on the device, so the policy is not overwritten on the next sync.

Related Siemens Documentation

Why does ping work but TCF connection fails on the IOT2040?

Ping uses ICMP and the engineering PC initiates it, so the return path from the IOT is not exercised. TCF's handshake and time-sync sub-protocols cause the IOT to send return packets, and a black-hole default gateway (typically 192.168.200.254) drops those packets. Clear the gateway on the IOT and on the PC to restore the TCF connection.

Which Ethernet port of the IOT2040 must be used for the TCF agent?

Use the left port (X1, eth0) — it is the engineering port and the default interface to which the TCF agent binds on a stock IOT2000 image. The right port (X2, eth1) is reserved for the fieldbus / production network.

What is the default TCP port of the IOT2040 TCF agent?

TCP/1534. Verify with ss -lntp | grep 1534 on the IOT, and from the PC with PowerShell's Test-NetConnection 192.168.200.1 -Port 1534.

How do I make the gateway change permanent on the IOT2040?

Edit /etc/systemd/network/eth0.network on the SD card image and remove (or comment out) the Gateway= line, then reboot. Avoid setting a gateway on a point-to-point engineering connection.

Can I use TCF over Wi-Fi or routed networks?

Yes, as long as the routing is symmetric and the default gateways on both sides are reachable. On routed enterprise networks, prefer a fixed gateway that you can ping from the IOT, and make sure TCP/1534 is allowed end-to-end. Wi-Fi is supported but sensitive to roaming and power-save states — use a wired link for commissioning.

Back to blog