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
BLEDevice setPower having no affect on TxPower Level #939
Comments
Fixed using source code from
|
For the maximum range, "ESP_PWR_LVL_P9" should be used, which is the same as +9dBm. See https://docs.espressif.com/projects/esp-idf/en/v4.1/api-reference/bluetooth/controller_vhci.html for more info. I also have more details here: https://stackoverflow.com/a/66556561/3147100 |
I think that ESP_PWR_LVL_P7 should also be equivalent to ESP_PWR_LVL_P9 for "backward compatibility" according to the document above. |
no matter what i try its still -49 dbm |
I saw this discussion on Espressif forum - https://esp32.com/viewtopic.php?t=21011 -- looks like it is possible with ESP's API. Haven't tried it yet - but worth a try. |
Using ESP32 BLE Arduino 1.0.1 in Platformio IDE
I have tried several power levels using this command immediately after BLEDevice::init
BLEDevice::setPower(ESP_PWR_LVL_P7);
The advertised TxPowerLevel is always 3 in the iPhone BLE Scanner App and the RSSI values
don't change.
Seems like an old issue that was claimed to have been fixed?
Edit:
Fixed by adding all this:
BLEDevice::setPower(ESP_PWR_LVL_P7); // Changing had no affect. Client reports power level = 3 esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL0, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL1, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL2, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL3, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL4, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL5, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL6, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_CONN_HDL8, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9);
The advertised TxPower Level is now 9 and getting about 6 dB more power than default.
Perhaps BLEDevice::setPower should call the other esp_ble_tx_power_set statements.
The text was updated successfully, but these errors were encountered: