Comments (7)
No obvious idea. Could you post the full HCI Packet Log after converting it with tool/create_packet_log.py?
Maybe something else is going on that causes the disconnect.
from btstack.
Here's the Wireshark packet log.
There's 4 successful HTTP requests in there, shortly after the last one succeeds, the channel is closed for some reason.
channel_closed.zip
from btstack.
I see. Nothing else is happening really. The disconnect is caused by a Link Layer time out, it would be different if iOS disconnects actively.
Only idea: disable BR/EDR Secure Connections by calling gap_secure_connections_enable(false) before connecting.
from btstack.
Looks like calling gap_secure_connections_enable(false)
actually did the trick! It's been running for 10+ minutes now and it hasn't disconnected.
I'm not sure I understand why this works, was iOS waiting for a special response related to this security setting and because it never arrived the connection was closed?
Also, I don't know nearly enough about Bluetooth to understand what the (security) implications are of doing this. Can you elaborate a bit?
from btstack.
It's not related to iOS. In the past, there have been a number of issues in the BR/EDR Secure Connection implementation on the ESP32. Here's the latest one: espressif/esp-idf#13661
The security implications are minor. As far as I know, the legacy pairing is not less secure than the newer one. It's just that the legacy one is a a custom mechanism that was created for Bluetooth only, while the new one uses standard cryptographic algorithms (AES-CCM). Still, there hasn't been an academic paper that claimed that the older mechanism is insecure.
Could you retest your use case with the test libdtm_app from the other issue with BR/EDR Secure Connections enabled?
If it's fixed by that, please leave a comment there to let Espressif know. If not, please create a new issue and post logs files with the test library and comment that everything works without BR/EDR Secure Connections. Thanks!
from btstack.
Thanks for clarifying!
I tried to build with the test lib in espressif/esp-idf#13661 but the linker complains about 2 undefined references, likely because this project is still on esp-idf 4.x. I won't be upgrading this project to v5 anytime soon since it's quite involved because of the netif changes in esp-idf v5.
This project ran fine the last couple of years by the way, using BTStack 1.3.2, it was only because apparently after a certain iOS update it refused to connect that I started investigating. Tried upgrading to BTStack 1.6, but that didn't improve things until I tried your gap_secure_connections_enable(false)
suggestion. Then I added that call to the version that still used BTStack 1.3.2 and it also started working again!
I'll revisit this if I ever come around to upgrading this project to esp-idf v5.
from btstack.
how to use ESP32 run as a NAP role?
from btstack.
Related Issues (20)
- hid_host_demo: discoverable and connectable by default HOT 8
- hid_subevent_report_get_report is off by 1 byte HOT 4
- gap_inquiry_start from hid_host_demo never has rssi and name HOT 5
- hid_host_demo: Logitech Keyboard K810 HID descriptor not available HOT 5
- How to change HID host Bluetooth name? HOT 1
- ESP32 slave role Multiple SCO connection problem HOT 11
- Classic HID host: unreliable pairing to some Android devices HOT 55
- Typo: numberic comparion HOT 1
- Pico W connect PS4 controller first, then connect BT speaker, crashes btstack HOT 1
- simultaneous use of multiple profiles HOT 1
- Linker error when target is esp32-c6: undefined reference to 'esp_vhci_host_send_packet' HOT 7
- Bluetooth classic pairing from Pico W HID host to any Android BluetoothHidDevice fails HOT 3
- How to unpair a device? HOT 1
- Multiple HFP connections / single call, callsetup, callheld status HOT 4
- Arduino Port: Subscribe to Notifications not Working. Function missing. HOT 1
- evaluating wl18xx support - can't get demos working. HOT 33
- Crash after hids_client_disconnect HOT 10
- Missing basic SDP attributes definitions HOT 4
- hid_host_send_set_report wrongly returns ERROR_CODE_COMMAND_DISALLOWED HOT 5
- Multiple PBAP/GOEP instances HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btstack.