Skip to content
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

samples/bluetooth/periphera bluez bluetoothctl connect error. iOS low security state. esp32c3 #84182

Closed
zhang-wenchao opened this issue Jan 18, 2025 · 12 comments · May be fixed by #84472
Closed
Assignees
Labels
area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@zhang-wenchao
Copy link
Contributor

Describe the bug

Bluetooth connection error.

To Reproduce

west build -p always -b esp32c3_luatos_core/esp32c3/usb && west flash && west espressif monitor

Expected behavior

Normal connection

Impact

Bluetooth is not working

Logs and console output

Zephyr

*** Booting Zephyr OS build v4.0.0-3426-g7c50c0231cc7 ***
[00:00:00.045,000] <inf> fs_nvs: 8 Sectors of 4096 bytes
[00:00:00.045,000] <inf> fs_nvs: alloc wra: 0, f88
[00:00:00.045,000] <inf> fs_nvs: data wra: 0, 7c
[00:00:00.047,000] <inf> esp32_bt_adapter: BT controller compile version [f583012]
[00:00:00.443,000] <inf> bt_hci_core: No ID address. App must call settings_load()
Bluetooth initialized
[00:00:00.447,000] <inf> bt_hci_core: Identity: 34:CD:B0:53:A2:18 (public)
[00:00:00.447,000] <inf> bt_hci_core: HCI: version 5.0 (0x09) revision 0x0016, manufacturer 0x02e5
[00:00:00.447,000] <inf> bt_hci_core: LMP: version 5.0 (0x09) subver 0x0016
Advertising successfully started
Indicate VND attr 0x3c040734 (UUID 12345678-1234-5678-1234-56789abcdef1)
Updated MTU: TX: 23 RX: 23 bytes
Connected
Updated MTU: TX: 517 RX: 65 bytes
[00:00:50.097,000] <wrn> bt_smp: Received invalid public key
Disconnected, reason 0x05

btmon


Bluetooth monitor ver 5.79
btmon[13906]: = Note: Linux version 6.12.9-arch1-1 (x86_64)                                                                                        0.274397
btmon[13906]: = Note: Bluetooth subsystem version 2.22                                                                                             0.274399
= New Index: 20:2B:20:64:A3:BE (Primary,USB,hci0)                                                                                           [hci0] 0.274400
= Open Index: 20:2B:20:64:A3:BE                                                                                                             [hci0] 0.274401
= Index Info: 20:2B:20:64:A3:BE (MediaTek, Inc.)                                                                                            [hci0] 0.274402
bluetoothctl[12996]: @ MGMT Open: bluetoothctl version 1.23                                                                               {0x0002} 0.274403
bluetoothd[709]: @ MGMT Open: bluetoothd (privileged) version 1.23                                                                        {0x0001} 0.274404
bluetoothd[709]: @ MGMT Command: Pair Device (0x0019) plen 8                                                                      {0x0001} [hci0] 11.710684
LE Address: 51:AC:72:5E:98:51 (Resolvable)
Capability: KeyboardDisplay (0x04)
< HCI Command: LE Remove Device From Accept List (0x08|0x0012) plen 7                                                                   #1 [hci0] 11.710755
Address type: Random (0x01)
Address: 46:D2:9E:CB:7F:26 (Resolvable)
> HCI Event: Command Complete (0x0e) plen 4                                                                                             #2 [hci0] 11.812770
LE Remove Device From Accept List (0x08|0x0012) ncmd 1
Status: Success (0x00)
< HCI Command: LE Add Device To Accept List (0x08|0x0011) plen 7                                                                        #3 [hci0] 11.812841
Address type: Random (0x01)
Address: 51:AC:72:5E:98:51 (Resolvable)
> HCI Event: Command Complete (0x0e) plen 4                                                                                             #4 [hci0] 11.813820
LE Add Device To Accept List (0x08|0x0011) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Extended Scan Parameters (0x08|0x0041) plen 13                                                                    #5 [hci0] 11.813894
Own address type: Public (0x00)
Filter policy: Ignore not in accept list (0x01)
PHYs: 0x05
Entry 0: LE 1M
Type: Passive (0x00)
Interval: 60.000 msec (0x0060)
Window: 60.000 msec (0x0060)
Entry 1: LE Coded
Type: Passive (0x00)
Interval: 180.000 msec (0x0120)
Window: 180.000 msec (0x0120)
> HCI Event: Command Complete (0x0e) plen 4                                                                                             #6 [hci0] 11.814522
LE Set Extended Scan Parameters (0x08|0x0041) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6                                                                         #7 [hci0] 11.814564
Extended scan: Enabled (0x01)
Filter duplicates: Enabled (0x01)
Duration: 0 msec (0x0000)
Period: 0.00 sec (0x0000)
> HCI Event: Command Complete (0x0e) plen 4                                                                                             #8 [hci0] 11.815397
LE Set Extended Scan Enable (0x08|0x0042) ncmd 1
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 55                                                                                               #9 [hci0] 11.856045
LE Extended Advertising Report (0x0d)
Num reports: 1
Entry 0
Event type: 0x0013
Props: 0x0013
Connectable
Scannable
Use legacy advertising PDUs
Data status: Complete
Legacy PDU Type: ADV_IND (0x0013)
Address type: Random (0x01)
Address: 51:AC:72:5E:98:51 (Resolvable)
Primary PHY: LE 1M
Secondary PHY: No packets
SID: no ADI field (0xff)
TX power: 127 dBm
RSSI: -40 dBm (0xd8)
Periodic advertising interval: 0.00 msec (0x0000)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Data length: 0x1d
02 01 06 07 03 0d 18 0f 18 05 18 11 07 f0 de bc  ................
9a 78 56 34 12 78 56 34 12 78 56 34 12           .xV4.xV4.xV4.
Flags: 0x06
LE General Discoverable Mode
BR/EDR Not Supported
16-bit Service UUIDs (complete): 3 entries
Heart Rate (0x180d)
Battery Service (0x180f)
Current Time Service (0x1805)
128-bit Service UUIDs (complete): 1 entry
Vendor specific
< HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6                                                                        #10 [hci0] 11.856135
Extended scan: Disabled (0x00)
Filter duplicates: Disabled (0x00)
Duration: 0 msec (0x0000)
Period: 0.00 sec (0x0000)
> HCI Event: Command Complete (0x0e) plen 4                                                                                            #11 [hci0] 11.857149
LE Set Extended Scan Enable (0x08|0x0042) ncmd 1
Status: Success (0x00)
< HCI Command: LE Extended Create Connection (0x08|0x0043) plen 26                                                                     #12 [hci0] 11.857249
Filter policy: Accept list is not used (0x00)
Own address type: Public (0x00)
Peer address type: Random (0x01)
Peer address: 51:AC:72:5E:98:51 (Resolvable)
Initiating PHYs: 0x01
Entry 0: LE 1M
Scan interval: 60.000 msec (0x0060)
Scan window: 60.000 msec (0x0060)
Min connection interval: 30.00 msec (0x0018)
Max connection interval: 50.00 msec (0x0028)
Connection latency: 0 (0x0000)
Supervision timeout: 420 msec (0x002a)
Min connection length: 0.000 msec (0x0000)
Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4                                                                                              #13 [hci0] 11.858378
LE Extended Create Connection (0x08|0x0043) ncmd 1
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 31                                                                                              #14 [hci0] 11.936122
LE Enhanced Connection Complete (0x0a)
Status: Success (0x00)
Handle: 512
Role: Central (0x00)
Peer address type: Random (0x01)
Peer address: 51:AC:72:5E:98:51 (Resolvable)
Local resolvable private address: 00:00:00:00:00:00 (Non-Resolvable)
Peer resolvable private address: 00:00:00:00:00:00 (Non-Resolvable)
Connection interval: 48.75 msec (0x0027)
Connection latency: 0 (0x0000)
Supervision timeout: 420 msec (0x002a)
Central clock accuracy: 0x00
@ MGMT Event: Device Connected (0x000b) plen 42                                                                                   {0x0001} [hci0] 11.936170
LE Address: 51:AC:72:5E:98:51 (Resolvable)
Flags: 0x00000008
Connection Locally Initiated
Data length: 29
Flags: 0x06
LE General Discoverable Mode
BR/EDR Not Supported
16-bit Service UUIDs (complete): 3 entries
Heart Rate (0x180d)
Battery Service (0x180f)
Current Time Service (0x1805)
128-bit Service UUIDs (complete): 1 entry
Vendor specific
btmon[13906]: @ RAW Open: btmon (privileged) version 2.22                                                                                {0x0003} 11.936289
btmon[13906]: @ RAW Close: btmon                                                                                                         {0x0003} 11.936295
> HCI Event: LE Meta Event (0x3e) plen 4                                                                                               #15 [hci0] 11.936379
LE Channel Selection Algorithm (0x14)
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
Algorithm: #2 (0x01)
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2                                                                       #16 [hci0] 11.966016
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
> HCI Event: Command Status (0x0f) plen 4                                                                                              #17 [hci0] 11.967025
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12                                                                                              #18 [hci0] 11.967140
LE Read Remote Used Features (0x04)
Status: Success (0x00)
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
Features: 0xff 0xf9 0x01 0x00 0x00 0x00 0x00 0x00
LE Encryption
Connection Parameter Request Procedure
Extended Reject Indication
Peripheral-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
LL Privacy
Extended Scanner Filter Policies
LE 2M PHY
LE Coded PHY
LE Extended Advertising
LE Periodic Advertising
Channel Selection Algorithm #2
LE Power Class 1
Minimum Number of Used Channels Procedure
< ACL Data TX: Handle 512 flags 0x00 dlen 11                                                                                           #19 [hci0] 11.967178
SMP: Pairing Request (0x01) len 6
IO capability: KeyboardDisplay (0x04)
OOB data: Authentication data not present (0x00)
Authentication requirement: Bonding, MITM, SC, No Keypresses, CT2 (0x2d)
Max encryption key size: 16
Initiator key distribution: EncKey Sign LinkKey (0x0d)
Responder key distribution: EncKey IdKey Sign LinkKey (0x0f)
bluetoothd[709]: < ACL Data TX: Handle 512 flags 0x00 dlen 7                                                                           #20 [hci0] 11.967312
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 517
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                 #21 [hci0] 11.984651
Num handles: 1
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
Count: 1
#19: len 11 (5 Kb/s)
Latency: 17 msec (17-17 msec ~17 msec)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                 #22 [hci0] 11.985269
Num handles: 1
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
Count: 1
#20: len 7 (3 Kb/s)
Latency: 17 msec (17-17 msec ~17 msec)
> ACL Data RX: Handle 512 flags 0x02 dlen 11                                                                                           #23 [hci0] 12.043038
SMP: Pairing Response (0x02) len 6
IO capability: DisplayOnly (0x00)
OOB data: Authentication data not present (0x00)
Authentication requirement: Bonding, MITM, SC, No Keypresses (0x0d)
Max encryption key size: 16
Initiator key distribution: Sign (0x04)
Responder key distribution: IdKey Sign (0x06)
> ACL Data RX: Handle 512 flags 0x02 dlen 7                                                                                            #24 [hci0] 12.043043
ATT: Exchange MTU Response (0x03) len 2
Server RX MTU: 65
< ACL Data TX: Handle 512 flags 0x00 dlen 69                                                                                           #25 [hci0] 12.044277
SMP: Pairing Public Key (0x0c) len 64
X[32]: 38c79669c93f1feafcfe2dee2307e2065e2af6b086a3edf3c25af550dd769adf
Y[32]: dbf1c868b2583a046a4dc17c7cf5f26d023ce85f4065e5b1b52ddf0179db0ef6
bluetoothd[709]: < ACL Data TX: Handle 512 flags 0x00 dlen 11                                                                          #26 [hci0] 12.044428
ATT: Read By Type Request (0x08) len 6
Handle range: 0x0001-0xffff
Attribute type: Server Supported Features (0x2b3a)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                 #27 [hci0] 12.084165
Num handles: 1
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
Count: 1
#25: len 69 (14 Kb/s)
Latency: 39 msec (17-39 msec ~28 msec)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                 #28 [hci0] 12.084514
Num handles: 1
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
Count: 1
#26: len 11 (2 Kb/s)
Latency: 40 msec (17-40 msec ~34 msec)
> ACL Data RX: Handle 512 flags 0x02 dlen 6                                                                                            #29 [hci0] 12.136181
SMP: Pairing Failed (0x05) len 1
Reason: Invalid parameters (0x0a)
@ MGMT Event: Command Complete (0x0001) plen 10                                                                                   {0x0001} [hci0] 12.136215
Pair Device (0x0019) plen 7
Status: Authentication Failed (0x05)
LE Address: 51:AC:72:5E:98:51 (Resolvable)
> ACL Data RX: Handle 512 flags 0x02 dlen 9                                                                                            #30 [hci0] 12.136187
ATT: Error Response (0x01) len 4
Read By Type Request (0x08)
Handle: 0x0001
Error: Attribute Not Found (0x0a)
< HCI Command: Disconnect (0x01|0x0006) plen 3                                                                                         #31 [hci0] 12.136260
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
Reason: Authentication Failure (0x05)
bluetoothd[709]: < ACL Data TX: Handle 512 flags 0x00 dlen 11                                                                          #32 [hci0] 12.136353
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Primary Service (0x2800)
> HCI Event: Command Status (0x0f) plen 4                                                                                              #33 [hci0] 12.137393
Disconnect (0x01|0x0006) ncmd 1
Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4                                                                                         #34 [hci0] 12.179638
Status: Success (0x00)
Handle: 512 Address: 51:AC:72:5E:98:51 (Resolvable)
Reason: Authentication Failure (0x05)
@ MGMT Event: Device Disconnected (0x000c) plen 8                                                                                 {0x0001} [hci0] 12.179677
LE Address: 51:AC:72:5E:98:51 (Resolvable)
Reason: Unspecified (0x00)

dmesg

[30237.195715] Bluetooth: hci0: unexpected SMP command 0x0b from f2:60:ad:85:cc:97

bluetoothctl

[bluetooth]# scan on
...
[bluetooth]# [NEW] Device 51:AC:72:5E:98:51 Zephyr Peripheral Sample Long
[bluetooth]# scan off
...
[bluetooth]# Discovery stopped
[bluetooth]# pair 51:AC:72:5E:98:51
Attempting to pair with 51:AC:72:5E:98:51
[Zephyr Peripheral Sample Long]# [CHG] Device 51:AC:72:5E:98:51 Connected: yes
[Zephyr Peripheral Sample Long]# Failed to pair: org.bluez.Error.AuthenticationFailed
[bluetooth]# [CHG] Device 51:AC:72:5E:98:51 Connected: no
...
[bluetooth]# exit

Environment (please complete the following information):

  • OS: Linux
  • Toolchain Zephyr SDK
  • v4.0.0-3426-g7c50c0231cc7

Additional context

@zhang-wenchao zhang-wenchao added the bug The issue is a bug, or the PR is fixing a bug label Jan 18, 2025
@zhang-wenchao
Copy link
Contributor Author

zhang-wenchao commented Jan 18, 2025

@sylvioalves

#84164

I think these two issues have similarities, and it needs to be explained that nrf52840 works properly.These two issues are holding my product back, I can help in any way I am able..

@zhang-wenchao
Copy link
Contributor Author

zhang-wenchao commented Jan 18, 2025

In addition, Android iOS is normal.

The difference is that Android has been upgraded to L4 security level, while iOS remains at L1.

Android requests the pairing code and raises the security level, iOS does not request the pairing code.

Looking at it this way, iOS is also not working properly, it's just not failing to connect.

@zhang-wenchao zhang-wenchao changed the title samples/bluetooth/periphera bluez bluetoothctl connect error. samples/bluetooth/periphera bluez bluetoothctl connect error. iOS low security state. Jan 18, 2025
@zhang-wenchao zhang-wenchao changed the title samples/bluetooth/periphera bluez bluetoothctl connect error. iOS low security state. samples/bluetooth/periphera bluez bluetoothctl connect error. iOS low security state. esp32c3 Jan 18, 2025
@sylvioalves
Copy link
Collaborator

@zhang-wenchao, please, fetch latest main and check again. It should be working already. PR #80712 automatically fixed the issue after having BT_CTLR. That enabled proper ECDH handling. Same for #84164.

@zhang-wenchao
Copy link
Contributor Author

zhang-wenchao commented Jan 21, 2025

I'm still having issues with my iOS device. to keep it consistent with you, I also changed to esp32c3-devkitm

samples/bluetooth/peripheral_sc_only

Sorry, I don't know how to log on iOS.

iOS:

*** Booting Zephyr OS build v4.0.0-3684-gb361c9589ff0 ***
[00:00:00.036,000] <inf> esp32_bt_adapter: BT controller compile version [f583012]
[00:00:00.102,000] <wrn> net_buf: Timeout discarded. No blocking in syswq
[00:00:00.102,000] <inf> bt_hci_core: Identity: 7C:DF:A1:A4:9C:00 (public)
[00:00:00.102,000] <inf> bt_hci_core: HCI: version 5.0 (0x09) revision 0x0016, manufacturer 0x02e5
[00:00:00.102,000] <inf> bt_hci_core: LMP: version 5.0 (0x09) subver 0x0016
Bluetooth initialized
Advertising successfully started
Connected 4B:51:0A:C1:72:54 (random)
Passkey for 4B:51:0A:C1:72:54 (random): 723788
[00:00:22.496,000] <wrn> net_buf: Timeout discarded. No blocking in syswq
[00:00:37.967,000] <wrn> bt_smp: Unexpected SMP code 0x08
[00:00:37.967,000] <wrn> bt_smp: The in-progress pairing has been deleted!
Pairing Failed (9). Disconnecting.
Security failed: 4B:51:0A:C1:72:54 (random) level 1 err (9)
Security changed: 4B:51:0A:C1:72:54 (random) level 2
[00:00:37.969,000] <wrn> bt_smp: Unexpected SMP code 0x09
Disconnected from 4B:51:0A:C1:72:54 (random), reason 0x05

@zhang-wenchao
Copy link
Contributor Author

zhang-wenchao commented Jan 21, 2025

This example bluez works fine, Linux connection is successful and the security level is increased. there are still problems with ios. although it can connect, the security level is not improved.

samples/bluetooth/periphera

Arch Linux:

*** Booting Zephyr OS build v4.0.0-3684-gb361c9589ff0 ***
[00:00:00.057,000] <inf> fs_nvs: 8 Sectors of 4096 bytes
[00:00:00.057,000] <inf> fs_nvs: alloc wra: 0, f88
[00:00:00.057,000] <inf> fs_nvs: data wra: 0, 7c
[00:00:00.058,000] <inf> esp32_bt_adapter: BT controller compile version [f583012]
[00:00:00.128,000] <wrn> net_buf: Timeout discarded. No blocking in syswq
[00:00:00.128,000] <inf> bt_hci_core: No ID address. App must call settings_load()
Bluetooth initialized
[00:00:00.130,000] <inf> bt_hci_core: Identity: 7C:DF:A1:A4:9C:00 (public)
[00:00:00.130,000] <inf> bt_hci_core: HCI: version 5.0 (0x09) revision 0x0016, manufacturer 0x02e5
[00:00:00.130,000] <inf> bt_hci_core: LMP: version 5.0 (0x09) subver 0x0016
Advertising successfully started
Indicate VND attr 0x3c040744 (UUID 12345678-1234-5678-1234-56789abcdef1)
Updated MTU: TX: 23 RX: 23 bytes
Connected
Updated MTU: TX: 517 RX: 65 bytes
Passkey for 20:2B:20:64:A3:BE (public): 910656
[00:00:37.030,000] <wrn> net_buf: Timeout discarded. No blocking in syswq
[00:00:39.417,000] <inf> bas: BAS Notifications enabled
[00:00:41.878,000] <wrn> bt_conn: Timeout discarded. No blocking in syswq.
[bluetooth]# pair 64:9D:B2:F3:55:EB
Attempting to pair with 64:9D:B2:F3:55:EB
[Zephyr Peripheral Sample Long]# [CHG] Device 64:9D:B2:F3:55:EB Connected: yes
[Zephyr Peripheral Sample Long]# Request passkey
...
Service Changed
...
Vendor specific
[agent] Enter passkey (number in 0-999999): [NEW] Characteristic (Handle 0x0036)
/org/bluez/hci0/dev_64_9D_B2_F3_55_EB/service002b/char0036
12345678-1234-5678-1234-56789abcdef4
Vendor specific
[agent] Enter passkey (number in 0-999999): 910656
...
[Zephyr Peripheral Sample Long]# Pairing successful
[Zephyr Peripheral Sample Long]#
[Zephyr Peripheral Sample Long]# exit

iOS:

*** Booting Zephyr OS build v4.0.0-3684-gb361c9589ff0 ***
[00:00:00.045,000] <inf> fs_nvs: 8 Sectors of 4096 bytes
[00:00:00.045,000] <inf> fs_nvs: alloc wra: 0, f88
[00:00:00.045,000] <inf> fs_nvs: data wra: 0, 7c
[00:00:00.046,000] <inf> esp32_bt_adapter: BT controller compile version [f583012]
[00:00:00.119,000] <wrn> net_buf: Timeout discarded. No blocking in syswq
[00:00:00.119,000] <inf> bt_hci_core: No ID address. App must call settings_load()
Bluetooth initialized
[00:00:00.121,000] <inf> bt_hci_core: Identity: 34:CD:B0:53:A2:18 (public)
[00:00:00.121,000] <inf> bt_hci_core: HCI: version 5.0 (0x09) revision 0x0016, manufacturer 0x02e5
[00:00:00.121,000] <inf> bt_hci_core: LMP: version 5.0 (0x09) subver 0x0016
Advertising successfully started
Indicate VND attr 0x3c04073c (UUID 12345678-1234-5678-1234-56789abcdef1)
Updated MTU: TX: 23 RX: 23 bytes
Connected
Updated MTU: TX: 527 RX: 65 bytes

@zhang-wenchao
Copy link
Contributor Author

zhang-wenchao commented Jan 21, 2025

Now the problem mainly lies in iOS. both examples Android and Linux are no problem.

I see you don't have an iOS device, I can help you test it if possible.

@jhedberg
Copy link
Member

@zhang-wenchao @sylvioalves FYI, there are some changes coming to the ECC Kconfig options, however that shouldn't necessitate any changes, unless you've been explicitly setting the BT_SEND_HCI_ECC_EMULATION option (which will soon not exist anymore): #84268

@sylvioalves
Copy link
Collaborator

sylvioalves commented Jan 21, 2025

@zhang-wenchao I got myself an iPad.. was able to reproduce:

Bluetooth initialized
Advertising successfully started
Connected 4A:D7:FB:A1:B1:5E (random)
Passkey for 4A:D7:FB:A1:B1:5E (random): 307082
[00:00:46.018,000] <wrn> net_buf: Timeout discarded. No blocking in syswq
[00:00:57.472,000] <wrn> bt_smp: Unexpected SMP code 0x08
[00:00:57.472,000] <wrn> bt_smp: The in-progress pairing has been deleted!
Pairing Failed (9). Disconnecting.
Security failed: 4A:D7:FB:A1:B1:5E (random) level 1 err (9)
Security changed: 4A:D7:FB:A1:B1:5E (random) level 2
[00:00:57.474,000] <wrn> bt_smp: Unexpected SMP code 0x09
Disconnected from 4A:D7:FB:A1:B1:5E (random), reason 0x05 

@kartben kartben added the priority: medium Medium impact/importance bug label Jan 21, 2025
@jhedberg jhedberg added the area: Bluetooth Host Bluetooth Host (excluding BR/EDR) label Jan 21, 2025
@jhedberg
Copy link
Member

[00:00:46.018,000] net_buf: Timeout discarded. No blocking in syswq

Just to rule out that this isn't the cause, could you try with #84282?

[00:00:57.472,000] bt_smp: Unexpected SMP code 0x08

FWIW, this is:

#define BT_SMP_CMD_IDENT_INFO			0x08

@sjanc sjanc removed their assignment Jan 21, 2025
@zhang-wenchao
Copy link
Contributor Author

I used the changes from this PR #84282

*** Booting Zephyr OS build v4.0.0-3684-gb361c9589ff0 ***
[00:00:00.024,000] <inf> esp32_bt_adapter: BT controller compile version [f583012]
[00:00:00.091,000] <inf> bt_hci_core: Identity: B0:81:84:AE:C7:28 (public)
[00:00:00.091,000] <inf> bt_hci_core: HCI: version 5.0 (0x09) revision 0x0016, manufacturer 0x02e5
[00:00:00.091,000] <inf> bt_hci_core: LMP: version 5.0 (0x09) subver 0x0016
Bluetooth initialized
Advertising successfully started
Connected 6E:FC:DB:88:18:E3 (random)
Passkey for 6E:FC:DB:88:18:E3 (random): 502139
[00:00:31.376,000] <wrn> bt_smp: Unexpected SMP code 0x08
[00:00:31.376,000] <wrn> bt_smp: The in-progress pairing has been deleted!
Pairing Failed (9). Disconnecting.
Security failed: 6E:FC:DB:88:18:E3 (random) level 1 err (9)
Security changed: 6E:FC:DB:88:18:E3 (random) level 2
[00:00:31.378,000] <wrn> bt_smp: Unexpected SMP code 0x09
Disconnected from 6E:FC:DB:88:18:E3 (random), reason 0x05 

@sylvioalves
Copy link
Collaborator

@zhang-wenchao, please, enable CONFIG_BT_PRIVACY=y and you will get it working.

@zhang-wenchao
Copy link
Contributor Author

Confirm this issue is resolved. thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants