A cross-platform library for Bluetooth communication with Benshi radios like the Vero VR-N76, RadioOddity GA5WB, and BTech UV-Pro.
Project description
benlink
benlink is a cross-platform Python library for communicating with and
controlling Benshi radios (e.g. Vero VR-N76, RadioOddity GA-5WB, BTech UV-Pro)
over BLE and Bluetooth Classic (RFCOMM).
In addition to providing a high-level async Python interface for controlling Benshi radios, the larger goal of this project is to document their BLE / RFCOMM protocol. An understanding of the protocol used by these radios will empower Benshi radio owners and the wider open source community to:
-
Control their radios without relying on proprietary apps or software.
-
Extend the functionality of their radios through custom software and integrations.
-
Preserve the usability of their radios, even when the official "HT" app is no longer supported or updated.
It is a work in progress and is nowhere close to feature complete. Pull requests are welcome!
Software / Hardware Support
benlink uses bleak for BLE communication,
making it compatible with Windows, macOS, and Linux. RFCOMM support is via
python's built-in socket module, and also works on Windows, macOS, and Linux.
(Although automatic service discovery for RFCOMM
isn't supported yet).
The following radios should work with this library:
- BTech UV-Pro
- RadioOddity GA-5WB
- Vero VR-N76 (untested)
- Vero VR-N7500 (untested)
- BTech GMRS-Pro (untested)
If you know of other radios that use the same Benshi BLE / RFCOMM protocol, please open an issue to let me know!
Installation
To install the latest stable version of benlink from PyPI:
pip install benlink
If you're wanting to contribute to the project, clone the repository and install it in "editable" mode with
pip install -e .
Quick Start
First, make sure your radio is paired with your computer, and get its device
UUID (e.g. XX:XX:XX:XX:XX:XX).
The following will connect to the radio and print its device info:
import asyncio
from benlink.controller import RadioController
async def main():
async with RadioController.new_ble("XX:XX:XX:XX:XX:XX") as radio:
print(radio.device_info)
asyncio.run(main())
Next Steps
To see what else you can do with this library, check out the examples in the benlink.controller module documentation.
Other Projects
Benlink has already begun to inspire other projects! Here are some that I know of so far:
If you've found benlink's documentation of the Benshi protocol helpful, or use benlink in your own project, please let me know so I can add it to this list.
Known issues
If you don't have the audio RFCOMM socket open, and try to send any data with
benlink.controller.RadioController.send_tnc_data, it will immediately reply
with a INCORRECT_STATE error. If you immediately retry the command within two
seconds, it will work. I plan to add a higher-level interface for sending /
receiving TNC data that will automatically retry failed commands and queue /
combine message fragments. See
this open issue for more info.
Audio sending / receiving is a awkward because it relies on pyav for decoding / encoding. In the long run, I hope to make Python bindings for libsbc.
Roadmap
Things to do:
- Improve audio sending / receiving with bindings to libsbc (issue)
- Make a higher-level interface for sending / receiving TNC data (auto retry, queue message fragments) (issue)
- Figure out firmware flashing process / protocol (this is key for long-term independence from the HT app) (issue)
- Implement more commands and settings
- Find more radios that use this protocol and test them with this library
Acknowledgements
@spohtl for help figuring out audio transmit / receive
@na7q for early testing and feedback
Disclaimer
This project is an independent grassroots effort, and is not affiliated with or endorsed by Benshi, Vero, RadioOddity, BTech, or any other company.
Use this library at your own risk. I am not responsible for any damage caused to your radio or any other equipment while using this library.
Project details
Release history Release notifications | RSS feed
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 benlink-0.1.1.tar.gz.
File metadata
- Download URL: benlink-0.1.1.tar.gz
- Upload date:
- Size: 39.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0377b3aae09a45532b91bc908e4520dd02c8cfd306871e28358ede64ffba169
|
|
| MD5 |
1a27c2f0c8d45a67ad14e667d3eeae0b
|
|
| BLAKE2b-256 |
600c1d874b8350a55f0b56ff7f1bfc9bb4aad43e986b15ca576390d6a3b04bec
|
Provenance
The following attestation bundles were made for benlink-0.1.1.tar.gz:
Publisher:
publish-release.yml on khusmann/benlink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
benlink-0.1.1.tar.gz -
Subject digest:
e0377b3aae09a45532b91bc908e4520dd02c8cfd306871e28358ede64ffba169 - Sigstore transparency entry: 171438622
- Sigstore integration time:
-
Permalink:
khusmann/benlink@60deebf361a6178146e93192afe962a052d8b49a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/khusmann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yml@60deebf361a6178146e93192afe962a052d8b49a -
Trigger Event:
push
-
Statement type:
File details
Details for the file benlink-0.1.1-py3-none-any.whl.
File metadata
- Download URL: benlink-0.1.1-py3-none-any.whl
- Upload date:
- Size: 46.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fbe7d0512ac616c9ab9b0e81c777d208abd00b60550e46ed62ee30165df7a5e
|
|
| MD5 |
dcbebd95a94d7e3e281ca2ddd5cdb8a1
|
|
| BLAKE2b-256 |
f2c433c057068afc00f41e973379ea5a88000a0884ade27e70437a4929c174d5
|
Provenance
The following attestation bundles were made for benlink-0.1.1-py3-none-any.whl:
Publisher:
publish-release.yml on khusmann/benlink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
benlink-0.1.1-py3-none-any.whl -
Subject digest:
2fbe7d0512ac616c9ab9b0e81c777d208abd00b60550e46ed62ee30165df7a5e - Sigstore transparency entry: 171438623
- Sigstore integration time:
-
Permalink:
khusmann/benlink@60deebf361a6178146e93192afe962a052d8b49a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/khusmann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yml@60deebf361a6178146e93192afe962a052d8b49a -
Trigger Event:
push
-
Statement type: