Python implementation of the KV4P-HT radio protocol: KISS framing, the KV4P vendor envelope, and the Kv4pRadio orchestrator (HELLO handshake, flow control, PTT, device state tracking).
Targets the v2.0.0.1 Android/FW17 protocol line.
Full documentation: https://petrkr.github.io/python-kv4p/
Install
pip install python-kv4p
Usage
from kv4p import Kv4pRadio
from kv4p.transports.serial import Kv4pSerialTransport
transport = Kv4pSerialTransport("/dev/ttyUSB0", 115200)
radio = Kv4pRadio(transport)
radio.on_rx_audio(...)
radio.on_sql(...)
with radio:
# radio.freq_rx / .bandwidth / .squelch / ... are seeded from the
# firmware's actual tuned state, reported in HELLO right after connect().
radio.set_frequency(145.500, 145.500)
radio.set_tx_allowed(True)
radio.set_ptt(True)
radio.send_tx_audio(payload)
radio.set_ptt(False)
Kv4pRadio context manager calls connect()/disconnect() automatically. connect() hardware-resets the ESP32 over RTS/DTR and blocks until HELLO is received, since the firmware only sends it once at boot — this is also how the radio’s settings properties get their initial values, straight from the firmware’s own DeviceState. Operations that need the handshake (set_frequency, set_bandwidth, set_squelch, set_ctcss, set_ptt, send_tx_audio, …) raise RadioNotReadyError if called before that.
For tests or hardware-free runs, use kv4p.transports.dummy.DummyTransport, which answers reset() with a synthetic HELLO.
Layout
kv4p/
__init__.py # Kv4pRadio, vendor encode/decode
state_tracker.py # DeviceStateTracker: handshake, device state, settings, PTT
flow_control.py # FlowControlWindow: HTTP/2-like flow control
constants/ # numeric/bit constants (kiss, vendor, messages)
protocol/ # wire framing: kiss.py
messages/ # one file per KV4P payload (dataclasses)
transports/ # Kv4pTransport interface, serial + dummy implementations
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_kv4p-0.0.1.tar.gz.
File metadata
- Download URL: python_kv4p-0.0.1.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a70ffd9dd96ee21b113e308f1f8147625b799b56026cba028868831e51d564e0
|
|
| MD5 |
64e110f3fd6c3ab09f8f597d83802e02
|
|
| BLAKE2b-256 |
a1d0f460ff382ea4e637fa27e0e226e4d27f4a35194ee10811397c75f4abbfb6
|
Provenance
The following attestation bundles were made for python_kv4p-0.0.1.tar.gz:
Publisher:
publish-pypi.yml on petrkr/python-kv4p
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_kv4p-0.0.1.tar.gz -
Subject digest:
a70ffd9dd96ee21b113e308f1f8147625b799b56026cba028868831e51d564e0 - Sigstore transparency entry: 2552555665
- Sigstore integration time:
-
Permalink:
petrkr/python-kv4p@5b50c8a96f6f34185264be928779f1f47a2ede15 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/petrkr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5b50c8a96f6f34185264be928779f1f47a2ede15 -
Trigger Event:
push
-
Statement type:
File details
Details for the file python_kv4p-0.0.1-py3-none-any.whl.
File metadata
- Download URL: python_kv4p-0.0.1-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26ffbeda8730e61ca90e5e2eac263aac90e450f8d0d9cc60063f648dca172a86
|
|
| MD5 |
401b61b6d5beef7987c5e3843bc9759b
|
|
| BLAKE2b-256 |
0eb69a537bbf78899f9c4f22ba44fa1ae46d2897aea07d285936f5eba00f88da
|
Provenance
The following attestation bundles were made for python_kv4p-0.0.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on petrkr/python-kv4p
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_kv4p-0.0.1-py3-none-any.whl -
Subject digest:
26ffbeda8730e61ca90e5e2eac263aac90e450f8d0d9cc60063f648dca172a86 - Sigstore transparency entry: 2552555802
- Sigstore integration time:
-
Permalink:
petrkr/python-kv4p@5b50c8a96f6f34185264be928779f1f47a2ede15 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/petrkr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5b50c8a96f6f34185264be928779f1f47a2ede15 -
Trigger Event:
push
-
Statement type: