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

Can't set tx power level using sd_ble_gap_tx_power_set(tx_power) in S130

Can't set tx power level using sd_ble_gap_tx_power_set(tx_power) in S130.

Is there something special I must do? I'm trying to use this function to set the power to any of the defined values: -40, -30, -20, -16, -12, -8, -4, 0, 4 dbm's.

It always stays at 0.

Parents
  • Hi,

    Where exactly does it say '0'? In Master Control Panel?

    The number you see in MCP is actually a number you have to "manually" put into your advertising packet and has no dependancy on the actual tx power whatsoever (see this tutorial). It is not possible to read back the tx power level either (i.e. there is no sd_ble_gap_tx_power_get() for example).

    To keep track of the tx power you can declare a variable in your application holding your desired tx power. Then make sure to use this when you update your advertising packet and the power value using sd_ble_gap_tx_power_set().

    BTW: Have you experimented with various tx power levels and looked at your received signal strength (RSSI) in e.g. MCP? Just to see if you actually get any difference in RSSI or not?

  • After I set the tx power, I check the setting by looking at the memory location NRF_RADIO->TXPOWER with my debugger. This location always says 0. My assumption was that it would update.

    No I haven't experimented with different ranges, as I was relying on the NRF_RADIO->TXPOWER to tell me what my tx power level actually is.

    Can you confirm that this NRF_RADIO->TXPOWER does not update after using sd_ble_gap_tx_set()?

Reply
  • After I set the tx power, I check the setting by looking at the memory location NRF_RADIO->TXPOWER with my debugger. This location always says 0. My assumption was that it would update.

    No I haven't experimented with different ranges, as I was relying on the NRF_RADIO->TXPOWER to tell me what my tx power level actually is.

    Can you confirm that this NRF_RADIO->TXPOWER does not update after using sd_ble_gap_tx_set()?

Children
No Data
Related