cancel
Showing results for 
Search instead for 
Did you mean: 

How to get hardware information from Quest 2 such as serial number or controllers battery level?

AnAerVR
Level 2

Hey,

 

I'm working on a VR game using Unity and the Quest 2 headset. I'd like to get in-app access to the battery level of each device (headset, left controller, right controller) independently.

 

I managed to get acces to the headset's battery level using Unity's built-in SystemInfo.batteryLevel (OVR.batteryLevel is flagged as obsolete and doesn't work), but I can't find a way to get access the the battery level of the controllers. OVRInput.GetControllerBatteryPercentRemaining() always returns 0 regardless of the argument I use.

 

Additionally, I would like to get access to further headset-related information such as serial number or nickname. So far, none of the answers I've found online have helped; apparently this used to work but now always returns "unknown":

AndroidJavaObject jo = new("android.os.Build");
float serialNumber = jo.GetStatic<string>("SERIAL");

 

Documentation is sparce, so I'm kinda stumped. Assistance would be greatly appreciated. Cheers!

1 REPLY 1

baroquedub
Level 5

Not actually tried this on Quest, but it works on Android: Unity - Scripting API: SystemInfo.deviceUniqueIdentifier 

 

Alternatively, who know what this returns on Quest. Might be worth a try: https://forum.unity.com/threads/how-to-get-imei-of-android-phone-in-unity.538135/#post-3547395