Giter Club home page Giter Club logo

lighthouse-v2-manager's Introduction

This fork is modified to add a toggle option so you can turn basestations on or off without having to use 2 seperate scripts for it.

Manager for V2 Lighthouses by Valve/HTC

This python script helps you switch your Valve Lighthouses V2 on and into stand-by. Unfortunately, my Pimax 5K XR needs the lighthouses up and running before I turn it on, so the awesome work done by @mann1x in his project Pimax BS Manager is of little use to me. This may be different with your particular Pimax HMD.

installation (Windows binary release)

  1. Create a folder where you want to store the manager's files, e.g. C:\Program Files\LH-Manager.
  2. Download and copy the files (executable and both icons) from this repository's releases page into the target folder from step 1. Depending on the destination, administrative privileges may be required for copying.
  3. Make sure your Bluetooth Low-Energy dongle is connected.
  4. Open a command prompt and navigate to the folder from step 1, e.g. C:\Program Files\LH-Manager. From there, follow the instructions in the chapter "Usage".

installation & prerequisites (python script version)

Make sure that you have the following:

  • Windows 10, at least 17xx build
  • BLE / Bluetooth 4.0 dongle installed and connected (not a BGAPI one!)
  • Python 3, I used Python 3.8.2
  • Pythonnet installation from here
    1. download pythonnet‑2.4.1.dev0‑cp38‑cp38‑win_amd64.whl
    2. pip3 install pythonnet‑2.4.1.dev0‑cp38‑cp38‑win_amd64.whl
  • bleak installed pip3 install bleak

usage with command line arguments

The script provides three usage options: discovery, turning on and switch to standby of a lighthouse V2.

Note: if you installed the binary version, simply call the program by executing it. Instead of python3 .\lighthouse-v2-manager.py type lighthouse-v2-manager.exe in the command prompt window for the commands below.

display instructions

If you call the executable/script with no command line arguments or with an invalid command, the useage instructions are returned. Choose one of the commands discover, on, off or toggle to interact with your Lighthouses V2.

usage: python3 .\lighthouse-v2-manager.py

discovery

If you call the program with the discover command, it tries to open your BLE device and scans for BLE servers in range. Once found, it looks for the service and characteristic which allow for the power-up and power-down of a lighthouse V2. Look for the MAC addresses and the results on the console output.

Optionally, since version 1.1, you can specify the command line option -cs or --create-shortcuts with the discovery command. The program then tries to create suitable shortcuts for your installation and your Lighthouses' MAC addresses. This works with both the script version and the binary stand-alone version.

usage: python3 .\lighthouse-v2-manager.py discover [-cs,--create-shortcuts]

switch lighthouses into standby

If you want to switch a lighthouse off ("stand-by"), specify either "off" as first argument and then each MAC address consecutively as further arguments like so:

usage: python3 .\lighthouse-v2-manager.py off aa:aa:aa:aa:aa:aa bb:bb:bb:bb:bb:bb ...

The lighthouses LED will now start a blue breathing animation, that is, it will fade-in and fade-out to indicate its standby operation state.

turning lighthouses back on

If you want to switch a lighthouse back on, specify either "on" as first argument and then each MAC address consecutively as further arguments like so:

usage: python3 .\lighthouse-v2-manager.py on aa:aa:aa:aa:aa:aa bb:bb:bb:bb:bb:bb ...

The lighthouses LED will power up. As soon as it's stabilized, the LED turns solid green.

toggle lighthouse states

If you want to toggle the state of the basestation(s), specify "toggle" as the first argument then each MAC address consecutively as further arguments like so:

usage: python3 .\lighthouse-v2-manager.py toggle aa:aa:aa:aa:aa:aa bb:bb:bb:bb:bb:bb ...

The script connects to each basestation specified, then gets if they are active or in standby mode. Then based on the state it will send a command to swap it to the opposite state. So if it is on, it will be toggled to standby, and vice versa. The point of this argument is to reduce the ammount of scripts you would need to just one to turn the basestations on or off.

Hard-coding your Lighthouses' MAC addresses

Inside the script, you can edit the list lh_macs to contain the MAC addresses of your lighthouses as strings. Doing so allows a shorter command line interaction:

  • python3 .\lighthouse-v2-manager.py on
  • python3 .\lighthouse-v2-manager.py off

Still, you can add other MAC addresses dynamically even after you put some in the file itself:

  • python3 .\lighthouse-v2-manager.py off cc:cc:cc:cc:cc:cc

Credits

  • Enzo Geant for the new on/off icons. Thanks for your contribution.

lighthouse-v2-manager's People

Contributors

aphlute avatar flyser avatar nouser2013 avatar yukihoaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lighthouse-v2-manager's Issues

Wanted to share icons with you

Hello, I made 2 little fancy icons for both ON and OFF shortucts, I thank you for creating this software and wanted some cool icon for my windows start menu :
image
Just wanted to share it with you somehow, sorry for creating an issue
base_station_icons.zip

Not working on Windows 11

The exe just halts in a loop after running the shortcut. Worked fine on Windows 10.
image

Can something be done?

Only finds one 2.0 Base station + errors

Hello,

I have 2 Valve 2.0 Base Stations and it looks like only one can been found with this utility plus I get errors and no shortcut created. I can see both light houses in SteamVR and both track just fine. Love to get this working as mine just do not turn off/on reliably. This is what I am getting in the command console.:

C:\Program Files\LH-Manager>lighthouse-v2-manager.exe discover --create-shortcuts

=== LightHouse V2 Manager ===

MODE: discover suitable V2 lighthouses
and create desktop shortcuts

Discovering BLE devices...
Found potential Valve Lighthouse at 'D6:54:14:C1:CC:1B' with name 'LHB-500EBEA4'...
Traceback (most recent call last):
File "lighthouse-v2-manager.py", line 155, in
File "asyncio\base_events.py", line 616, in run_until_complete
File "lighthouse-v2-manager.py", line 58, in run
File "site-packages\bleak-0.6.1-py3.8.egg\bleak\backends\client.py", line 44, in aenter
File "site-packages\bleak-0.6.1-py3.8.egg\bleak\backends\dotnet\client.py", line 145, in connect
File "site-packages\bleak-0.6.1-py3.8.egg\bleak\backends\dotnet\client.py", line 236, in get_services
bleak.exc.BleakDotNetTaskError: Could not get GATT services.
[61636] Failed to execute script lighthouse-v2-manager

Thanks for taking the time to look at this.

Cheers,
Immersive Matthew

"> LH switched to 'off' successfully... >> disconnected." but base stations are still on

So I've successfully installed your program as I've gotten the mac address multiple times and I have the icons and everything setup in a folder (with no errors) everytime I open the LHv2-OFF app i get the message

"
=== LightHouse V2 Manager ===

MODE: switch lighthouses OFF

  • (mac id)
  • (mac id)

Trying to connect to BLE MAC '(mac id)'...
'(mac id)' connected...
LH switched to 'off' successfully...
disconnected.

but the base stations are still on when i check them ive checked my bluetooth dongle and it does support low energy Bluetooth since I have the "Le enumerator" in device manager, I also closed all steam vr programs including steam but no luck. Im kind of stuck on what to do here also my bluetooth dongle is this

https://www.amazon.com/gp/product/B08FHW5452/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

Also forgot to mention i am using the HTC version of the light houses dont know if that has anything to do with it (2.0 not 1.0)

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.