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

Bluetooth #42

Open
W0WAL opened this issue Jul 27, 2024 · 6 comments
Open

Bluetooth #42

W0WAL opened this issue Jul 27, 2024 · 6 comments

Comments

@W0WAL
Copy link

W0WAL commented Jul 27, 2024

Can’t get Bluetooth to connect to IPhone or laptop windows. Connects to kindle fire but disconnects when aprs droid tries to connect. 0.4v

@TemporarilyOffline
Copy link

Thank you for your hard work on building this firmware. It really shines! I am having the same problem with bluetooth. I've tried an android (Samsung Galaxy S21 and S24) as well as a raspberry pi 5 and a macbook. None of them can connect. Is this something I'm doing wrongor something I can help you troubleshoot?

@VE5CE
Copy link

VE5CE commented Sep 15, 2024

I too am having this issue. It will show up on my windows laptop and constantly connect and disconnect but no stable connection.
It will not show up on my iPhone or iPad.

@gbroeckling
Copy link

Nothing stable so far with 4 different devices

@derekmurawsky
Copy link

I cannot pair with my phone. It's saying incorrect pin but I am never prompted for a pin.
Can I somehow assist with this?

@derekmurawsky
Copy link

After digging, it looks like some code was commented out to handle security related features of bluetooth. I'm not sure if this is related or not, but I brought it up in the discussion as well. I'm not sure how to begin debugging this, or I would jump in and try to assist.
I did try setting a pin, and un-setting the pin, but it would not pair with my android device no matter what.

@derekmurawsky
Copy link

derekmurawsky commented Nov 3, 2024

This is related to the failure to pair with my Pixel 6. I get an error on my android device "Couldn't pair with ESP32APRS because of an incorrect PIN or passkey"

There is a 6 digit pin set on the device, but I also tried with it blanked out. Same error.

After connecting the serial monitor, the following errors appeared.

E (1828423) BT_SMP: smp_calculate_link_key_from_long_term_key failed to update link_key. Sec Mode = 2, sm4 = 0x00
E (1828424) BT_SMP: smp_derive_link_key_from_long_term_key failed

E (1828430) BT_BTM: btm_proc_smp_cback received for unknown device
E (1831438) BT_BTM: Device not found

I then compiled the firmware, with the BLE debugging uncommented, and got this dump.

[ 24549][D][BLEDevice.cpp:102] gattServerEventHandler(): gattServerEventHandler [esp_gatt_if: 3] ... ESP_GATTS_CONNECT_EVT
[ 24549][V][BLEUtils.cpp:1530] dumpGattServerEvent(): GATT ServerEvent: ESP_GATTS_CONNECT_EVT
[ 24557][V][BLEUtils.cpp:1590] dumpGattServerEvent(): [conn_id: 0, remote_bda: 6b:91:70:e8:4a:c2]
[ 24565][V][BLEServer.cpp:144] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT
[ 24575][D][BLEServer.cpp:366] onConnect(): BLEServerCallbacks
[ 24580][D][BLEServer.cpp:367] onConnect(): BLEServerCallbacks
[ 24586][D][BLEServer.cpp:368] onConnect(): BLEServerCallbacks
[ 24591][V][BLECharacteristic.cpp:205] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT
[ 24601][V][BLECharacteristic.cpp:465] handleGATTServerEvent(): << handleGATTServerEvent
[ 24609][V][BLECharacteristic.cpp:205] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT
[ 24619][V][BLECharacteristic.cpp:465] handleGATTServerEvent(): << handleGATTServerEvent
[ 24626][V][BLEServer.cpp:281] handleGATTServerEvent(): << handleGATTServerEvent
[ 24634][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SEC_REQ_EVT
[ 24642][V][BLEUtils.cpp:1259] dumpGapEvent(): [bd_addr: 6b:91:70:e8:4a:c2]
[ 24648][I][BLEDevice.cpp:222] gapEventHandler(): ESP_GAP_BLE_SEC_REQ_EVT
[ 24655][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 24661][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 10]
[ 26440][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_KEY_EVT
[ 26440][V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[ 26444][D][BLEDevice.cpp:247] gapEventHandler(): ESP_GAP_BLE_KEY_EVT
[ 26450][I][BLEDevice.cpp:249] gapEventHandler(): key type = ESP_LE_KEY_LENC
[ 26457][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 26463][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 9]
[ 26470][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_KEY_EVT
[ 26478][V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[ 26486][D][BLEDevice.cpp:247] gapEventHandler(): ESP_GAP_BLE_KEY_EVT
[ 26492][I][BLEDevice.cpp:249] gapEventHandler(): key type = ESP_LE_KEY_PENC
[ 26499][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 26504][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 9]
[ 26512][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_KEY_EVT
[ 26519][V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[ 26527][D][BLEDevice.cpp:247] gapEventHandler(): ESP_GAP_BLE_KEY_EVT
[ 26533][I][BLEDevice.cpp:249] gapEventHandler(): key type = ESP_LE_KEY_LID
[ 26540][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 26546][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 9]
[ 26553][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_KEY_EVT
[ 26561][V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[ 26568][D][BLEDevice.cpp:247] gapEvenE (34453) BT_SMP: smp_calculate_link_key_from_long_term_key failed to update link_key. Sec Mode = 2, sm4 = 0x00
E (34461) BT_SMP: smp_derive_link_key_from_long_term_key failed

E (34468) BT_BTM: btm_proc_smp_cback received for unknown device
tHandler(): ESP_GAP_BLE_KEY_EVT
[ 26596][I][BLEDevice.cpp:249] gapEventHandler(): key type = ESP_LE_KEY_LCSRK
[ 26603][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 26608][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 9]
[ 26616][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_KEY_EVT
[ 26623][V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[ 26631][D][BLEDevice.cpp:247] gapEventHandler(): ESP_GAP_BLE_KEY_EVT
[ 26637][I][BLEDevice.cpp:249] gapEventHandler(): key type = ESP_LE_KEY_PID
[ 26644][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 26650][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 9]
[ 26657][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_KEY_EVT
[ 26665][V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[ 26672][D][BLEDevice.cpp:247] gapEventHandler(): ESP_GAP_BLE_KEY_EVT
[ 26678][I][BLEDevice.cpp:249] gapEventHandler(): key type = ESP_LE_KEY_PCSRK
[ 26685][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 26691][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 9]
[ 26700][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_AUTH_CMPL_EVT
[ 26707][V][BLEUtils.cpp:1105] dumpGapEvent(): [bd_addr: 6b:91:70:e8:4a:c2, key_present: 0, key: ***, key_type: 0, success: 0, fail_reason: 85, addr_type: ***, dev_type: ESP_BT_DEVICE_TYPE_BLE]
[ 26723][I][BLEDevice.cpp:253] gapEventHandler(): ESP_GAP_BLE_AUTH_CMPL_EVT
[ 26730][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 26736][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 8]
[ 29590][D][BLEDevice.cpp:102] gattServerEventHandler(): gattServerEventHandler [esp_gatt_if: 3] ... ESP_GATTS_DISCONNECT_EVT
[ 29590][V][BLEUtils.cpp:1530] dumpGattServerEvent(): GATT ServerEvent: ESP_GATTS_DISCONNECT_EVT
[ 29598][V][BLEUtils.cpp:1606] dumpGattServerEvent(): [conn_id: 0, remote_bda: 6b:91:70:e8:4a:c2]
[ 29607][V][BLEServer.cpp:144] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT
[ 29616][D][BLEServer.cpp:379] onDisconnect(): BLEServerCallbacks
[ 29622][D][BLEServer.cpp:380] onDisconnect(): BLEServerCallbacks
[ 29628][D][BLEServer.cpp:381] onDisconnect(): BLEE (37512) BT_BTM: Device not found

ServerCallbacks
[ 29637][V][BLECharacteristic.cpp:205] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT
[ 29647][V][FreeRTOS.cpp:143] give(): Semaphore giving: name: ConfEvt (0x3fcb5bcc), owner: <N/A>
[ 29655][V][BLECharacteristic.cpp:465] handleGATTServerEvent(): << handleGATTServerEvent
[ 29663][V][BLECharacteristic.cpp:205] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT
[ 29673][V][FreeRTOS.cpp:143] give(): Semaphore giving: name: ConfEvt (0x3fcb6690), owner: <N/A>
[ 29682][V][BLECharacteristic.cpp:465] handleGATTServerEvent(): << handleGATTServerEvent
[ 29690][V][BLEServer.cpp:281] handleGATTServerEvent(): << handleGATTServerEvent
[ 30125][V][BLEServer.cpp:328] startAdvertising(): >> startAdvertising
[ 30126][V][BLEDevice.cpp:584] startAdvertising(): >> startAdvertising
[ 30127][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 30133][V][BLEAdvertising.cpp:187] start(): >> start: customAdvData: 0, customScanResponseData: 0
[ 30141][D][BLEAdvertising.cpp:206] start(): - no services advertised
[ 30148][V][BLEAdvertising.cpp:252] start(): <[ < s30t1ar5t1]
[V[ ]3[B01L5EU2]t[ilVs].[BcpLpE:De1v04ic9e]. dcpumpp:G58a6pE] vstaernttA()dv: erRteciseiivnged() a GAP:  <ev< enstt: aErtSAPd_vGePrt_BisLEi_nAgD
c_[D 3A0T1A_S59ET][_VC]OM[BPLLEETSEer_EveVTr.
pp[ :330310]6 s1t]a[rV]tA[BdvLEeUrttiislsin.cg(pp)::10 5<< 6s]t adrtuAmpdGvaerpEtivesinntg()
 [status: 0]
[ 30167][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 30172][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 0]
[ 30180][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT
[ 30190][V][BLEUtils.cpp:1206] dumpGapEvent(): [status: 0]
[ 30195][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 30200][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 1]
[ 30208][V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_ADV_START_COMPLETE_EVT
[ 30217][V][BLEUtils.cpp:1074] dumpGapEvent(): [status: 0]
[ 30222][D][BLEDevice.cpp:579] getAdvertising(): get advertising
[ 30228][D][BLEAdvertising.cpp:506] handleGAPEvent(): handleGAPEvent [event no: 6]

Could be related to this? looks like it's not handling some kind of encryption context properly?

I'm not sure what any of it means, but I'm starting to poke at it a bit. @nakhonthai any thoughts on the above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants