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

[nRF52840 SDK 16.0.0] ble beacon example change TX power level

Hi all,

I'm using the "ble_beacon_app" example from the SDK 16.0.0 with the nRF52840 DK. I would like to change the TX power level.

In main.c function, I tried to change the advertising_init() by adding the following code:

    int8_t tx_power_level = 8;
    advdata.p_tx_power_level = &tx_power_level;

I get no error by compiling the project, but the application doesn't work and I cannot see any device from the nRF connect App scanner.

Could you please help me where is the problem? Thank you in advance

Parents Reply Children
  • alfiero said:
    So, do I need only to add your code in the init function, or should I also change the advdata.p_tx_power_level in a different way? I do not full understand the functionality of this latter parameter.

    No, you do not need to add this. As I said, there is most likely not enough space in the advertising packet to include this anyway. The iBeacon format (which ble_app_beacon closely implements) does not include the parameter.

    alfiero said:
    I noticed that in this example project, the function  sd_ble_gap_tx_power_set() is not used at all. does it means that the device will keep the default settings of 0 dBm?

    Yes, the default of 0 dBm will be used when the tx_power is not explicitly set.

  • Ok, thank you so much, Jørgen!

    Another question (sorry to bother you): I saw that for 'long-range' mode, the data rate should be 125 kbps, so as to reduce receiving errors I guess. What is the default bitrate in this example? 1Mbps? How can I change it to 125 kbps to combine it with the +8 dBm output power, in order to achieve a very long-range transmission? Thank you in advance!!

  • Please post new questions in a new thread. We want to make the threads follow the topic of the subject, to make information more searchable. Note that many others have asked about long-range advertising before. You should find some examples and suggestions if you use the search-function.

Related