Skip to main content

uhfreader18

PyPI version Python License: MIT CI

Dependency-free Python library for the UHFReader18 binary protocol. Supports command/response operations, CRC-validated response parsing, TCP stream reassembly, autonomous tag reports, heartbeats, and a receive-server CLI.

uhfreader18 talks to the RFID reader protocol. For HW-VX6330K / HW-VX6346KL module discovery and network/serial configuration, use hw-vx-config.

Features

  • Build UHFReader18 command and response frames.
  • Validate CRC-16/CCITT-reflected checksums.
  • Read reader information and change reader address, power, or scan time.
  • Discover the reader's configured address through broadcast 0xFF.
  • Reassemble fragmented or combined TCP response streams.
  • Parse autonomous 0xEE tag reports and six-byte heartbeats.
  • Filter pushed frames by reader-address allowlist.
  • Run a dependency-free TCP receive server.
  • Typed package with no runtime dependencies.

Requirements

  • Python 3.10 or newer
  • TCP access to a UHFReader18 reader, directly or through a serial-to-Ethernet bridge

Install

pip install uhfreader18

Command Client

from uhfreader18 import RfidClient

with RfidClient("192.168.1.100", 2077) as reader:
    info, address = reader.discover_address()
    print(f"address=0x{address:02X}")
    print(f"firmware={info.version}")
    print(f"power={info.power} dBm")

Supported high-level operations:

with RfidClient("192.168.1.100", 2077) as reader:
    info = reader.get_reader_info(adr=0x00)
    reader.set_address(current_adr=0x00, new_adr=0x01)
    reader.set_power(adr=0x01, power=30)
    reader.set_scan_time(adr=0x01, scan_time=10)

The reader protocol handles one command at a time. RfidClient waits for a complete matching response and handles TCP fragmentation internally.

Parse a Push Stream

TCP does not preserve message boundaries. Keep one StreamBuffer per connection and feed every received chunk in arrival order:

from uhfreader18 import StreamBuffer

stream = StreamBuffer(allowed_readers={0x00, 0x01})
result = stream.feed(tcp_bytes)

for frame in result.frames:
    print(frame.tag, frame.reader_address, frame.command_name)

for heartbeat in result.heartbeats:
    print("heartbeat", heartbeat.hex_readable())

for error in result.errors:
    print("protocol error", error)

Frame.tag renders the response data as uppercase hex after removing trailing NUL bytes. It remains an opaque report value: available captures do not yet prove where flags, antenna metadata, EPC, and padding split for every reader.

Build Frames

from uhfreader18 import Command, Status, build_command_frame, build_response_frame

command = build_command_frame(0x00, Command.GET_READER_INFO)
report = build_response_frame(
    0x00,
    Command.TAG_REPORT,
    Status.SUCCESS,
    bytes.fromhex("2000708C2B380B2D00000000"),
)

Receive Server

uhfreader18-server
uhfreader18-server --host 0.0.0.0 --port 2077
uhfreader18-server --allowed-readers 00,01
uhfreader18-server --fields tag,reader,peer
uhfreader18-server --debug

The server validates and logs reports. Applications needing custom sinks should use StreamBuffer directly.

Protocol

Response frame:

Len | Adr | reCmd | Status | Data[] | CRC-16 LSB | CRC-16 MSB

Command frame:

Len | Adr | Cmd | Data[] | CRC-16 LSB | CRC-16 MSB

CRC parameters:

  • preset: 0xFFFF
  • polynomial: 0x8408
  • storage: little-endian

Observed heartbeat:

56 00 00 00 00 00

Further reading:

Package Relationship

flowchart LR
    APP[Application] --> CONFIG[hw-vx-config]
    APP --> RFID[uhfreader18]
    CONFIG -->|runtime dependency| RFID
    CONFIG <-->|UDP configuration| HWVX[HW-VX module]
    RFID <-->|TCP command/response| HWVX
    HWVX -->|TCP tag push| RFID
  • hw-vx-config: HW-VX discovery, network settings, serial settings, DHCP, reboot.
  • uhfreader18: RFID command/response and autonomous push-stream protocol.

Development

python -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"
ruff check src tests
ruff format --check src tests
pyright
pytest
python -m build
python -m twine check dist/*

Tests use fake sockets and captured frame bytes; no hardware is required.

Current Limits

  • High-level inventory/read/write tag methods are not implemented.
  • 0xEE payload fields remain opaque until more hardware captures establish layout.
  • Networking API is synchronous; no async client or server contract.
  • Hardware verification currently covers the captured push frame and operations inherited from hw-vx-config; test additional reader firmware before relying on uncommon commands.

License

MIT — see LICENSE.

Metadata

Release files for uhfreader18 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uhfreader18 0.2.0
File Size Uploaded Provenance Actions
uhfreader18-0.2.0.tar.gz 20.1 kB With provenance Details for uhfreader18-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uhfreader18 0.2.0
File Interpreter ABI Platform Actions
uhfreader18-0.2.0-py3-none-any.whl Python 3 none any Details for uhfreader18-0.2.0-py3-none-any.whl

Total release size: 36.8 kB

Release files / uhfreader18-0.2.0.tar.gz

Download URL uhfreader18-0.2.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4258edef702c0a1ac7f4654a76084bd401350e38b20870ececd3fb7b9bb35e7d
BLAKE2b-256 checksum
How to use checksums
e62347d960702fb4f38adc9d9fb197749a324cbe135f3fc13e96ccf97fdf5d33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / uhfreader18-0.2.0-py3-none-any.whl

Download URL uhfreader18-0.2.0-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26dada889d69cd4ad3165f2bf2299de9dad05f4659a67a3bfe9d5f6f65663966
BLAKE2b-256 checksum
How to use checksums
66c100659f957ed3558d7c5c7f39e691c309abff88c73c4bd10c9f617c32f7c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Security for uhfreader18 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for uhfreader18-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page