From d7462c2dedbcaff5acffcfe715f5944b4219dfa7 Mon Sep 17 00:00:00 2001 From: Gijs Molenaar Date: Tue, 5 May 2026 15:52:49 -0500 Subject: [PATCH] s7: explain V1-initial firmware-band fallback to users When a real V1-initial S7-1200 (FW < 4.5) sends Struct(314) for ServerSessionVersion instead of a scalar, our session-setup echo can't run, the PLC drops the connection, and the unified Client falls back to legacy PUT/GET. The previous warning ("PLC did not provide ServerSessionVersion") was generic enough that users couldn't tell whether it was a bug, a network issue, or an unsupported firmware band. Replace with an actionable message: explains the firmware band, points at issue #710, and tells users explicitly that db_read / db_write still work but browse() will not. Refs #710. Co-Authored-By: Claude Opus 4.7 (1M context) --- s7/connection.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/s7/connection.py b/s7/connection.py index 878890bd..82cf33f7 100644 --- a/s7/connection.py +++ b/s7/connection.py @@ -205,7 +205,14 @@ def connect( if self._server_session_version is not None: self._session_setup_ok = self._setup_session() else: - logger.warning("PLC did not provide ServerSessionVersion - session setup incomplete") + logger.warning( + "PLC did not provide a scalar ServerSessionVersion attribute. " + "This is the V1-initial S7-1200 firmware band (FW < 4.5 " + "predating TLS) which sends a Struct(314) value and requires " + "the proprietary SessionKey handshake — not yet implemented " + "in python-snap7 (tracked in issue #710). Falling back to " + "legacy PUT/GET: db_read/db_write will work, browse() will not." + ) self._session_setup_ok = False # Step 6: Version-specific post-setup