Code Monkey home page Code Monkey logo

lighthouse-keeper's Introduction

Lighthouse Keeper

Discover and control SteamVR lighthouses (versions 1.0 and 2.0)

Prerequisites

Binary

  • Windows 10
  • Bluetooth 4.0/BLE chip (integrated or external), managed by Windows

Python Script

  • Python 3.6
  • bleak BLE library, minimum version 0.10.0

Usage and Examples

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

Troubleshooting

Debug / Verbose Mode

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.

Cannot find or control lighthouses

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.

HTC 1.0 lighthouses do not respond

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.

Compiling an Executable

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.

  1. git clone https://github.com/pyinstaller/pyinstaller
  2. cd pyinstaller/bootloader
  3. py ./waf distclean all
  4. cd ..
  5. py setup.py install

Acknowledgements

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.