Best way to communicate with an ESP32 and Unity app through BLE (or BT serial) on an Oculus Quest?
Hi, Been trying for a long while to get an ESP32 to communicate with a Unity app on an Oculus Quest. Recently got that ESP32 to connect to the Unity app on Quest by using the "Bluetooth LE for Android and iOS" plugin that is on the Unity store, but the app didn't find the BLE service on the ESP32 ("Error during initialize: Service not found for Write") although it was connected to that ESP32. Have tried the same Unity app on an Android phone and thankfully it functions properly on the phone. Main goal with that is to get it functioning on Oculus Quest right now though. Thanks in advance for recommendations on how to make that Unity app communicate with that ESP32 through BLE (or BT serial) on the Quest properly!6.7KViews0likes7CommentsAccessing Move Data?
We've got a heart rate monitor synced directly to the headset with our headset and are looking to display heart rate data in our application. As described here, the heartrate monitor is displaying the data in real time to an overlay. Is there any API call (Unity or native SDK), function, or native android method to directly access this data once paired?1.8KViews1like3CommentsHow to send data(0,1,2,3) to an Arduino or Raspberry via Bluetooth or Wifi.
Hello readers!. i am working on a medical project that uses VR for rehabilitation of people with certain kinds of traumas, physical and emotional (cant reveal more info about it). I would like to know if there is a way to pair an Arduino or Raspberry with a Bluetooth module, so when i hit an object or do something in VR, the raspberry or arduino can read a 1,2,3,4 or a couple of chars. My guess is 1) Pair the oculus quest android to the arduino (can this be done?, or is it only for gamepads) 2) Use a wifi server and send messages over HTTP or OSC. 3) connecting directly to USB if possible, a long usb cable wouldn't bother that much. To me, bluetooth would be the best one because it wouldnt require to use an external wifi , router, and extra program. Any ideas? someone tried this already?. Im working with Unity and Oculus SDK, but this is a platform agnostic solution, and there are many people already asking about this. Also, can the arduino be seen as a "gamepad" somehow? so i send and receive input , like cheating the quest.11KViews4likes16CommentsCompanionDeviceManager doesn't work on v59, Quest 2 can't connect BLE device
We have project for Oculus VR headsets which connects to external BLE devices, receive sensor data and represent it in VR. Recently Bluetooth and Location permissions were prohibited on Oculus so our functionality with BLE devices was broken and doesn't work on v59. Even if Location permission is enabled in app settings in logs it says that this permission is disabled. Documentation says we should use CompanionDeviceManager API for that purpose as alternative solution. The problem is that CompanionDeviceManager also doesn't work on v59. It shows system dialog with ProgressBar but after waiting for a short time it closes without finding Bluetooth devices. In the logs can be found a message from com.android.companiondevicemanager with a text "No adapter attached, skipping layout". It looks like internal bug with RecyclerView implementation on Oculus side. The same code works perfectly on Google Pixel 7 with Android 14 but on Oculus our project doesn't work for both approaches – Bluetooth and CompanionDeviceManager. Is there any workaround to make it work on v59? When will it be fixed by Oculus team?Solved2.1KViews1like3CommentsPTC v60 - 1-2 second input lag with Bluetooth LE devices.
Hi, I updated two of my Meta Quest 2 devices to PTC v60 version today and noticed that connected Bluetooth devices (BLE) have huge input delay lag. Earlier today the Bluetooth connection worked fine on these devices on V59. The input lag is between 1-2 seconds when Bluetooth controller is connected. I have tried to factory reset the headsets but the issue still persist. I have also third Meta Quest 2 device which still has V59 on it and the Bluetooth controllers work correctly on that one. This is a huge issue since it makes Bluetooth controllers not usable at all which is key functionality in our application. Please try to fix this before releasing V60. Version: 60.0.0.107.366.536455832 Runtime version: 60.0.0.107.366.536455903 I tried to figure out what exactly is the issue and created an application that connects to the Bluetooth device. When tried to read data from the BLE device it took 1000-3000ms to receive the data in Meta Quest 2 V60. I tested this on Meta Quest 2 V59 and there the response was instant. Below is the code that I used to connect and read the Bluetooth device data and the logs from V60 Meta Quest 2 device from when the read operation started to when it finished. ---Code--- public void ConnectToDevice(String deviceAddress) { if(_isConnected) { return; } BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); BluetoothDevice device = adapter.getRemoteDevice(deviceAddress); device.connectGatt(this, false, mGattCallback); } public void ReadData() { if(_isConnected == false) { return; } _bluetoothGatt.readCharacteristic(_characteristic); } private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { if (newState == BluetoothProfile.STATE_CONNECTING) { _isConnecting = true; } else if(newState == BluetoothProfile.STATE_CONNECTED){ _isConnecting = false; _bluetoothGatt = gatt; gatt.discoverServices(); OnConnected(gatt.getDevice().getAddress()); } else if(newState == BluetoothProfile.STATE_DISCONNECTING){ _isConnecting = false; } else if(newState == BluetoothProfile.STATE_DISCONNECTED){ _isConnecting = false; _bluetoothGatt = null; OnDisconnected(gatt.getDevice().getAddress()); gatt.close(); } } @Override public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { String value = Arrays.toString(characteristic.getValue()); UnityPlayer.UnitySendMessage("BluetoothLEController","Info", value); } };900Views0likes0CommentsBUG. Quest 2 Bluetooth BLE Notifications often arrive in groups
My code runs on Quest 2 (Android 12.0 and OS version 56) and subscribes to the Gatt Cadence characteristic of a cadence sensor. The Cadence notifications typically arrive once per second. However some notifications can take up to 5 seconds to arrive. In that case all 5 notifications arrive at once. This makes it impractical to control a biped character using an exercise bike on the Quest 2. To verify that this is not a problem with my app, I've installed Nordic Semiconductors nRF Connect app on the Quest 2. It exhibits the same behavior as my app. Notifications often come in groups. However when the nRF Connect app is installed on IOS (my IPhone 13). All cadence notifications come in separately, about one second apart. The OVRMetrics tool shows CPU Utilization at only 25%, so the Bluetooth Stack should not have a problem keeping up with notifications that come in one second apart. I tried submitting this as a bug report but it seems there is no way to submit technical bugs through the website. Technical bugs are referred to this forum. This is discouraging since my only other post to this forum has not received any replies in 3 months.674Views0likes0CommentsSecurityException when accessing Bluetooth API
I'm trying to access the Bluetooth API within a Unity project, but I end up with a SecurityException: 01-24 20:40:47.280 26380 26405 E Unity : AndroidJavaException: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10076 nor current process has android.permission.BLUETOOTH. 01-24 20:40:47.280 26380 26405 E Unity : java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10076 nor current process has android.permission.BLUETOOTH. 01-24 20:40:47.280 26380 26405 E Unity : at android.os.Parcel.readException(Parcel.java:1692) 01-24 20:40:47.280 26380 26405 E Unity : at android.os.Parcel.readException(Parcel.java:1645) 01-24 20:40:47.280 26380 26405 E Unity : at android.bluetooth.IBluetooth$Stub$Proxy.isEnabled(IBluetooth.java:864) 01-24 20:40:47.280 26380 26405 E Unity : at android.bluetooth.BluetoothAdapter.isEnabled(BluetoothAdapter.java:622) 01-24 20:40:47.280 26380 26405 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 01-24 20:40:47.280 26380 26405 E Unity : at com.unity3d.player.UnityPlayer.access$300(Unknown Source) 01-24 20:40:47.280 26380 26405 E Unity : at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source) 01-24 20:40:47.280 26380 26405 E Unity : at android.os.Handler.dispatchMessage(Handler.java:98) 01-24 20:40:47.280 26380 26405 E Unity : at android.os.Looper.loop(Looper.java:154) 01-24 20:40:47.280 26380 26405 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source) 01-24 20:40:47.280 26380 26405 E Unity : at UnityEngine.AndroidJNISafe.CheckException () [0x0008d] in /Users/bokken/buildslave/unity/build/Modules/AndroidJNI/AndroidJNISafe However, my AndroidManifest.xml lists all required permissions: <?xml version="1.0" encoding="utf-8" standalone="no"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto"> <application android:label="@string/app_name" android:icon="@mipmap/app_icon" android:allowBackup="false"> <activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:excludeFromRecents="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.INFO" /> </intent-filter> <meta-data android:name="com.oculus.vr.focusaware" android:value="true" /> </activity> <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" /> <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only" /> <meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2" /> </application> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" /> </manifest> This is my simple test script which also asks for the FINE_LOCATION permission if necessary: void Start() { if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation)) { Permission.RequestUserPermission(Permission.FineLocation); } else { AndroidJavaClass bluetooth = new AndroidJavaClass("android.bluetooth.BluetoothAdapter"); AndroidJavaObject bluetoothAdapter = bluetooth.CallStatic<AndroidJavaObject>("getDefaultAdapter"); if (!bluetoothAdapter.Call<bool>("isEnabled")) { bluetoothAdapter.Call<bool>("enable"); } AndroidJavaObject mBluetoothLeScanner = bluetoothAdapter.Call<AndroidJavaObject>("getBluetoothLeScanner"); ScanCallback scanCallback = new ScanCallback(); mBluetoothLeScanner.Call("startScan", scanCallback); } } Does anyone have success with accessing Bluetooth on the Quest from within a Unity project?11KViews1like13CommentsMeta Quest PRO will not pair, connect or anything after Factory reset
Hi Developer team I am reaching out here in kind of a desperation! At this point Meta has granted me a "Replacement" of the Meta Quest PRO, because in their opinion, I have recieved a faulty headset. However; they will require a return procedure of 8 - 12 days, and that is totally unacceptable to me, as I am on a tight deadline, with a client that travels very far to see the result of my work on the headset. SO ... in total desperation I would like to hear if someone has some advice to maaaaaybe make my headset work. If you have any thoughts on the matter, please let me know. I am desperat here. Here is what is going on: - I can not connect with either my controllers or my phone. Here is the settings, and what I have tried: - The phone and the headset is on the same Wifi network. I tried several networks and routers. - I have updated to the latest version of the app on the phone and the software on the headset. - I have restarted the phone several times and the headset several times - I updated the phones iOS to the latest version. (The phone is an iPhone 14 pro.) And the headset could not connect with the phone on the previous iOS version either. - I have reset the headset to factory settings. - When resetting to Factory settings, in the setup; it will not pair with either of the controllers. It will not connect to both of them in the setup for both. It will not connect with either of them individually. - Both the headset and the controllers are fully charged. - The Controllers are not showing green even thought they are fully charged. They will blink between blue and red and the light that indicates power, on the headset is kind of purple - I have tried to connect via Bluetooth on the phone. The phone can not see the headset. Sometimes it sees it for a short while and then it jumps of. The "i" - I have tried to connect via the app after resetting of Factory settings, with the "Pair your headset with Meta Quest app" and the 5 digits number. But I get a "Headset not found" after i put in the 5 digits, and have waited a long time searching for it. So ... any suggestions, or do I just have to eat the 8 - 12 days return policy? I have been in contact with Meta Quest support several times, begging and begging and begging for help and for them to do something to speed up the return process, since this is an extraordinary situation with a tight deadline and a client that will. be very unhappy if they travel from the other side of the world to have a cool VR experience and there is not headset to have the experience on. Thanks in advance. Have a great day, // Brokop615Views0likes0CommentsBluetooth (Generic BLE signal) to Quest
I'd like to communicate to a Quest from a generic Blueotooth BLE device (such as Arduino, etc.). It was not possible with the Go. I believe the radio could see BLE advertisements but could not connect to generic devices using generic protocols. It can connect to some game controllers, presumably when they use BLE standards for game controllers. https://forums.oculusvr.com/developer/discussion/67316/arduino-to-bluetooth-interface @mconte, Oculus Developer Engineer, commented about Bluetooth in an AMA on May 3, but mentioned game controllers so I'm not sure if his comment was about generic BLE or only a restricted subset of BLE devices like the case with the Go. https://forums.oculusvr.com/developer/post/quote/75196/Comment_67539111KViews1like11CommentsBluetooth Activation in Oculus Quest (Unity)
I'm developing software to Oculus Quest. I need to connect a arduino board to my Quest via bluetooth. I tried to use the asset "Arduino Bluetooth Plugin" from Unity Asset Store, but my oculus quest bluetooth seems not be enabled. What is the way to enabled Oculus Quest bluetooth and scan/connect another devices? Thank you!5.4KViews0likes2Comments