This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Zephyr - How to set BLE Adversting Tx Power.

Hello All,

I am new to zephyr. How to set BLE Advertising Tx power? like for example, I want to set 0dBm.

Thanks in advance

Neeraj Dhekale

  • Hi Neeraj

    If you just need static TX power control you can use one of the BT_CTRL_TX_PWR configurations, which can be changed through the Kconfig configurator in VSCode like this:

    Or you can just add one of the configurations to your prj.conf file, like this (for 4 dBm TX power):

    CONFIG_BT_CTLR_TX_PWR_PLUS_4=y

    If you want dynamic TX power control, where you can change the TX power at runtime, it is a bit more complex. 

    Fortunately there is a sample showing how to do this, described here

    Best regards
    Torbjørn

  • Thanks 

    It works, Is there any way to check what Tx power currently it is transmitting with? I mean for example if I am setting 0dBm and in some device, and some device is transmitting with +4,+8dBm. Then can I check somewhere like nRF connect app where I will get the Tx Power of each device?. Without writing the above dynamic complex code.

    Thanks and regards,

    Neeraj Dhekale

  • Hi Neeraj

    When receiving advertise packets the nRF Connect applications (desktop and mobile) will show an approximate signal strength (RSSI) of the received packet, but this is the signal strength seen by the receiver, which is a lot lower than the output power of the radio. 

    While this reading is not very accurate it should still be good enough to show a relative difference after you change the output power setting. Especially if you try to use very different values, such as -20dBm versus 0dBm. 

    Just make sure not to move the kits between measurements, as this will change the link loss. 

    If you just want to double check that the TX power is actually changed it should also be possible to check the status of the NRF_RADIO->TXPOWER register with the debugger. 

    Best regards
    Torbjørn

Related