update README for Bluetooth LE service discovery

This commit is contained in:
F. Duncanh
2025-11-03 01:50:23 -05:00
parent 5df5e56ac2
commit 5489305031
3 changed files with 119 additions and 79 deletions

View File

@@ -3,19 +3,20 @@
### **Now developed at the GitHub site <https://github.com/FDH2/UxPlay> (where ALL user issues should be posted, and latest versions can be found).**
- **NEW on github**: Support for **service discovery using a Bluetooth
LE "beacon"** (as an alternative to Bonjour/Rendezvous DNS-SD
service discovery). The user must set up a Bluetooth LE "beacon", (a
USB 4.0 or later "dongle" can be used). See instructions below. The
beacon runs independently of UxPlay and regularly broadcasts a
Bluetooth LE ("Low Energy") 46 byte packet informing nearby
iOS/macOS devices of the local IPv4 network address of the UxPlay
server, and which TCP port to contact UxPlay on. A python script
(Python \>=3.6) "uxplay-beacon.py", to broadcast the
Service-Discovery advertisement will be installed on systems with
DBus support (Linux and \*BSD, using BlueZ for Bluetooth control):
this does **not** require enhanced "root permissions" to run. A
windows version of this script is also planned for the future.
Instructions are [given below](#bluetooth-le-beacon-setup).
LE "beacon"** for both Linux/\*BSD and Windows (as an alternative to
Bonjour/Rendezvous DNS-SD service discovery). The user must set up a
Bluetooth LE "beacon", (a USB 4.0 or later "dongle" can be used).
See instructions below. The beacon runs independently of UxPlay and
regularly broadcasts a Bluetooth LE ("Low Energy") 46 byte packet
informing nearby iOS/macOS devices of the local IPv4 network address
of the UxPlay server, and which TCP port to contact UxPlay on. Two
versions of a Python script (Python \>=3.6) "uxplay-beacon.py", (one
for Linux/\*BSD using BlueZ LEAdvertisingManager1 with DBus, and one
for Windows using winrt/BluetoothLEAdvertisementPublisher) are ready
for users to run: the appropriate version will be installed when
UxPlay is built. They independently run Service-Discovery beacons
that iOS devices respond to. Instructions are [given
below](#bluetooth-le-beacon-setup).
- **NEW on github**: option `-vrtp <rest-of-pipeline>` bypasses
rendering by UxPlay, and instead transmits rtp packets of decrypted
@@ -1516,20 +1517,27 @@ this to see even more of the GStreamer inner workings.
# Bluetooth LE beacon setup
The python\>=3.6 script for running a Bluetooth-LE Service Discovery
beacon is uxplay-beacon.py. Currently only a DBus version (for Linux and
\*BSD) is available, and it is only installed on systems which support
DBus. Bluetooth \>= 4.0 hardware on the host computer is required: a
cheap USB bluetooth dongle can be used. Bluetooth support (BlueZ) must
be installed (on Debian-based systems:
`sudo apt install bluez bluez-tools`; recent Ubuntu releases provide
bluez as a snap package).
beacon is uxplay-beacon.py. It comes in two versions, one (for Linux and
\*BSD) is only installed on systems which support DBUS, and another only
for Windows 10/11. Bluetooth \>= 4.0 hardware on the host computer is
required: a cheap USB bluetooth dongle can be used.
In addition to standard Python3 libraries, you may need to install the
gi, dbus, and psutil Python libraries used by uxplay-beacon.py. On
Debian-based systems:
On Linux/\*BSD, Bluetooth support (BlueZ) must be installed (on
Debian-based systems: `sudo apt install bluez bluez-tools`; recent
Ubuntu releases provide bluez as a snap package). In addition to
standard Python3 libraries, you may need to install the gi, dbus, and
psutil Python libraries used by uxplay-beacon.py. On Debian-based
systems:
sudo apt install python3-gi python3-dbus python3-psutil
For Windows support on MSYS2 UCRT systems, use pacman -S to install
`mingw-w64-ucrt-x86_64-python`, `*-python-gobject`, `*-python-psutil`,
and `*-python-pip`. Then install winrt bindings
`pip install winrt-Windows.Foundation.Collections`,
`winrt-Windows.Devices.Bluetooth.Advertisement` and
`winrt-Windows.Storage.Streams`.
If uxplay will be run with option "`uxplay -ble`" (so it writes data for
the Bluetooth beacon in the default BLE data file `~/.uxplay.ble`), just
run `uxplay-beacon.py` in a separate terminal. The python script will
@@ -1540,12 +1548,14 @@ advertising if UxPlay later reappears). The script will remain active
until stopped with Ctrl+C in its terminal window (or its terminal window
is closed).
The beacon script can be more finely controlled using five possible
options: these can be given on the command line, or read from a
configuration file `~/.uxplay.beacon`, if it exists. Configuration file
entries are like the command line forms, one per line (e.g.,
The beacon script can be more finely controlled using certain options:
these can be given on the command line, or read from a configuration
file `~/.uxplay.beacon`, if it exists. Configuration file entries are
like the command line forms, one per line (e.g.,
`--ipv4 192.168.1.100`). Lines commented out with an initial `#` are
ignored. Command line options override the configuration file options.
Get help with `man uxplay-beacon` or `uxplay-beacon.py --help`. Options
are
- `--file <config file>` read beacon options from `<config file>`
instead of `~/.uxplay.beacon`.
@@ -1561,6 +1571,9 @@ ignored. Command line options override the configuration file options.
This also requires that uxplay is run with option
"`uxplay -ble <BLE data file>`".
The BlueZ/Dbus version has thee more options not offered by the Windows
version:
- `--AdvMin x`, `--AdvMax y`. These controls the interval between BLE
advertisement broadcasts. This interval is in the range \[x, y\],
given in units of msecs. Allowed ranges are 100 \<= x \<= y
@@ -1587,15 +1600,16 @@ can disable DNS_SD Service discovery by the avahi-daemon with
To restore DNS_SD Service discovery, replace "mask" by "unmask", and
"stop" by "start".
For more information, see the [wiki
page](https://github.com/FDH2/UxPlay/wiki/Bluetooth_LE_beacon) This has
useful information if you wish to build a python beacon controller
script for Windows (we would like to have one!).
On Windows, the Bonjour Service is controlled using **Services
Management**: press "Windows + R" to open the Run dialog, run
`services.msc`, and click on **Bonjour Service** in the alphabetic list.
This will show links for it to be stopped and restarted.
- **Our current understanding is that Bluetooth LE AirPlay Service
Discovery only supports broadcast of IPv4 addresses. Please let us
know if this is incorrect, or if IPv6 support is introduced in the
future.**
For more information, see the [wiki
page](https://github.com/FDH2/UxPlay/wiki/Bluetooth_LE_beacon)
- **Note that Bluetooth LE AirPlay Service Discovery only supports
broadcast of IPv4 addresses**.
# Troubleshooting