BLE library for the BlueRetro retro-console Bluetooth adapter
Project description
blueretro-ble
Talk to a BlueRetro retro-console Bluetooth adapter over Bluetooth LE from Python — read its status and current game, read and change the global/output config, and reboot or deep-sleep it.
This library powers the BlueRetro Home Assistant integration, but works standalone in any async Python project (or straight from the command line).
Features
- 🔌 Async BLE control built on
bleak+bleak-retry-connector— works on Linux, macOS, and Windows. - 📊 Read device state — firmware, ABI version, BD address, current game id + resolved game name, and config source.
- ⚙️ Read & write config — system, multitap, pairing mode and memory-card bank (global config), plus per-output device mode and accessory.
- 🔁 Commands — reboot, deep sleep, and factory reset.
- 🔍 Discovery helper —
discover()finds nearby BlueRetro adapters. - 🖥️ CLI —
blueretro scan / info / reboot / sleepfor quick testing. - 🏷️ Bundled game database — resolves a Game ID to a human-readable name.
Requirements
- Python 3.11 or newer.
- A Bluetooth LE adapter (built-in or USB).
- A BlueRetro adapter, reachable only while idle (no controller connected).
Installation
pip install blueretro-ble
CLI usage
blueretro scan # find nearby adapters
blueretro info AA:BB:CC:DD:EE:FF # connect and print the full state
blueretro reboot AA:BB:CC:DD:EE:FF # reboot the adapter
blueretro sleep AA:BB:CC:DD:EE:FF # put the adapter into deep sleep
Library usage
import asyncio
from blueretro_ble import BlueRetroDevice, discover
async def main():
devices = await discover()
device = BlueRetroDevice()
state = await device.async_update(devices[0])
print(state.fw_version, state.system, state.game_name)
# change the emulated accessory on output port 1
await device.async_set_output_config(devices[0], 0, accessory="Memory")
asyncio.run(main())
BlueRetroDevice methods accept a bleak BLEDevice (e.g. from Home Assistant's
shared scanner or an ESPHome Bluetooth proxy). async_update connects, reads
everything, always disconnects, and never raises — on failure it returns a
BlueRetroState(available=False).
How it works
BlueRetro exposes a GATT service whose characteristics carry the configuration
and a command channel; blueretro_ble reads/decodes them and sends 1-byte
commands.
- Service UUID:
56830f56-5180-fab0-314b-2fa176799a00 - The configuration is only reachable while the adapter is idle (no controller paired).
- The protocol is reverse-engineered from the official
BlueRetroWebCfg. See
HARDWARE.mdfor the full notes.
Limitations
- The adapter only accepts connections while idle — during gameplay
async_updatereturns an unavailable state. - Dreamcast VMU (memory card) transfer needs a large BLE MTU; over stacks stuck at MTU 23 it is unreliable — use the official web config for VMU backup/restore.
Contributing
See CONTRIBUTING.md.
License
MIT © Hudson Brendon
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 blueretro_ble-0.7.0.tar.gz.
File metadata
- Download URL: blueretro_ble-0.7.0.tar.gz
- Upload date:
- Size: 354.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6eba0d3644826ad82ed6fab159c0a12de3e34dd61723938e8986b35b3d1259f9
|
|
| MD5 |
c0bad81ff3a0579e5682cc9090bd5baa
|
|
| BLAKE2b-256 |
e9921bb14168c4dd8d4a4ec5526594aa4c267e16c4033e261766c0d0d8431b59
|
Provenance
The following attestation bundles were made for blueretro_ble-0.7.0.tar.gz:
Publisher:
publish.yml on hudsonbrendon/blueretro-ble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blueretro_ble-0.7.0.tar.gz -
Subject digest:
6eba0d3644826ad82ed6fab159c0a12de3e34dd61723938e8986b35b3d1259f9 - Sigstore transparency entry: 1672126519
- Sigstore integration time:
-
Permalink:
hudsonbrendon/blueretro-ble@cd642802e187902269ff8eeaf698cf0ece525ba8 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/hudsonbrendon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cd642802e187902269ff8eeaf698cf0ece525ba8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file blueretro_ble-0.7.0-py3-none-any.whl.
File metadata
- Download URL: blueretro_ble-0.7.0-py3-none-any.whl
- Upload date:
- Size: 279.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20c581d9efe0b8254b26b9850c1d5c2e1f480d0aa37ef945f79b7048b5da4f4b
|
|
| MD5 |
00b7d3a5010ecb9e04cc4ba450d935ce
|
|
| BLAKE2b-256 |
e9c034ebc0a7209f2f1ad2b8ef5ef5c0df9bf100c6d44f476a9b95a7f7baca84
|
Provenance
The following attestation bundles were made for blueretro_ble-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on hudsonbrendon/blueretro-ble
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blueretro_ble-0.7.0-py3-none-any.whl -
Subject digest:
20c581d9efe0b8254b26b9850c1d5c2e1f480d0aa37ef945f79b7048b5da4f4b - Sigstore transparency entry: 1672126540
- Sigstore integration time:
-
Permalink:
hudsonbrendon/blueretro-ble@cd642802e187902269ff8eeaf698cf0ece525ba8 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/hudsonbrendon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cd642802e187902269ff8eeaf698cf0ece525ba8 -
Trigger Event:
release
-
Statement type: