This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

sd_ble_gap_tx_power_set not working

Hello! I'm using nRF5_SDK_15.0.0_a53641a to programm my Nordic NRF52832 with Segger Embedded Studio.

I'm trying to increase the BLE Tx power to 4dBm. At the moment I've tried the following:

1. CHANGING THE TX POWER AFTER INIT SEQUENCE RIGHT BEFORE THE MAIN LOOP

Fullscreen
1
2
3
4
5
6
[... init stuff ...]
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, BLE_CONN_HANDLE_INVALID, -20); APP_ERROR_CHECK(err_code);
for (;;) {
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

RESULT: Absolute no change in advertising RSSI signal value

2. CHANGING THE TX POWER WHEN INITIALIZING ADVDATA

Fullscreen
1
2
3
4
5
6
7
static void advertising_init(void) {
[...]
uint8_t power_level = 4;
init.advdata.p_tx_power_level = &power_level;
[...]
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

RESULT: Absolute no change in advertising RSSI signal value

3. CHANGING THE TX POWER AFTER CONNECTING TO BLE DEVICE

case BLE_GAP_EVT_CONNECTED:

 

Fullscreen
1
2
3
4
[...]
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, m_conn_handle, 4);
APP_ERROR_CHECK(err_code);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


RESULT: Absolute no change in RSSI Signal value after connection

Am I missing something here???

Parents
  • Hi,

    How are you doing your tests?

    Case 1 & 3 should have an effect, but unless you use proper test equipment and an RF chamber then small changes in TX power (from 0 to 4 dBm e.g.) might not be practically measurable. However, if you switch between e.g. -30 and +4 dBm the effect should most definitely be noticeable. 

    Case 2 does not actually change the TX output power of the radio at all. It just updates a value in the advertising packet. 

    If this doesn't help, do you mind uploading some code I can use to test exactly what you are doing? 

  • Hi ,

    Im currently testing on the PCA10040 Development board.

    For the RSSI Signal measurement I'm using the iOS nRF Connect App.

    The modules I'm initializing are:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    int main(void)
    {
    bool erase_bonds;
    NRF_POWER->DCDCEN = 1;
    timers_init();
    buttons_leds_init(&erase_bonds);
    power_management_init();
    saadc_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    advertising_init();
    conn_params_init();
    peer_manager_init();
    spi_init();
    advertising_start(erase_bonds);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     

    changing the parameter of sd_ble_gap_tx_power_set form -40 to 4 does absolutely nothing to the RSSI signal value.

    This being around -42dBm when I place the phone about 10cm away from the devel board and around -60dBm when the board is about 1m apart.

    I suspect that one particular module or my particular BLE configuration are getting in the way.

    I'll test with the examples provided to see if I can reproduce the behaviour.

    Best,

    Eduardo.

Reply
  • Hi ,

    Im currently testing on the PCA10040 Development board.

    For the RSSI Signal measurement I'm using the iOS nRF Connect App.

    The modules I'm initializing are:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    int main(void)
    {
    bool erase_bonds;
    NRF_POWER->DCDCEN = 1;
    timers_init();
    buttons_leds_init(&erase_bonds);
    power_management_init();
    saadc_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    advertising_init();
    conn_params_init();
    peer_manager_init();
    spi_init();
    advertising_start(erase_bonds);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     

    changing the parameter of sd_ble_gap_tx_power_set form -40 to 4 does absolutely nothing to the RSSI signal value.

    This being around -42dBm when I place the phone about 10cm away from the devel board and around -60dBm when the board is about 1m apart.

    I suspect that one particular module or my particular BLE configuration are getting in the way.

    I'll test with the examples provided to see if I can reproduce the behaviour.

    Best,

    Eduardo.

Children
No Data