Skip to content

Complete S7CommPlus V1 session handshake#661

Merged
gijzelaerr merged 1 commit intomasterfrom
s7commplus-session-setup
Mar 27, 2026
Merged

Complete S7CommPlus V1 session handshake#661
gijzelaerr merged 1 commit intomasterfrom
s7commplus-session-setup

Conversation

@gijzelaerr
Copy link
Copy Markdown
Owner

Summary

  • Parse ServerSessionVersion (attribute 306) from the CreateObject response and echo it back to the PLC via SetMultiVariables, completing the V1 session handshake
  • Remove the probe-based fallback (_probe_s7commplus_data) — instead use the session setup result to decide whether to fall back to legacy S7
  • This should fix ERROR2 (0x05A9) rejections on real S7-1200/1500 PLCs (e.g. 1214C with firmware v4.0)

Test plan

  • All 1320 existing tests pass (including server integration tests with emulated S7CommPlus)
  • Verify against real S7-1200/1500 PLC: pytest tests/test_s7commplus_e2e.py --e2e --plc-ip=<IP> --plc-port=<PORT> -v

🤖 Generated with Claude Code

Instead of probing data operations and falling back on ERROR2, properly
complete the V1 session setup by parsing ServerSessionVersion (attribute
306) from the CreateObject response and echoing it back via
SetMultiVariables. This should fix the ERROR2 (0x05A9) rejections from
real S7-1200/1500 PLCs with firmware v4.0+.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gijzelaerr gijzelaerr merged commit bf1ecfd into master Mar 27, 2026
37 checks passed
gijzelaerr added a commit that referenced this pull request Mar 27, 2026
Resolve conflicts in s7/_s7commplus_client.py and
s7/_s7commplus_async_client.py — keep our refactored versions
which already include the session setup fix from #661 but
without the fallback logic (now owned by s7.Client).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant