Discover and control SteamVR lighthouses (versions 1.0 and 2.0)
- Windows 10
- Bluetooth 4.0/BLE chip (integrated or external), managed by Windows
- Python 3.6
- bleak BLE library, minimum version 0.10.0
Search the local environment for lighthouses: ./lighthouse-keeper.exe discover
Once you have the MAC addresses of the lighthouses you wish to control, you must specify the command you wish to send (on
/off
), the version of the lighthouses (1
/2
) and then a space-separated list of MAC addresses for the devices to send the command to.
Typically, HTC Vive lighthouses with the flat front are version 1.0 (1
) and Valve-branded lighthouses with the curved front are 2.0 (2
). The output of discover
will tell you which versions it has found.
Turn the specified 1.0 lighthouses on: ./lighthouse-keeper.exe on 1 80:7A:BF:15:1F:88 80:7A:BF:15:28:8C
Turn the specified 2.0 lighthouses off: ./lighthouse-keeper.exe off 2 FE:D0:49:F5:78:D6 E2:81:7F:AC:2B:ED
Add the -d
flag to any command to print additional information (including BLE signal strength) and a log file which includes further information from the Bluetooth library.
This commonly occurs if Windows does not have control of the Bluetooth stack, usually because a manufacturer driver is being used instead, such as CSR Harmony. Uninstalling these and rebooting or re-inserting the Bluetooth dongle should resolve this issue.
When you first run discover
, Windows should prompt you to pair each device, you will need to do this within a few seconds or the notification will disappear and the script will terminate. Once you've done this once, the script should work correctly.
PyInstaller is used to generate an executable from the source. Run the following command in the root folder:
pyinstaller --onefile .\lighthouse_keeper.py
If you install PyInstaller via pip
, Windows Defender will often flag any compiled executables. You can typically fix this by compiling PyInstaller's bootloader yourself and installing it manually, rather than using pip
.
git clone https://github.com/pyinstaller/pyinstaller
cd pyinstaller/bootloader
py ./waf distclean all
cd ..
py setup.py install
monstermac77 and PumkinSpice for their work on the MixedVR Manager, the WMR MixedVR guide and their extensive testing of this script.
The following two projects figured out the required GATT characteristics and values to discover and control the headsets. This project was initially a from-scratch rewrite of these designed to make integration with MixedVR Manager easier.
Finally, Ben Woodford for their exploration and documentation of the 2.0 GATT characteristics and nairol for their 1.0 basestation documentatrion.