Daydream GvrController.BatteryLevel always returns Unknown

Hi,

I’m making a custom daydream arm and controller rig.

Using GVR SDK 1.40 (April).

I’ve instantiated a GvrController ar runtime:

GvrController cGvrController = this.gameObject.AddComponent<GvrController>();

Per frame I am able to read good rotation pose by reading the static property:

Quaternion qRotation = GvrController.Orientation

I’m also able to read other things fine in a similar fashion, but when I read battery level using:

GvrControllerBatteryLevel eLev = GvrController.BatteryLevel;

I always get GvrControllerBatteryLevel.CriticalLow which is (int)enum == 1.
I always get GvrControllerBatteryLevel.Unknown == 0.

Viewing the controller in daydream home screen it’s showing correct number of lights 1 … 5.

Is this a bug or is there some trick to reading battery level that I’m not aware of?

The battery level indicator in Unity is a wrapper around the C API that displays that level in Daydream Home. Has the level ever matched that in VrHome? Could you please try charging the controller for a few hours, to see if it goes back up to 5?

I fully charged my controller. In daydream home I see 5 green lights.
Can read every other property of GvrController OK.
But reading GvrController.BatteryLevel I get GvrControllerBatteryLevel.Unknown == 0.
I logged the raw returned enum on a running device.
I posted above I got 1, I was mistaken as that was clamped in my display function, i get 0 all the time.

Yesterday I installed “Daydream Elements” on my ZTE_Axon7:

The battery indicator graphic on the controller also reads unknown, like this:

●●**?**●●

Could others report if the “Daydream Elements” app shows the correct battery status.

It looks like it could be a bug in the wrapper around the battery level indicator in Unity.

I see the same results for GvrControllerBatteryLevel :
a) in VrHome I see 2 lights (Low) but in my Unity app I get Unknown.
b) I charged the controller overnight and see 5 lights (Full) in VrHome, but still get Unknown in my Unity app.
c) The level never matches that in VrHome (Unity app is always Unknown).

I’m using:
Unity 5.6.1p3
GVR Unity SDK 1.60
Daydream Renderer 1.0
Moto Z Force Droid, Android 7.0

1 Like

I’m thinking it’s a buglet in the unity wrapper.

Hi all,

The issue still persists.
Here is the environment in which I can reproduce the issue:

  • Unity 5.6.1f1
  • GVR SDK 1.60
  • Pixel XL

I have opened an issue on the official GVR SDK git repository:
https://github.com/googlevr/gvr-unity-sdk/issues/627

Cheers,

1 Like

Thank you for reporting this issue!

We are investigating it. In the meantime, you can disable the battery indicator.

-Dan

1 Like

The battery indicator should work if you use Unity 5.6.2f1.

Additionally, in the next release of the GVR SDK the battery indicator will be hidden if the battery state is unavailable instead of showing a question mark.

Thanks,

Dan

1 Like

Verified, this is fixed in 5.6.2p1, thanks.

1 Like