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

BLE running randomly disconnet when receiving Params_update (IDFGH-13402) #14309

Closed
3 tasks done
sergiutigu opened this issue Aug 6, 2024 · 2 comments
Closed
3 tasks done
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@sergiutigu
Copy link

sergiutigu commented Aug 6, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v4.3

Espressif SoC revision.

ESP32

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

Development Kit.

custom board

Power Supply used.

USB

What is the expected behavior?

The ESP32 is running as a BLE central. We do mage to re-connect to the bonded peripheral:
00000003 NPI_BT_RC(10): ESP_GAP_BLE_AUTH_CMPL_EVT
00000003 NPI_BT_RC(10): remote BD_ADDR: cc:c8:2a:6b:aa:62
00000003 NPI_BT_RC(10): address type = 1
00000003 NPI_BT_RC(10): pair status = success

We also manage to receive some data from the peripheral before the Update parameters:
00000003 NPI_BT_RC(10): ESP_GATTC_NOTIFY_EVT
00000003 BT_RC(4): Data: MSB 0x00100000 LSB
00000003 MDH_MACI(4): BT DATA FW !
00000003 NPI_BT_RC(10): ESP_GATTC_NOTIFY_EVT
00000003 BT_RC(4): Data: MSB 0x00000000 LSB
00000003 MDH_MACI(4): BT DATA FW !

Then the Update paramteres happneds. Here we should remain connected like below:
<\r>0000000E NPI_BT_RC(10): update connection params status = 0, min_int = 0, max_int = 0,conn_int = 12,latency = 32, timeout = 150<\n>
<\r>0000000E NPI_BT_RC(10): ESP_GATTC_NOTIFY_EVT, receive notify value: 3f8165e0<\n>
<\r>0000000E BT_RC(4): Data: MSB 0x10000000 LSB<\n>
<\r>0000000F NPI_BT_RC(10): ESP_GATTC_NOTIFY_EVT, receive notify value: 3f8165e0<\n>
<\r>0000000F BT_RC(4): Data: MSB 0x00000000 LSB<\n>
<\r>00000010 NPI_BT_RC(10): ESP_GATTC_NOTIFY_EVT, receive notify value: 3f8165e0<\n>
<\r>00000010 BT_RC(4): Data: MSB 0x00100000 LSB<\n>

What is the actual behavior?

This is the actual behaviour in the failing ase:
<\r>660E7800 NPI_BT_RC(10): ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT<\n>
<\r>660E7800 NPI_BT_RC(10): update connection params status = 0, min_int = 0, max_int = 0,conn_int = 12,latency = 32, timeout = 150<\n>
<\r>660E7800 NPI_BT_RC(10): ESP_GATTC_NOTIFY_EVT, receive notify value: 3f812ffc<\n>
<\r>660E7800 BT_RC(4): Data: MSB 0x00100000 LSB<\n>
<\r>660E7801 NPI_BT_RC(10): ESP_GATTC_NOTIFY_EVT, receive notify value: 3f812ffc<\n>
<\r>660E7801 BT_RC(4): Data: MSB 0x00000000 LSB<\n>
<\r><27>[0;33mW (122498) BT_HCI: DiscCmpl evt: hdl=0, rsn=0x8<27>[0m<\r><\n>
<27>[0;33mW (122499) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x8<27>[0m<\r><\n>
660E7803 NPI_BT_RC(10): ESP_GATTC_DISCONNECT_EVT, reason = 0x8<\n>
<\r>660E7803 BT_RC(4): Data: MSB 0x00000000 LSB<\n>
<\r>660E7803 NPI_BT_RC(10): ESP_GATTC_CLOSE_EVT, conn_id = 0, status = 0, reason = 0x8<\n>

This always happens immediately after:
ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT.

Steps to reproduce.

  1. ESP32 as a BLE central.
  2. Connect and bond a perhiperal.
  3. Reset the ESP32.
  4. The BLE Central will re-connect .
  5. The ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT arrives.
  6. The disconnect happnes.
    ...

Debug Logs.

Logs provided in bug descpription.

More Information.

This issue appera 10% cases and causes the remote control to loose conectivity to the appliance. The reconnects happens roughly after 15 seconds. During this time the user can not use the appliance. We need support to resolve this issue since from the application side , i don't know what we can do

@sergiutigu sergiutigu added the Type: Bug bugs in IDF label Aug 6, 2024
@github-actions github-actions bot changed the title BLE running randomly disconnet when receiving Params_update BLE running randomly disconnet when receiving Params_update (IDFGH-13402) Aug 6, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Aug 6, 2024
@esp-zhp
Copy link
Collaborator

esp-zhp commented Aug 7, 2024

@sergiutigu
From the log (status = 0, min_int = 0, max_int = 0, conn_int = 12, latency = 32, timeout = 150), we can see that the connection interval is 15ms, the latency is 32, and the timeout is 1500ms. This means that the formula timeout / (1 + latency) * interval results in approximately 3, indicating only three opportunities to receive a packet. If there is significant interference in the air, the likelihood of disconnection increases. Therefore, I recommend increasing the timeout, for example, to 3000ms.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Aug 7, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress labels Oct 23, 2024
@Alvin1Zhang
Copy link
Collaborator

Thanks for reporting, will close due to short of feedback, feel free to reopen with more details, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants