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?

  • The NRF_RADIO register is a restricted resource when you are running a SoftDevice (and I assume you do?). Hence, you can neither read from it nor write to it. The SD blocks the radio as well as some other hardware registers to prevent users to inadvertently change critical parameters during transmissions. You can see what resources are blocked in e.g. the s110 SoftDevice specification V2, Chapter 11.3.

Reply Children
No Data
Related