Skip to content

H firmware fix - #12

Open
azebro wants to merge 30 commits into
litinoveweedle:mainfrom
azebro:H-firmware-fix
Open

H firmware fix#12
azebro wants to merge 30 commits into
litinoveweedle:mainfrom
azebro:H-firmware-fix

Conversation

@azebro

@azebro azebro commented Mar 7, 2026

Copy link
Copy Markdown

This pull request introduces Python ports of the TapTap protocol, improves documentation, and fixes critical protocol parsing issues with H-firmware gateways. The most important changes are grouped below by theme:

Protocol Parsing Fixes:

  • Fixed H-firmware (H1.0007) TAP RECEIVE_RESPONSE parsing by removing overly-strict status_type & 0x00E0 validation that previously rejected most responses from H-firmware gateways, ensuring power reports are no longer silently dropped.
  • Updated docs/protocol.md to clarify that only bits 0-4 of the status type determine payload structure, and bits 5-7 are firmware-dependent flags with no effect on payload structure, including new examples for both G- and H-firmware formats. [1] [2] [3] [4]

Platform and Configuration Improvements:

  • TCP keepalive with_retries() configuration now correctly excludes Windows, where the API is unavailable.

Documentation Enhancements:

  • Added a comprehensive implementation overview in docs/implementation/00-overview.md, detailing TapTap's architecture, data flow, module organization, design patterns, and testing strategy for both Rust and Python ports.
  • Updated README.md to announce and document two new Python ports: pytap (simplified parser) and taptap-python (full protocol port), with installation instructions and feature summaries. [1] [2]

General Documentation Updates:

  • Updated docs/protocol.md and CHANGELOG.md to document H-firmware status type format and parsing changes. [1] [2]

These changes collectively improve protocol compatibility, expand accessibility via Python, and provide clearer documentation for both users and developers.

Copilot AI and others added 30 commits February 15, 2026 16:07
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
Co-authored-by: azebro <1090464+azebro@users.noreply.github.com>
- Created REVIEW.md to detail architecture and implementation review findings, including missing functionality, interface mismatches, and bugs.
- Established action items for critical and important issues to address in the Python port.
- Added REVIEW_FOLLOWUP.md to summarize the resolution of action items, confirming all critical and important issues were fixed, with increased test coverage.
- Implemented test_observer_state.py to validate Observer and PersistentState integration, covering state serialization, enumeration state machine, and node table accumulation.
- Introduced test_received_packets.py to ensure proper functioning of the ReceivedPackets iterator, including edge cases and error handling.
- Introduced tests for the public API in `test_api.py`, validating parser creation, byte parsing, connection handling, versioning, and accessibility of exports.
- Added tests for barcode encoding/decoding in `test_barcode.py`, covering known addresses, roundtrip encoding/decoding, error handling, and convenience functions.
- Implemented CRC-16-CCITT tests in `test_crc.py`, ensuring correct CRC calculations for various input scenarios.
- Developed comprehensive tests for the protocol parser in `test_parser.py`, including frame accumulation, CRC error handling, enumeration sequence processing, and parser state management.
- Created tests for protocol types in `test_types.py`, validating GatewayID, Address, FrameType, SlotCounter, and PowerReport functionalities, including edge cases and expected behaviors.
Complete Python port of Tigo TAP protocol observer
- Updated the ReceiveResponse class in Python and Rust to remove the strict check for status_type bits 5-7, allowing for proper parsing of H-firmware responses.
- Added unit tests for various H-firmware status types to ensure correct handling of optional fields.
- Documented the differences in status byte handling between G and H firmware in the new tigo_parsing.md file.
- Adjusted TCP keepalive configuration comments for clarity regarding platform compatibility.
- Documented known frame types and their statuses.
- Detailed the RECEIVE_RESPONSE status byte differences across firmware versions.
- Identified and described various packet types in the PV application layer.
- Provided insights into unknown fields in COMMAND_REQUEST and RECEIVE_REQUEST payloads.
- Included detailed formats for power reports and PV configuration requests/responses.
- Captured live observations and hypotheses for further investigation.
- Documented known frame types and their statuses.
- Detailed the RECEIVE_RESPONSE status byte differences across firmware versions.
- Identified and described various packet types in the PV application layer.
- Provided insights into unknown fields in COMMAND_REQUEST and RECEIVE_REQUEST payloads.
- Included detailed formats for power reports and PV configuration requests/responses.
- Captured live observations and hypotheses for further investigation.
- Added new frame types: ENUMERATION_END_RESPONSE_2 (0x0E03), CHANNEL_QUERY_REQUEST (0x000E), and CHANNEL_QUERY_RESPONSE (0x000F) with detailed payload descriptions.
- Clarified byte[0] behavior as a super-epoch counter, including its cycling pattern and significance.
- Updated unknown_a and unknown_b fields to reflect constant values observed across all TAPs.
- Introduced extended 15-byte format for power reports, detailing new fields and their meanings.
- Documented live capture sessions, highlighting new discoveries and frame types, including the CCA boot sequence and PV_CONFIG_REQ response types.
- Added observations on node firmware variants and topology report decoding with next-hop routing.
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.

2 participants