Giter VIP home page Giter VIP logo

htc_bs_control's Introduction

VRBS Power Control

Virtual Reality Base Station Power Control

Allows you to toggle the power state of your HTC/Valve Lighthouse Base Stations between on and sleep modes using Bluetooth LE, on Windows/Linux

Useful if you have an Oculus or other headset that isn't able to automatically manage the power state through SteamVR

Requirements

  • Python >= 3.7 and pip
  • Bluetooth >= 4.0 adapter supporting Bluetooth LE (anything made in the last ~10 years should work)
  • Windows 10, Linux
    • Linux is not tested yet, and macOS most likely does not work.
  • On Windows, you might need to pair the base stations to your PC beforehand. In testing this was not necessary, but Windows 10 changed their BLE API and made it less reliable for no good reason.

Installation

Windows

python -m ensurepip --upgrade
  • Install bleak using the following command:
pip install bleak 

If the installation of bleak fails on Windows, you might need to upgrade pip, or if that still fails, install the C++ CMake tools from the Visual Studio Installer

Linux

  • Install python using your package manager. For example, with Ubuntu:
sudo apt-get install python3
  • Install pip using the following command:
python -m ensurepip --upgrade
  • Install bleak using the following command:
pip install bleak

Usage

Run the command with either "on" or "off" as an argument. The default is "on".

For example:

python vr_bs_control.py on

The program will search for any base stations and attempt to send the command to wake/sleep respectively.

For V1 (HTC) base stations, it can take up to 60 seconds for them to enter sleep mode. Waking up, however, should be almost instant. V2 (Valve) base stations will wake/sleep instantly.

Using the --save option will write any found base station's addresses to basestations.txt. Upon running the program after this, it will reuse the saved addresses in the text file and skip the five second long scan process. Running the program with the --save option while saved addresses are already present will re-scan and re-save the addressess, useful if you install a new base station. This file can also easily be manually edited to add or remove addresses if needed. You can also run the program with both the -d and -s options to scan for and save basestation addresses without having them change power state.

Optional Arguments

htc_bs_control.py [-h] [-s] [-d] [STATE]
Argument Description
STATE Either on or off, defaults to on if not specified
-h, --help Show the help message and exit
-s, --save Saves the addresses of the Base Stations.
-d, --dryrun Runs the program without sending any Bluetooth commands

htc_bs_control's People

Contributors

missingno123 avatar namakeingo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.