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

mesh sdk2.1.1 TX power of nrf52832

Hi Nordic:

I want to change TX power of mesh-sdk.2.1.1 light switch, I've follow 

https://devzone.nordicsemi.com/f/nordic-q-a/34491/mesh-range-power-and-mode

and set NRF_RADIO->TXPOWER =  RADIO_POWER_NRF_POS4DBM  or RADIO_POWER_NRF_NEG20DBM

of radio_config.c file radio_config_config() 

But my instrument show the TX power is almost same(I didn't provision light-switch device, so I saw there are RF signal in ch37, 38, 39, but power level is almost same)

I want to ask if my modification above is correct? how to change tx power of nrf52832 of mesh-sdk2.1.1?

Regards,

Joseph 

  • Hi nordic:

    Is there any update for this issue?

    Today I just modify 3 places:

    1. set_default_broadcast_configuration() of advertisr.c

    p_broadcast->params.radio_config.tx_power = RADIO_POWER_NRF_POS4DBM

    2. radio_config_config

    NRF_RADIO->TXPOWER = RADIO_POWER_NRF_POS4DBM;

    3. scanner_init() of scanner.c

    m_scanner.config.radio_config.tx_power = RADIO_POWER_NRF_POS4DBM

    And in segger debugger mode, I can see radio TXPower register is changed to 4dbm value, but my instrument still got same measurement value compared to RADIO_POWER_NRF_NEG16DBM setting, could you please guide us how to set tx_power in mesh-sdk-2.1.1?

    Regards,

    Joseph

  • Hi Joseph,

    Very sorry for the delayed response. Just tested this. I replied to a similar devzone case here, where I wrote the following:

    The old answer is left below (relevant to the Mesh SDK, not nRF 5 SDK): There have been quite a few questions & answers regarding this on the devzone, but unfortunately it is not possible to use sd_ble_gap_tx_power_set() to change the TX transmit power of the radio (for the Mesh SDK!).

    The radio_config_config() function in radio_config.c sets the transmit power of the radio. If you take a look at mesh sdk v2.1.1 with the light switch example (take provisioner for example), you can see that the advertiser_instance_init() function in advertiser.c calls set_default_broadcast_configuration(). This function sets the TX radio output power. Then, back in advertiser_instance_init(), the timeout_event callback is called. This function calls schedule_broadcast() if the broadcast context is inactive. Inside schedule_broadcast(), the broadcast_send() function is called, which starts the broadcast_start() callback function. It is broadcast_start() which then finally calls radio_config_config(), which sets the tx power:

    NRF_RADIO->TXPOWER = p_config->tx_power;

    To summarize: I believe you will only need to change the radio tx power in set_default_broadcast_configuration().

    I tested by setting the radio tx power to -40 dBm & comparing the results by changing it to plus 4 dBm. I noticed a large difference in RSSI between these two tx powers.

    Kind Regards,

    Bjørn

Related