-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
esp32: 'BLE' object has no attribute 'gap_pair' #7008
Comments
Pairing/bonding is not yet supported on the esp32, because the esp32 needs a bit of work to switch it to synchronous BLE events. |
Thanks @dpgeorge! Any idea when it will be accessible on esp32? I'll see if an STM32 will work in the near term for our project. |
No, sorry. There are a lot of other things competing for development time! |
Understood. I was wondering directionally when this may be ready as it will affect the hardware we end up going with for our project. |
I had a quick look at this the other day and made some progress, but it needs more time. I might be able to make a patch for you to try out. |
That would be great! Keep me posted and I'll give it a shot. |
I'll pull and start testing. I'll keep you posted on how it goes! Thank you for the quick response on this one! |
@dpgeorge, that did it! I was able to successfully pair to my peripheral bt device and the 2 devices connect on restart successfully each time, so it seems they are both added in the trusted devices. Need me to review your PR? |
Did you implement the BLE secret IRQs to get this working? |
Not at this stage, thanks. It's still a WIP. |
I did not, but it seems that the pairing functionality allows my peripheral device to store the esp32 I'm using as a central in the trusted devices, so perhaps that is why this is working now! |
@dpgeorge, I implemented the I get the following error before the device reboots (this happens continuously):
I see you have additional commits on #7046 as I write this, so I'll pull and run against the latest updates and report back! |
When I implement
|
You may want to refer to |
@dpgeorge thanks! I have been working through that example. I'm doing a little refactoring as the secrets are not being stored in the json file (cleaning this up). I'll have to follow up later tonight with where I'm at. |
@dpgeorge, I'm sorry to be a continued pain, but I'm still struggling a bit to fully implement pairing on my device. I've referenced the example at
Here is a full copy of the file I'm using for reference:file I'm calling the class in bluetooth file from:
bluetooth file:
|
@z7jzk, was wondering if you where able to get this working or not? |
@chriscmorgan, sorry for the delay in my response. I ended up refactoring my entire project over to ESP-IDF directly. I struggled with older releases to get this to work, but was finally able to successfully pair and maintain the bond for repeated connections going forward starting with IDF version 4.3.1 about a month back. I suspect you may be able to get this to work with the latest firmware version on micropython. |
Pairing and bonding is supported on esp32 since 5dbb822 |
Cleanup `mpconfigboard.mk` of espressif boards
Generic ESP32 implementation. Tried on both v1.14 esp32-idf4-20210202-v1.14.bin and v1.14-unstable latest esp32-20210310-unstable-v1.14-84-g59a129f22.bin.
self._ble.gap_pair(self._conn_handle)
yields error:
AttributeError: 'BLE' object has no attribute 'gap_pair'
Is
gap_pair(conn_handle,/)
ready to use yet? I'm having issues in re-connecting to my bluetooth device as I need to pair it to add to trusted devices (connecting alone doesn't seem adequate).ubluetooth — low-level Bluetooth: gap_pair
The text was updated successfully, but these errors were encountered: