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

BLEServer::updateConnParams works intermittently #10396

Open
1 task done
jefflongo opened this issue Oct 1, 2024 · 2 comments
Open
1 task done

BLEServer::updateConnParams works intermittently #10396

jefflongo opened this issue Oct 1, 2024 · 2 comments
Assignees
Labels
Area: BLE Issues related to BLE Status: Awaiting triage Issue is waiting for triage

Comments

@jefflongo
Copy link

jefflongo commented Oct 1, 2024

Board

ESP32-C3-DevKitM-1

Device Description

Plain module

Hardware Configuration

No

Version

v3.0.4

IDE Name

VSCode

Operating System

Ubuntu 24.04

Flash frequency

40MHz

PSRAM enabled

yes

Upload speed

115200

Description

I request the minimal connection parameters (7.5ms interval, 0 latency) upon connection. I have an Android app which connects and communicates frequently with the ESP32. In the main loop, I periodically print the connection parameters in the main loop. I expect to see the interval be set to 6, latency set to 0, timeout set to 100. Instead, I see interval set to 9, latency set to 0, and timeout set to 100 when successful. Around half the time, I instead see interval set to 40, latency set to 0, timeout set to 500 (which is the default before updating the connection parameters).

Sketch

Set the connection parameters on connect

class ServerCallbacks : public BLEServerCallbacks {
    void onConnect(BLEServer* server, esp_ble_gatts_cb_param_t* param) {
        // set the connection interval to the minimum of 7.5ms (6 * 1.25ms)
        server->updateConnParams(param->connect.remote_bda, 6, 6, 0, 100);
    };

    ...
};

Print the connection parameters periodically

// in loop...
esp_gap_conn_params_t params;
esp_ble_get_current_conn_params(connected_addr, &params);
log_i("Conn params: %d, %d, %d", params.interval, params.latency, params.timeout);

Debug Message

[ 12102][V][BLEUtils.cpp:1170] dumpGapEvent(): [status: 16, bd_addr: 4b:af:66:d4:44:e9, min_int: 6, max_int: 6, latency: 0, conn_int: 40, timeout: 500]

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@jefflongo jefflongo added the Status: Awaiting triage Issue is waiting for triage label Oct 1, 2024
@VojtechBartoska VojtechBartoska added the Area: BLE Issues related to BLE label Oct 2, 2024
@SuGlider
Copy link
Collaborator

SuGlider commented Oct 2, 2024

We are currently working on refactoring the ESP32 Arduino BLE Library.
It will be based on NimBLE instead of Bluedroid.
We expect to fix many issues, including a smaller firmware size.

This issue may be fixed after copleting the refactoring work.
Please follow it in #9878

@jefflongo
Copy link
Author

I ended up refactoring my project to use esp-idf with Arduino and NimBLE as components and I do believe it's solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BLE Issues related to BLE Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

4 participants