Setting the TX Power and checking it in the terminal

Hello

I'm working with the nRF21540 and the nRF Connect SDK 2.6.2.

I would like to set my TX Power to 20 dBm and also check this value. Currently my configuration looks like this:

CONFIG_BT=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV=y
CONFIG_BT_DEVICE_NAME="PAwR adv sample"

CONFIG_BT_MAX_CONN=1
CONFIG_BT_CENTRAL=y
CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER=y

CONFIG_BT_PER_ADV_RSP=y

CONFIG_BT_REMOTE_INFO=y
CONFIG_BT_GATT_CLIENT=y

CONFIG_LOG=y

CONFIG_BT_CTLR=y

# floating-point support
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

# PHY
CONFIG_BT_CTLR_PHY_2M=y

# FEM
CONFIG_MPSL=y
CONFIG_MPSL_FEM=y
CONFIG_MPSL_FEM_NRF21540_GPIO=y
CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
CONFIG_BT_CTLR_TX_PWR_ANTENNA=20

# RSSI 
CONFIG_BT_CTLR_CONN_RSSI=y

Unfortunately, I don't know if that's correct. I tried to test the value as follows:

static void response_cb(struct bt_le_ext_adv *adv, struct bt_le_per_adv_response_info *info,
		     struct net_buf_simple *buf)
{
	if (buf) {
		printk("Response: subevent %d, slot %d\n", info->subevent, info->response_slot);
		bt_data_parse(buf, print_ad_field, info);
		printk("RSSI: %d dBm\t", info->rssi);
		printk("TX Power: %d dBm\n", info->tx_power);
		increment_responses();
		
	} else {
		printk("Failed to receive response: subevent %d, slot %d\n", info->subevent,
		       info->response_slot);
		
	}
	
	
}

If I output the value for the TX Power, I always get a value of 127, the RSSI value is in a range between -17 and -22 dBm.

Is there something wrong with this in general or how can I set the TX Power to 20 dBm and then check it?

Thank you and best regards,

Alexandra

Parents
  • Hi

    What RSSI do you see when you set the TX power lower on your end? Does it change at all or stay similar? Are you using the GPIO to set up the nRF21540 on your end? You can use the CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA to set the TX gain of the nRF21540. This defaults to 20dBm, so it might be set to 20 already in your case. Can you try setting it lower to see if the RSSI is notably lower on your end?

    Please also note that in the EU, 20 dBm is not allowed in commercial products, and a maximum of 10dBm is allowed. Just wanted to let you know that this is regulated. In markets like the US and some Asian countries this is fine though, I just wanted to let you know since you're located in the EU.

    Best regards,

    Simon

Reply
  • Hi

    What RSSI do you see when you set the TX power lower on your end? Does it change at all or stay similar? Are you using the GPIO to set up the nRF21540 on your end? You can use the CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA to set the TX gain of the nRF21540. This defaults to 20dBm, so it might be set to 20 already in your case. Can you try setting it lower to see if the RSSI is notably lower on your end?

    Please also note that in the EU, 20 dBm is not allowed in commercial products, and a maximum of 10dBm is allowed. Just wanted to let you know that this is regulated. In markets like the US and some Asian countries this is fine though, I just wanted to let you know since you're located in the EU.

    Best regards,

    Simon

Children
Related