uhfreader18
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
0xEEtag 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:
docs/PROTOCOL.md: TCP push protocol, frame layout, pcap dissectiondocs/DOCUMENTATION.md: full RS232/RS485 command set from the UHFReader18 User's Manual V2.0docs/captures/: packet captures
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.
0xEEpayload 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.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uhfreader18-0.3.0.tar.gz | 22.4 kB | With provenance | Details for uhfreader18-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uhfreader18-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for uhfreader18-0.3.0-py3-none-any.whl |
Total release size: 39.7 kB
Release files / uhfreader18-0.3.0.tar.gz
| Download URL | uhfreader18-0.3.0.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d833ad6e914d9c936485a6815518cdcc56bce775c9de8b3b810250f91ccf3b2
|
|
BLAKE2b-256 checksum How to use checksums |
4b0f54043d1d148e09d24daed10dfef77cb61131032cf72759cf5c72c5f31677
|
| 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 logRelease files / uhfreader18-0.3.0-py3-none-any.whl
| Download URL | uhfreader18-0.3.0-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b524cb36eea520191871224c3a3c20da26bf2db5ffc819ebbd16b4a4263ad8d2
|
|
BLAKE2b-256 checksum How to use checksums |
3f5f98a9f5052f74d58a0cf8973eccaf53708bf860fbb9963e662f655eae5abc
|
| 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 logSecurity for uhfreader18 0.3.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.
Attestation for uhfreader18-0.3.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 logA 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.