Resolving Siemens Sm@rtClient "Read Exact: Socket Error While Reading" on VPN Connections
When a remote engineering workstation attempts to control a Siemens Comfort Panel or WinCC Runtime Advanced HMI through the Sm@rtClient application over an Ewon Flexy VPN, Sinema RC client, or any routed IPSec/OpenVPN tunnel, the connection frequently fails with the dialog text Read exact: socket error while reading. The target HMI is visible in the connection list, the VNC password prompt is accepted, and the Sm@rtServer acknowledges the TCP handshake, but the first frame read from the RFB socket returns zero bytes and the client closes the channel. The fault has been reproduced on TIA Portal V15.1 projects running on TP700 Comfort through TP2200 Comfort panels, on IPC227G / IPC277G WinCC Runtime Advanced targets, and on the second-generation Unified Comfort panels when the Sm@rtServer is reached over a routed path rather than a flat LAN.
This reference consolidates the field-confirmed root causes, the diagnostic procedure, and the corrective actions that have been validated against the official Siemens documentation for the Sm@rtServer / Sm@rtClient architecture.
1. Affected Versions and Components
The following matrix summarizes the components most often associated with the reported failure. The exact firmware or TIA build is not the root cause; the underlying issue is almost always the transport path between the Sm@rtClient and the Sm@rtServer, but specific builds change which settings are exposed.
| Component | Confirmed Affected | Likely Affected | Notes |
|---|---|---|---|
| TIA Portal project (Sm@rtServer config) | V15.1, V15.1 + Upd 4 | V16, V17, V18, V19, V20 | V15.1 is the build reported in the original incident. |
| Comfort Panel OS | WinCC RT Adv 15.1 | All WinCC RT Adv from V13 SP2 onward | TP700 / TP900 / TP1200 / TP1500 / TP2200. |
| Unified Comfort Panel | Not reported in the original case | All MTP / Unified panels with Sm@rtServer | Behavior identical when reached over a tunnel. |
| Sm@rtClient | SmartClient.exe (TIA V15.1 distribution) | Browser-based Sm@rtClient, Java Web Start variant | Both are described in the Siemens TIA Cloud documentation for the Sm@rtClient application. |
| Java Runtime on engineering PC | JRE/JDK newer than 8u161 | Any OpenJDK newer than 8u202 in TLS 1.3 mode | 8u161 is the pinned build recommended by Siemens for legacy Sm@rtClient. |
| Tunnel transport | Ewon Flexy, Sinema RC | Any IPSec / OpenVPN / WireGuard tunnel | Original reports cite both Ewon and Sinema RC. |
| Physical layer change | Copper to single-mode optical fiber | Any switch of media type or L2 device | MTU/fragmentation regression after media change is a common trigger. |
2. How Sm@rtClient Reaches Sm@rtServer
Understanding the data path is essential to triage. Sm@rtClient and Sm@rtServer communicate over an RFB (Remote FrameBuffer) protocol that is functionally identical to VNC and runs on a configurable TCP port (default 5900, with a per-display offset of +0, +1, ...). The Sm@rtServer inside the HMI publishes a service that the engineering PC must reach, and the Sm@rtClient is a Java RFB viewer bundled with TIA Portal or hosted as a Web Start application.
Per the official Siemens documentation for the Sm@rtClient application, the connection is split into two phases:
- Discovery / authentication phase - the Sm@rtClient opens a TCP socket to port 5900, performs the RFB protocol version exchange, negotiates the security type (typically VNC Authentication with DES challenge/response), and validates the password. This phase is short, low-bandwidth, and tolerates latency up to several hundred milliseconds.
-
Frame exchange phase - the Sm@rtClient begins requesting framebuffer updates with
FramebufferUpdateRequestmessages and expects the server to pushFrameBufferUpdaterectangles. This phase is bandwidth-sensitive and is where the failure occurs.
The error message "Read exact: socket error while reading" is generated by the underlying Java RFB client when a readExact(n) call cannot fulfill the requested byte count from the input stream. The most common cause is a socket that is closed by an intermediate device (firewall, NAT, VPN gateway) before the full framebuffer update arrives.
3. Root Cause Analysis
Across the field cases the failure has been traced to four primary root causes, which often compound when more than one is present:
3.1 Sm@rtServer not running as a service
Per the Siemens TIA Cloud manual for Sm@rtServer, if the Sm@rtServer is started as an application rather than a Windows service on the panel, the connection is closed automatically when no user input is detected. The error manifests in the client as a socket read failure because the OS terminates the underlying socket. The service-mode setting is exposed in the WinCC RT Advanced control panel of the HMI under Sm@rtServer > Service.
3.2 Java runtime newer than 8u161
Sm@rtClient is a Java application that ships with TIA Portal. Newer Java runtime revisions removed the older TLS cipher suites, the VNC DES authentication helper, and certain socket keepalive defaults that Sm@rtClient relies on. The symptom is identical to a transport failure: the read of the framebuffer update returns zero bytes. Siemens has historically pinned Java 8 update 161 for legacy Sm@rtClient deployments; the corresponding Oracle archive download is jdk-8u161-windows-i586.exe on the Oracle Java 8 archive page.
3.3 Firewall, NAT or VPN idle timeout
When the engineering PC reaches the HMI over a tunnel, the tunnel itself, the corporate firewall in front of the HMI, or the corporate firewall in front of the engineering PC will close idle TCP sessions after a configurable period. The first FrameBufferUpdate request from Sm@rtClient is sent only after the user has interacted with the panel (mouse move, key press). If the first interaction arrives after the tunnel idle timeout, the read on the now-closed socket returns -1 and the client reports the read error.
3.4 MTU / fragmentation regression on the tunnel
FrameBufferUpdate messages can exceed 1 KiB and are commonly 16-64 KiB for full-screen refreshes. If the underlying tunnel is unable to pass full-size TCP segments - for example, after a media change from copper (MTU 1500) to single-mode optical with a lower MTU, or after enabling IPSec encapsulation - the segments are silently dropped or the MSS is not negotiated, the read stalls, and the application times out. The original incident was triggered by switching the backhaul from copper to optical fiber and restarting the RC server, which is consistent with an MTU change rather than a configuration error.
4. Diagnostic Flow
Before applying any fix, isolate the failing layer with the procedure below. Each step takes less than 60 seconds and gives a binary pass/fail that points at one of the four root causes.
- Confirm local Sm@rtClient works. Connect the engineering PC directly to the panel on the same subnet, run SmartClient.exe, and attempt the same connection. If local fails, the issue is on the HMI (project, password, service mode) and not on the tunnel.
-
Confirm reachability. From the engineering PC over the tunnel, run
tcping <panel-ip> 5900orTest-NetConnection -Port 5900 <panel-ip>in PowerShell. The TCP port must report TcpTestSucceeded : True. If the port is closed or filtered, the tunnel or firewall is blocking RFB before any Sm@rtClient logic runs. -
Check for an idle-timeout on the tunnel. From a second PowerShell window, run
ping -t <panel-ip>continuously while the Sm@rtClient is being used. If the tunnel drops ICMP echoes at the same moment the Sm@rtClient read fails, the tunnel is closing the session and the issue is firewall/NAT idle-timeout, not Java or Sm@rtServer. -
Capture a packet trace on both ends. Use Wireshark with the display filter
ip.addr == <panel-ip> && tcp.port == 5900. Confirm theFrameBufferUpdateRequestleaves the engineering PC and either a TCP RST/FIN is returned, or noFrameBufferUpdateis received. A RST/FIN from the panel or the firewall implicates the tunnel; an unanswered request with TCP retransmits implicates MTU / fragmentation. -
Verify Java version. Run
java -versionin cmd.exe. If the reported build is newer than1.8.0_161, install the pinned build and retry before changing any other setting.
tcping reports a successful TCP handshake and the Sm@rtClient still fails within 4 seconds, skip to section 5 first - Java and Sm@rtServer fixes are non-disruptive and reversible, and they are the most common cause of the read error when the tunnel itself is healthy.5. Solution: Pin Java 8 Update 161
The simplest and most common fix in the field is to roll the engineering PC back to a known-good Java runtime. Sm@rtClient is sensitive to TLS, JCE, and socket keepalive behavior that changed after 8u161.
- Open Control Panel > Programs and Features and uninstall every entry for
Java,JRE,JDK, andJava 8 Update. Restart the PC. - Download
jdk-8u161-windows-i586.exe(32-bit, even on 64-bit Windows) from the Oracle Java 8 Archive Downloads page. The 32-bit build is required because SmartClient.exe is a 32-bit Java process. - Install with default options. Do not install the Ask.com toolbar or any companion products.
- Open Control Panel > Java > Java > View and confirm that
1.8.0_161is the only enabled runtime. Disable any other installed versions or place 8u161 at the top of the user list. - Disable Java auto-update under Java > Update > Update so the pinned version is not silently replaced.
- Re-run
java -versionin a fresh cmd.exe and confirm1.8.0_161. - Retry the Sm@rtClient connection. If the failure persists, the Java fix is not the root cause and you should continue with section 6.
jvm.dll and the connection will fail before the socket is even opened. The pinned build is shipped as 32-bit specifically for this reason.6. Solution: Run Sm@rtServer as a Service
If the panel itself is the Sm@rtServer (i.e. the HMI is being controlled, not doing the controlling), Sm@rtServer must be configured to run as a service so it survives the lack of an interactive user session. Per the Siemens manual for the Sm@rtClient application, when the Sm@rtServer is started as a normal application, the connection is interrupted automatically if the user does not interact with it.
- On the panel, open Start > Control Panel > Sm@rtServer (or WinCC RT Advanced > Sm@rtServer on a PC Runtime).
- Select the Service tab and enable Start Sm@rtServer as a service.
- Enter the service password and confirm. The service is started immediately and persists across reboots.
- On the engineering PC, retry the Sm@rtClient connection. If the read error still occurs, proceed to section 7.
7. Solution: Tunnel, Firewall and MTU Adjustments
When the local connection and the Sm@rtServer service are both healthy but the tunneled connection still fails, the transport layer is at fault. Apply the three changes below in order; each one is independent and addresses a different class of transport failure.
7.1 Eliminate idle-timeout on the firewall and tunnel
Most corporate firewalls, Ewon Flexy devices, and Sinema RC servers apply a default TCP idle-timeout in the range of 60 to 300 seconds. Sm@rtClient traffic is bursty: the client sends a FrameBufferUpdateRequest only on user interaction, then waits for the response. Between interactions, the TCP session appears idle and is reaped.
- On the Ewon Flexy, raise the VPN idle timeout in the VPN configuration to a minimum of 1800 seconds, or disable the idle reaper if the platform supports it.
- On Sinema RC, raise the Connection timeout for the relevant OpenVPN/IPSEC profile to at least 1800 seconds and disable TCP-level inactivity reaping.
- On the corporate firewalls on both sides, add a permanent firewall rule that allows the engineering PC source IP, the panel destination IP, and TCP port 5900 in both directions, bypassing the global idle reaper.
7.2 Clamp the MTU on the tunnel
If the read failure coincides with a media change (e.g. copper to optical fiber), an MTU mismatch is the most likely cause. Test the path with ping -f -l <size> <panel-ip> against the engineering PC and reduce the payload size until the DF-don't-fragment echo succeeds. A typical safe value for a single-encapsulation IPSec tunnel is MTU 1400; for double-encapsulation (IPSec inside a VXLAN, or OpenVPN inside IPSec) drop to MTU 1280.
- Calculate the path MTU with
ping -f -l 1472 <panel-ip>and reduce the-lvalue in steps of 10 until the echo succeeds. - Apply the resulting MTU on the tunnel interface of the Ewon / Sinema RC gateway. The setting is typically under Network > Interfaces > MTU.
- Force the engineering PC to advertise the smaller MSS by adding the registry value
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\EnablePMTUDiscovery = 1and rebooting. - Confirm with Wireshark that the SYN from the engineering PC carries
MSS = MTU - 40matching the tunnel MTU.
7.3 Reduce the Sm@rtClient display size and color depth
Sm@rtClient supports a reduced color depth (8-bit) and a reduced window size. Both options cut the size of every FrameBufferUpdate message, which in turn reduces the probability of a fragmented or dropped segment over the tunnel.
- In SmartClient.exe, click Settings before connecting.
- Set Color depth to 8 bit.
- Set Window size to 50 % or smaller.
- Disable View only if read/write is required.
- Retry the connection.
8. Solution: TIA Portal Project-Side Sanity Check
If the project was built with TIA Portal V15.1 and later migrated, regenerate the Sm@rtServer configuration to ensure the service password, the port, and the SSL/TLS flag are all current.
- Open the project in TIA Portal.
- Navigate to Devices & Networks > <HMI device> > Sm@rtServer.
- Confirm Enable Sm@rtServer is checked, the port is
5900(or the documented alternative), and the password is set. - If the project was migrated from V13 or V14, recompile the HMI and download it to the panel to flush any stale runtime configuration.
9. VNC Authentication / Java Security Caveats
The Siemens knowledge base PDF "Why do you get an error message when opening the Sm@rtClient ..." documents the case where the Sm@rtClient opens but the browser address bar shows a red certificate error. While not the exact symptom of the socket-read error, the two are related: both stem from the Java security policy on the engineering PC, and a strict policy can also produce a socket-level read failure if the JAR signing check is enforced. Add the panel's IP and the TIA Portal installation directory to the Java Exception Site List under Control Panel > Java > Security as a precaution.
10. Verification
After each fix, validate the connection in three steps:
- Connection success: Sm@rtClient reports Connected to <panel> and displays the panel screen. Confirm that the first user input (mouse click) is registered by the panel by toggling a value in the project.
- Stability: Leave the connection idle for at least 10 minutes. If the panel does not disconnect automatically, the idle-timeout fix in section 7.1 is effective.
-
Bandwidth: Move the mouse continuously over the panel for 60 seconds. Wireshark must show full
FrameBufferUpdateresponses with no TCP retransmits. If retransmits appear, return to section 7.2 and reduce the MTU further.
11. Troubleshooting Matrix
| Symptom | Most likely cause | Fix | Reference |
|---|---|---|---|
| Local works, tunneled fails within 2-4 s | VPN / firewall idle timeout | Raise tunnel idle timeout, add firewall pinhole | Section 7.1 |
| Failure began right after media change to optical | MTU / fragmentation | Clamp tunnel MTU to 1400 or 1280 | Section 7.2 |
| Failure with Java newer than 8u161 | Java runtime incompatibility | Pin Java 8u161 (32-bit) | Section 5 |
| Failure on a panel that recently lost its image | Sm@rtServer is running as an application | Enable Sm@rtServer as a service | Section 6 |
| Browser-based Sm@rtClient shows red certificate bar | Java security policy blocks the panel | Add the panel IP to the Java Exception Site List | Section 9 |
| Local also fails | Project-side password, port, or service disabled | Recompile and re-download the HMI project | Section 8 |
| TCP SYN to 5900 is dropped | Tunnel blocks RFB port | Open port 5900 in tunnel ACL / firewall | Section 4 step 2 |
| TCP SYN succeeds but FrameBufferUpdateRequest is never answered | MTU / ICMP black hole | Reduce tunnel MTU, enable PMTU discovery | Section 7.2 |
12. Field Tips and Lessons Learned
- Always pin the Java version on every Sm@rtClient engineering station. A Windows Update can silently swap the runtime and reintroduce the read error weeks after a fix.
- When commissioning a new tunnel between an Ewon and a Comfort panel, set the tunnel MTU to 1400 from the start. The default of 1500 will eventually hit a segment that cannot be reassembled.
- If the customer reports a recurring failure every morning, suspect the tunnel's nightly rekey. Reconfigure the rekey to keep TCP sessions alive across the rekey window.
- The TIA Portal version reported in the original incident (V15.1) is not the root cause, but it is the build most commonly paired with SmartClient.exe. Migrating to a newer TIA build does not fix the socket read error - the transport must be fixed first.
- Sm@rtServer on a Comfort Panel can be reached on the same TCP port as the WinCC project; do not assume the default
5900has been changed without checking the runtime control panel.
FAQ
What does the Sm@rtClient error "Read exact: socket error while reading" mean?
It means the Java RFB client could not finish reading a framebuffer update from the Sm@rtServer socket. In practice the socket was closed by the server, a firewall, the tunnel, or by a Java runtime change, and the read returned -1 before the expected byte count was filled.
Which Java version should I install for Sm@rtClient on Windows?
Install jdk-8u161-windows-i586.exe (32-bit) from the Oracle Java 8 archive. Disable Java auto-update so the pinned version is not replaced. SmartClient.exe is a 32-bit Java process and requires the 32-bit runtime even on a 64-bit Windows host.
Why does Sm@rtClient work locally but fail over Ewon or Sinema RC?
The most common reasons are TCP idle-timeout on the tunnel, MTU / fragmentation after a media change, and the Sm@rtServer running as an application rather than a service. Run the diagnostic flow in section 4 to identify which one applies.
Does the TIA Portal version (V15.1 vs V16/V17/V18) cause the socket read error?
No. The TIA build determines which Sm@rtClient options are exposed, but the read error itself is caused by the transport or the Java runtime, not by the project version. Migrating the project will not fix a tunnel issue.
How do I make Sm@rtServer survive a reboot on a Comfort Panel?
Open the panel's Sm@rtServer control panel, switch to the Service tab, enable Start Sm@rtServer as a service, and enter the service password. The service will then start automatically and persist across reboots, preventing the auto-disconnect that produces the read error.
What is the default TCP port for Sm@rtClient and Sm@rtServer?
The default RFB port is 5900, with a per-display offset of +0, +1, +2, and so on. The port is configurable in the TIA Portal Sm@rtServer settings and must match in the Sm@rtClient connection dialog.