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

Add configurable option to set BLE Power level #48

Open
corneliusmunz opened this issue Dec 23, 2020 · 1 comment
Open

Add configurable option to set BLE Power level #48

corneliusmunz opened this issue Dec 23, 2020 · 1 comment
Assignees
Labels
check Check if request/issue fits into library enhancement New feature or request

Comments

@corneliusmunz
Copy link
Owner

It would be good to enable the user to set the BLE Power level without calling NimBLE-Arduino functions. Maybe the default levels could be changed from -3dB to +9dB

The power levels for scan, advertisment and default could be changed with the static NimBLE-Arduino function
void NimBLEDevice::setPower(esp_power_level_t powerLevel, esp_ble_power_type_t powerType)

With esp_power_level_t

/*
ESP_PWR_LVL_N12 = 0, Corresponding to -12dbm
ESP_PWR_LVL_N9  = 1, Corresponding to  -9dbm
ESP_PWR_LVL_N6  = 2, Corresponding to  -6dbm
ESP_PWR_LVL_N3  = 3, Corresponding to  -3dbm
ESP_PWR_LVL_N0  = 4, Corresponding to   0dbm
ESP_PWR_LVL_P3  = 5, Corresponding to  +3dbm
ESP_PWR_LVL_P6  = 6, Corresponding to  +6dbm
ESP_PWR_LVL_P9  = 7, Corresponding to  +9dbm
*/

and esp_ble_power_type_t

/*
ESP_BLE_PWR_TYPE_ADV        = 9,  For advertising
ESP_BLE_PWR_TYPE_SCAN       = 10, For scan
ESP_BLE_PWR_TYPE_DEFAULT    = 11, For default, if not set other, it will use default value
 */

@fvanroie : I've seen this in your code and thought that this would be a good way to increase the usable distance of the BLE connections to the hubs. Do you have faced any issues about remarkable lower battery lifetimes?

@corneliusmunz corneliusmunz added check Check if request/issue fits into library enhancement New feature or request labels Dec 23, 2020
@corneliusmunz corneliusmunz self-assigned this Dec 23, 2020
@fvanroie
Copy link

Good idea!

I don't have much data I'm afraid, I only included that line because the HubRemote Led was sometimes blinking when bad reception. This annoyed/distracted me, so I upped the power level of the ESP32 😄 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
check Check if request/issue fits into library enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants