For a VR project I am working on I need to be able to make a in-game interface that would allow to change the role of Vive Trackers, ideally without restarting.
However it seems you can only do it manually through the steamvr settings windows.
During my diging I learned that steam is using WebHelpers(a custom browser) to render the settings and communicate with the software through http (not secured) requests and websockets. I used wireshark to spoof the packets send and managed to reprocude them using python, however there is a secret key used (x-steam-secret) that changes at every steam or computer startup. I didn't find any way to fetch that key which makes sense since it's secret. I understand that it prevents the user form having config or actions made from any rogue program but I as admin of the computer cant either.
import requests
headers = { "x-steamvr-secret": "13294285527328607850" } # Changes at startup
r = requests.post(
'http://127.0.0.1:27062/input/settrackerbinding.action',
data=b'{"device_path":"/devices/htc/vive_trackerLHR-SERIAL_NUMBER","role":"TrackerRole_Camera","controller_role":"TrackedControllerRole_OptOut"}',
headers=headers, timeout=5,
)
I also found a way to change the file where my specific config are store, either manually or through a webconsole that i can replicate without the secret key, however I need to restart SteamVR to have those changes applied and that would mean restarting my VR program.
Do you guys have any idea how to automate some settings changes (with admin right if needed), or even better how to force SteamVR to reload its vrconfig file?
Thanks in advance and have a good day !