fix(s7commplus): accept unprefixed response values - #881
Conversation
|
Added a follow-up fix based on the latest S7-1511C hardware trace. The failing DB116 offset 708 INT read previously encoded address IDs Local verification is clean: 2,078 passed, 82 skipped; all pre-commit hooks passed; sdist and wheel build passed. Please retest the same |
|
@gaurav041089 There is now a new testable head, Please install the exact revision with: python -m pip install --force-reinstall "python-snap7[s7commplus] @ git+https://github.com/gijzelaerr/python-snap7.git@95514e2"Before testing, please run this once so we can verify which files Python imports: import s7commplus
import s7commplus.connection
print(s7commplus.__file__)
print(s7commplus.connection.__file__)Then rerun the same |
|
Real-hardware evidence, since @gijzelaerr asked for a retest against the outstanding 1511C item-read failure. This branch does not fix reads on either of our CPUs. Merged onto the #892 acceptance harness and run against two bench units — byte-for-byte identical failure before and after.
Both over S7CommPlus V2 with TLS, against the canonical What the reads actually returnSame CPU (1212C), same DB, same offsets, legacy S7 alongside S7CommPlus: The legacy column is ground truth from the same CPU seconds apart, so the DB contents are correct. Size is ignored (2, 8 and 16 all return the same four bytes), offset is ignored or mis-scaled ( Why I think this is not "unprefixed response values"That framing implies the right data arriving in the wrong shape. What we see is the wrong data: a request for sixteen bytes and a request for two return the same four, and none of them is a prefix or suffix of the real contents. Identical bytes on two different CPU families suggests client-side decode rather than a per-model quirk. I cannot say whether this is the same root cause as the 1511C report — different model, and I do not have that reporter's fixture — but if it is, this PR does not close it. Full pass and methodology in #892. Both CPUs are dedicated bench units and remain available if you want a specific probe run. |
Summary
Root cause
The first #872 hardware trace exposed an unprefixed SessionKey challenge PValue. After that parser fix, DB116 reads encoded the requested size as a second nested address ID, which older S7-1500 firmware does not interpret as a byte count. The latest trace then showed a second independent problem: DB-read sequence 7 consumed a delayed protection-level response for sequence 6 and reported its payload as an item-read error.
This branch is intentionally based on #883 so the PLC retest exercises the corrected address and response-correlation paths together while keeping their reviews separate.
Validation
uv run --frozen pytest -q: 2092 passed, 82 skippeduv run --frozen pre-commit run --all-files: passeduv build --no-sources: passedHardware retesting on the unchanged S7-1511C at exact head
95514e2is still required before closing the issue.Progresses #872.