Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol quick explanation? #4

Open
nullstalgia opened this issue Mar 25, 2021 · 12 comments
Open

Protocol quick explanation? #4

nullstalgia opened this issue Mar 25, 2021 · 12 comments

Comments

@nullstalgia
Copy link

Heyo, love the project! I want to possibly port a version of it to the ESP32 so I can turn the Base Stations on and off without a PC, but I've been having issues finding reasonable documentation on the protocol. Since you and @tsjost also just got the V1 protocol down (the main one I'm interested in), I'd love to get that in too.

Thanks in advance, and sorry if this is a stupid request.

@tsjost
Copy link

tsjost commented Mar 25, 2021

@tsjost
Copy link

tsjost commented Mar 25, 2021

(The readme is saying that you must keep sending pings to keep the lighthouse turned on, but that's incorrect as the 0x1200 command will keep it on indefinitely)

If you didn't see it already, I did a quick overview here: #1 (comment)
Do let me know if you have any specific questions!

@ShayBox
Copy link
Owner

ShayBox commented Mar 25, 2021

I mostly used https://github.com/nouser2013/lighthouse-v2-manager/blob/master/lighthouse-v2-manager.py, the second section, and fumbled my way around rust until I got it to work, I looked at other languages but rust was the only one with a multiplatform bluetooth lib

@ShayBox
Copy link
Owner

ShayBox commented Mar 25, 2021

Let me know how that goes or if you need any help, I'm going to be buying an esp32 to make a macro board soon and that would be a great macro to have

@nullstalgia
Copy link
Author

nullstalgia commented Mar 25, 2021 via email

@ShayBox
Copy link
Owner

ShayBox commented Mar 25, 2021

The ESP has Wifi and Bluetooth, you can emulate a PS/2, Bluetooth HID, or communicate over wifi to an api running on a computer that's able to do things.

@nullstalgia
Copy link
Author

nullstalgia commented Mar 25, 2021 via email

@nullstalgia
Copy link
Author

Awesome, I got a proof of concept working with NRF Connect on my Android phone. Thanks much many for the explanation on # 1, the "little endian" comment makes much more sense now.

@nullstalgia
Copy link
Author

https://github.com/nullstalgia/LighthouseESP

Can you guys see if it looks alright? Works for me on my V1 Lighthouses, but I don't have any V2s to test.

@ShayBox
Copy link
Owner

ShayBox commented Mar 26, 2021

Looks great, i'll test v2 when I get my esp32

@ShayBox
Copy link
Owner

ShayBox commented Nov 28, 2022

Version 2 Basestations (Valve) are very simple
You write one of the values to a bluetooth device

Hex Action
0x00 OFF
0x01 ON
0x02 STANDBY

This has the disadvantage of having no security, anyone in bluetooth range can control your basestations
Someone could even maliciously brick flash or power cycle them.

Version 1 Basestations (HTC) are seemingly more secure
(Steam doesn't require the BSID, so this may just be a lack of knowledge of how to obtain this over bluetooth)
They require an 8-bit BSID printed on the device
The commands are seemingly arbitrary, though likely have a reason, can be found here
https://github.com/ShayBox/Lighthouse/blob/a830f5955a87fc739f4e7ce3babcea4268311e25/src/main.rs

EDIT: I forgot @tsjost had written up a nice comment on this
#1 (comment)

@nullstalgia
Copy link
Author

Steam doesn't require the BSID [for V1]

It gets the BSID from the headset's/controller's tracking dots when reading the data encoded by the laser spinning inside of the lighthouse.

I was able to get the V1 functionality working with my sketch but I didn't own V2 lighthouses until more recently (about a year ago), and when I tested it, my sketch didn't function as expected. Project fell off the backburner, but maybe now is a good chance to try to get it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants