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.9KViews0likes7CommentsQuest 3 disconnects from classical Bluetooth with ESP32 after 3 seconds
I am trying to link a Quest 3 and an ESP32-WROOM devkit via Bluetooth Classic. The ESP32 is running the following code: #include "BluetoothSerial.h" String device_name = "ESP32-BT-follower"; BluetoothSerial SerialBT; // Bt_Status callback function void Bt_Status(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) { if( event == ESP_SPP_SRV_OPEN_EVT ) { Serial.println ("Client Connected"); } else if( event == ESP_SPP_CLOSE_EVT ) { Serial.println ("Client Disconnected"); } } void setup() { Serial.begin(115200); SerialBT.begin(device_name, isMaster = false, disableBLE = true); //Bluetooth device name SerialBT.register_callback(Bt_Status); Serial.printf("The device with name \"%s\" is started.\nNow you can pair it with Bluetooth!\n", device_name.c_str()); } #define BT_BUF_LEN 255 char BT_buffer[BT_BUF_LEN]; int BT_data_index = 0; // Used in loop to keep track of how many elements have been read into buffer already void loop() { if( SerialBT.available() ) { int available_chars = SerialBT.available(); // SerialBT.available() helpfully tells us the number of transmissions in the buffer. We don't want to read more than that. // Sometimes data is sent over multiple packages. In that scenario we keep pushing characters until we see a newline, at which point we start processing data. for(int i = 0; i < available_chars; i++) { BT_buffer[BT_data_index] = (char) SerialBT.read(); if(BT_buffer[BT_data_index] == '\n') { BT_buffer[BT_data_index] = '\0'; BT_data_index = 0; Serial.println(BT_buffer); break; } BT_data_index++; } } } I am able to connect to this ESP32 with the SerialBluetooth app using my Android phone. Upon connecting with my phone the console prints "Client Connected" and I can send a string across that gets printed in the console as well. However, when I try pairing the ESP32 with the Quest 3 the pairing is initially successful, but then 3 seconds later the Quest 3 unpairs itself. Further attempts at pairing the two are not acknowledged until the connection is "Forgotten" at which point it will again pair for only 3 seconds. The ESP32 never writes "Client Connected", even during the brief 3 second pairing. Given that the pairing is successful from my phone I suspect that the issue is on the Quest 3's side rather than the ESP32's side. I have tried setting the ESP32 as either a leader or a follower via a flag on SeriaBT.begin but no change in behavior. Anyone have any thoughts?Solved2.2KViews0likes3CommentsQUEST 2 BLE
Hey, so i am working on a unity project that involves the communication between the quest 2 and an esp32 with BLE. My ESP32 supports bluetooth 5.2, and i am trying to leverage the speeds of that technology but it seems that quest 2 is my bottleneck. Now i know for a fact that quest 2 comes with bluetooth 5.0, and i also know from the received data on my esp32 that the quest 2 supports the 2MBps speeds i have set on my esp32. I know that because when i send the data from the quest 2 to the esp32 th received data's Phy parameters for rx and tx are indeed 2MBps, if quest 2 did not support it i would revert back to the default speeds of 1MBps. To connect my unity project with ble i am using this plugin from the asset store: https://assetstore.unity.com/packages/tools/input-management/arduino-bluetooth-plugin-98960 But it seems that this plugin doesn't have the capability of changing the phy parameters on the quest 2 side. Dis anyone manage to change the ble speeds/parameters on the quest 2? Any help is appreciated, Thanks831Views0likes0Comments