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

NimBLEDevice::setPower(int dbm) not working as expected (NRF52840) #599

Closed
lilindian16 opened this issue Nov 2, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@lilindian16
Copy link

NRF52840-QIAA
n-able core version = 1.0.0
NimBLE-Arduino version = 1.4.1

platformio.ini config:
platform = https://github.com/h2zero/platform-n-able.git#1.0.0
framework = arduino
lib_deps = h2zero/NimBLE-Arduino@^1.4.0
upload_protocol = jlink
board = generic_nrf52840
debug_tool = jlink

Using NimBLEDevice::setPower(int dbm) seems to not change the tx power from what I can tell.

Iterating through the following dbm values shows no change using LightBlue to read RSSI:
{RADIO_TXPOWER_TXPOWER_Neg4dBm, RADIO_TXPOWER_TXPOWER_0dBm, RADIO_TXPOWER_TXPOWER_Pos3dBm, RADIO_TXPOWER_TXPOWER_Pos4dBm}
Reading RSSI on LightBlue app shows no change between all four settings

The workaround I have used so far is changing nimconfig MYNEWT_VAL_BLE_LL_TX_PWR_DBM=0 to MYNEWT_VAL_BLE_LL_TX_PWR_DBM=4 with platformio build flag build_flags = -DMYNEWT_VAL_BLE_LL_TX_PWR_DBM=4
Reading RSSI on LightBlue shows immediate change after device is flashed with new config

@h2zero
Copy link
Owner

h2zero commented Nov 3, 2023

Interesting, do you see any change if you use the numerical values instead of the macros, i.e -4 etc?

@j45p41
Copy link

j45p41 commented Feb 23, 2024

NRF52840-QIAA n-able core version = 1.0.0 NimBLE-Arduino version = 1.4.1

platformio.ini config: platform = https://github.com/h2zero/platform-n-able.git#1.0.0 framework = arduino lib_deps = h2zero/NimBLE-Arduino@^1.4.0 upload_protocol = jlink board = generic_nrf52840 debug_tool = jlink

Using NimBLEDevice::setPower(int dbm) seems to not change the tx power from what I can tell.

Iterating through the following dbm values shows no change using LightBlue to read RSSI: {RADIO_TXPOWER_TXPOWER_Neg4dBm, RADIO_TXPOWER_TXPOWER_0dBm, RADIO_TXPOWER_TXPOWER_Pos3dBm, RADIO_TXPOWER_TXPOWER_Pos4dBm} Reading RSSI on LightBlue app shows no change between all four settings

The workaround I have used so far is changing nimconfig MYNEWT_VAL_BLE_LL_TX_PWR_DBM=0 to MYNEWT_VAL_BLE_LL_TX_PWR_DBM=4 with platformio build flag build_flags = -DMYNEWT_VAL_BLE_LL_TX_PWR_DBM=4 Reading RSSI on LightBlue shows immediate change after device is flashed with new config

hi @lilindian16 I used your suggestion and it increased power to 4dbm - did you ever get it to 8dbm? if so can you share pls?

@h2zero h2zero added the bug Something isn't working label Jun 5, 2024
@h2zero
Copy link
Owner

h2zero commented Jul 2, 2024

Fixed in #679

@h2zero h2zero closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants