gyro.js icon indicating copy to clipboard operation
gyro.js copied to clipboard

null values for gyroscope

Open ccoroner opened this issue 10 years ago • 6 comments
trafficstars

Hi Tom,

first of all, thank you for your implementation! I really appreciate your work.

Sadly, I found gyro.js to return "null" for gyroscope data (alpha, beta and gamma) on my Nexus 5 using Android 6 and Chrome 46.0.2490.76 for some reason. I cannot reproduce this bevahiour on other Nexus 5 running Android 5 and exactly the same browser version. Is there any particular setting related to accessing the gyroscope in Android 6?

ccoroner avatar Nov 09 '15 09:11 ccoroner

Is there any particular setting related to accessing the gyroscope in Android 6?

I haven't used Android 6 yet, so I couldn't say for sure, but it seems that it should be supported. Could it be that you are using incognito? Or that your device could be in a power saving mode, disabling the devicemotion api?

tomgco avatar Nov 10 '15 09:11 tomgco

Thanks for your reply!

I doublechecked that power saving mode is off as well as incognito mode. The browser settings are set to very "liberate" allowing everything (Cookies, JS, GPS and so on). The perplexing point is that accelerometer data is captured well and their values are sound while the gyroscope data is "null" for every event.

Probably there is something wrong with Chrome on this device. Gyro.js works fine with Firefox and Opera mobile on the same device. So, this is probably not an issue of your software.

ccoroner avatar Nov 12 '15 09:11 ccoroner

Probably there is something wrong with Chrome on this device. Gyro.js works fine with Firefox and Opera mobile on the same device. So, this is probably not an issue of your software.

Could you provide the example code that you are using in Chrome 46 on the andriod? So I can try it out?

tomgco avatar Nov 12 '15 11:11 tomgco

Sure, here come's the code. (I attached ".txt" to the filename for uploading but it runs as-is with ".html" suffix.)

gyrotest.html.txt

I just tested again: One device is perfectly fine, the other is saying "null" for alpha, beta and gamma.

ccoroner avatar Nov 13 '15 12:11 ccoroner

Hi guys, did you ever resolve this? I ran into a similar problem a couple of months ago and, after doing a little research, it seemed like it had something to do with Android 6.0.1 failing to actually provide deviceorientation values (yet adding a deviceorientation listener to the Window). Do you know if this is the case?

ihart avatar Mar 15 '16 15:03 ihart

I'm seeing this on my Nexus 5 on Firefox, but it works fine on Chrome. Demo here: https://jsfiddle.net/kh87dLe9/2/embedded/result/

mattandrews avatar Aug 09 '16 10:08 mattandrews