feat(ppi): add S7-200 serial transport - #824
Conversation
|
@Poseidonas You recently contributed protocol/server fixes and careful regression coverage. Could you give this PPI transport implementation a code and test review? |
|
Had a look. The framing and the client layer hold up well under abuse: I fuzzed One thing I would raise before this lands. Line corruption is not retried, only timeouts are.
The last row is the one that bothers me: a single flipped bit on a 9600 8E1 line ends the exchange, and in the case where noise is followed by a perfectly good frame the good frame is never read, because Two smaller notes, neither introduced here.
What I could not check is the wire dialogue itself. I have no S7-200, so the SD2/E5/SD1/SD2 sequence, the |
Co-Authored-By: Codex <noreply@openai.com>
|
Addressed the serial robustness findings in 992cbba.
Added regression coverage for corrupt acknowledgements, noise before a valid response, and unencodable write/read addresses. Validation: 1,804 passed, 82 skipped; full pre-commit suite and source/wheel build pass. |
|
@yangyachao you recently tested python-snap7 against a real S7-200 SMART setup in #765. Before asking you to test this PR: does that PLC expose a physical serial/PPI interface, and do you have an RS-485 adapter available?\n\nThis PR implements serial PPI, so Ethernet/port-102 testing would not validate the missing wire path. A quick yes/no on hardware availability is all we need for now. |
Summary
Initial scope
This is the first point-to-point PC-master/single-slave milestone for #614. Multi-master token passing and PPI-over-TCP are intentionally deferred until protocol traces or suitable hardware are available. The implementation is marked experimental and still needs validation against a real S7-200 PLC.
The wire exchange and area mappings follow the mature libnodave implementation:
https://github.com/netdata-be/libnodave/blob/master/nodave.c#L4077-L4220
The branch now includes current
masterthrough a merge commit.Validation
uv run --frozen pre-commit run --all-filesuv run --frozen --extra test --extra s7commplus --extra ppi pytest -q(1799 passed, 82 skipped)uv build --no-sourcesFixes #614