-
-
Notifications
You must be signed in to change notification settings - Fork 172
When device is paired on reconnect of the device not working #464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
same here. On PC reconnect works, but on Quest2 does not work. |
Can either of you share a debug log output when this occurs? |
The workaround for me was to add security to the BLE, but honestly i dont know the reason :D Attach to setup() after advertising: NimBLESecurity *SECURITY_MANDATORY = new BLESecurity(); |
Thank you but this did not work. I tried a few other setting but decided it'll be better to go with debugging as @h2zero suggested. from the log: Dear @h2zero, please can you hint at what makes the difference? |
Looks like you need to enable bonding. Try adding this after initialization: Have a look at the secure client/server examples. |
yes, I did that as you see below.
In a variation I also tried without
|
reconnecting our Cybershoes gives an encryption failed:
reconnecting GamePadPlus
and finally
|
also no success with:
|
sometimes (once in 5-10 attempts) connection and reconnection (but then I need to confirm pairing again) works successfully with:
|
I'm not too sure what the error is yet, the logs suggest an error in a value passed during pairing. What kind of pairing does the other device expect? If not using PIN codes or any other mitm protection then try setting the last 2 parameters of the |
You should also remove this:
That is conflicting with the security settings above it. |
@CybershoesVR Try this workaround from chewara, it sounds like its happening the same: class MyCallbacks : public BLEServerCallbacks { void onDisconnect(BLEServer* pServer){ Issue Open: |
You have to add something like this on the onConenct: BLEDescriptor *desc = input->getDescriptorByUUID(BLEUUID((uint16_t)0x2902)); |
I’m facing the same issue. @JuanJoseMoralesCalvo Did your suggestion work for you? |
The workaround on comment #12 didnt work as i understand its only for the nkolban esp32 libraries. Finally by adding security it worked. NimBLESecurity *SECURITY_MANDATORY = new NimBLESecurity(); |
On which lines of which file should I put this? Please explain me if I should add or replace code? |
I would encourage not to use the security class as it has been deprecated. The equivalent call is simply:
The IO caps default to NONE. Just put that line somewhere after initializing NimBLE. |
@h2zero like this example in my gist? https://gist.github.com/fabdelgado/60c715dec2651b46a0d342c46179fe48 |
Looks good to me |
I will try that! |
It has not worked for me with my chromecast v3 Google TV. WhatsApp.Video.2022-11-05.at.9.02.58.PM.mp4 |
Hmm, please try erasing the flash of the esp32 then upload your code. Also remove any devices bonded to the TV if you can. |
@h2zero this worked for me, thanks for the help. WhatsApp.Video.2022-11-06.at.1.44.45.PM.mp4This is the code that I have used, I have left it for future issues. `void setup() { NimBLEDevice::init("NimBLE"); NimBLEDevice::setSecurityAuth(true, false, false); // enable bonding, no MITM, no SC |
@h2zero I have another related problem, when I press forget device and then restart the Chromecast it unbinds the remote from Chromecast instead of ESP32. |
I don't have any idea why that would happen, wouldn't have anything to do with the esp32 though. |
Hi im trying to create an HID Gamepad so when i first pair the device all works great but when i (for example) reset the module it doesnt work. Any suggestion on the connect CallBack?
The text was updated successfully, but these errors were encountered: