chainway-serial
Asynchronous Python library for the Chainway UR4 fixed UHF RFID reader, over RS-232 and TCP, built on serialx. Requires Python >= 3.14.
uv add chainway-serial
or:
pip install chainway-serial
import asyncio
from chainway_serial import ChainwayClient
async def main() -> None:
async with ChainwayClient("socket://192.168.99.200:8888") as client:
print(await client.get_version())
async for tag in client.inventory():
print(tag.epc.hex(), tag.rssi, tag.antenna)
asyncio.run(main())
Scope
| Area | Coverage |
|---|---|
| Transports | Any serialx URL: device paths, socket://, rfc2217://, ESPHome proxies |
| Status | Firmware, STM32 and hardware versions, device ID, temperature, return loss, antenna connection state, battery |
| Module | Voltage verification, module parameters, temperature protection, work time, dual single mode, dwell time |
| RF | Per-antenna read and write power, region, fixed frequency, Gen2 parameters, RF link, FastID, TagFocus, fast inventory mode, carrier wave |
| Inventory | Mode selection, tag filter, single and continuous inventory with phase and frequency reporting, tag callbacks |
| Tag operations | Read, write, block write, block erase, lock, kill, authenticate, block permalock, Monza QT set, get, read and write, deactivate, with tag filters |
| Sensor tags | Sensor and calibration reads and writes, temperature logging, tag voltage, logged temperatures |
| Collected tags | Batch pull, full record pull, counts, delete, flash pull, for auto and trigger work modes |
| Configuration | Reader and destination addresses, work modes, trigger timing, buzzer, volume, GPO, antennas, software and factory reset |
| Peripherals | Barcode imager, buzzer with the off form, LED |
| Firmware | Bootloader jump with four targets and the update block flow |
| Discovery | UDP discovery broadcast listener |
Protocol status
The wire protocol is reverse engineered from the vendor Android, Java and Windows SDKs, cross-checked against the vendor's official protocol document and the native libraries. Every command the sources assign to the UR4 is implemented, including the module-level subset and the native library catalog, with three gaps: opcodes 0x30 and 0x97, which each carry two conflicting meanings in the sources, and the 0xF0 imager settings with undocumented payloads. No command has been verified against live hardware yet. The complete byte level reference, with every decoded payload layout and the unverified items, lives in docs/protocol.md. When a reader is available, uv run python scripts/probe_chainway.py socket://192.168.99.200:8888 exercises the read commands that need no tag in range and writes the responses to captures/.
While a continuous inventory runs, the reader answers no command except stop inventory. The client models this: other commands raise ChainwayInventoryActiveError until the scan ends.
Documentation
The full documentation is on Read the Docs.
Metadata
Release files for chainway-serial 0.2.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 | |
|---|---|---|---|
| chainway_serial-0.2.0.tar.gz | 33.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chainway_serial-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.0 kB
Release files / chainway_serial-0.2.0.tar.gz
| Download URL | chainway_serial-0.2.0.tar.gz |
|---|---|
| Size | 33.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a140e60585d62572cc558d103f533a990827863744c5dcf11b38aec78c2e28c1
|
|
BLAKE2b-256 checksum How to use checksums |
c0f138902c125ec2cfd52141e10b0aedb50a85f6101c4fd786b3ce6e335b7d57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Oct 4, 2026.
Transparency logRelease files / chainway_serial-0.2.0-py3-none-any.whl
| Download URL | chainway_serial-0.2.0-py3-none-any.whl |
|---|---|
| Size | 37.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bd57954bcabb008f5c459cb2257cb396d60af431cd049fdaf96583ac498957d
|
|
BLAKE2b-256 checksum How to use checksums |
d3fc71dd4aebecf8b522f2fc5bc7c2f69dca02e019e52785e875d21c3b19a697
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Oct 4, 2026.
Transparency log