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

How to achieve long-distance connection communication? #661

Open
Blue186 opened this issue Apr 25, 2024 · 3 comments
Open

How to achieve long-distance connection communication? #661

Blue186 opened this issue Apr 25, 2024 · 3 comments

Comments

@Blue186
Copy link

Blue186 commented Apr 25, 2024

Hello,
what should I do to extend the Bluetooth connection distance? In terms of software, I set the maximum gain NimBLEDevice::setPower(ESP_PWR_LVL_P9); /** +9db */
but the distance is only about 8m, so the connection is unstable, but my Bluetooth antenna can support a connection distance of about 100m. (Using the ESP32 BLE basic library); Are there any other parameter settings that can achieve stable long-distance connections?

@h2zero
Copy link
Owner

h2zero commented Apr 25, 2024

Are you saying that with the bluedroid library you get more distance than with NimBLE? I don't know how that could be but please test and confirm so I can look at it. FWIW I get well over 30m with my esp32's at 9dbm.

@Blue186
Copy link
Author

Blue186 commented Apr 26, 2024

Thanks for answering my question,
It should be that my other configuration parameters were not done well. I found that by adjusting the parameters of pClient->updateConnParams();, I can adjust the connection distance, and finally successfully achieved a 100-meter connection.
image
At the same time, in addition to the updateConnParams function on the client, the server also has it. What configurations should I make on the client and server to achieve a stable and efficient connection between the client and the server? The main ones are connection distance and data delay.

@h2zero
Copy link
Owner

h2zero commented Apr 26, 2024

That makes sense, you should be loose with the timeout for distance, latency also if you're inclined. The min max interval being a factor of 15ms is recommended by Apple but there is no reason to follow that other than connecting with Apple devices that I can fathom. Trial and error here will be required to maximize if that's the goal.

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

2 participants