Skip to content

Commit d7462c2

Browse files
gijzelaerrclaude
andcommitted
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) <noreply@anthropic.com>
1 parent 0ae00fd commit d7462c2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

s7/connection.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,14 @@ def connect(
205205
if self._server_session_version is not None:
206206
self._session_setup_ok = self._setup_session()
207207
else:
208-
logger.warning("PLC did not provide ServerSessionVersion - session setup incomplete")
208+
logger.warning(
209+
"PLC did not provide a scalar ServerSessionVersion attribute. "
210+
"This is the V1-initial S7-1200 firmware band (FW < 4.5 "
211+
"predating TLS) which sends a Struct(314) value and requires "
212+
"the proprietary SessionKey handshake — not yet implemented "
213+
"in python-snap7 (tracked in issue #710). Falling back to "
214+
"legacy PUT/GET: db_read/db_write will work, browse() will not."
215+
)
209216
self._session_setup_ok = False
210217

211218
# Step 6: Version-specific post-setup

0 commit comments

Comments
 (0)