Advertiser and new connection makes data transmission speed slower.

Hello All,

I have a problem when I build my project from sample central_uart &  peripheral_uart.

I have two nrf5340 called A and BB scans the broadcast to A to establish a connection. Then A sends data to B which the speed could reach 1.2Mbps.

But when B starts to advertise, data transmission speed do4rops to 500-600kbps.

What's more, the data transmission speed drops to 300-400kbps when my phone connects B.

I wonder what caused this problem.

I build your project with CONFIG_BT_SCAN_WITH_IDENTITY=y.

Thank you.

static const struct bt_data ad[] = {
	BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
	BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
};

static const struct bt_data sd[] = {
	BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_NUS_VAL),
};

static void adv_start(void)
{
	struct bt_le_adv_param *adv_param =
		BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE |
				BT_LE_ADV_OPT_ONE_TIME,
				BT_GAP_ADV_FAST_INT_MIN_2,
				BT_GAP_ADV_FAST_INT_MAX_2,
				NULL);
	int err;

	err = bt_le_adv_start(adv_param, ad, ARRAY_SIZE(ad), sd,
			      ARRAY_SIZE(sd));
	if (err) {
		printk("Failed to start advertiser (%d)\n", err);
		return;
	}
}

Here is B's advertiser code.

static void adv_stop(void)
{
	int err;
	err = bt_le_adv_stop();
	if (err){
		printk("Failed to stop advertiser (%d)\n", err);
		return;
	}
}

Here is B's scanner code.

Parents
  • Hi,

    There is only a single radio, and it cannot receive and transmit at the same time. So when the peripheral advertises, that means that there less time for the connection (how much less depends on the advertising interval). Similarly, when your phone connects to the peripheral (B), it now has two connections, and there is even less time for the connection with A. Moreover, these are not synchronized as a peripheral has no influence over this, so here might be quite a lot of overlaps/collision of the connection events with the two connections.

Reply
  • Hi,

    There is only a single radio, and it cannot receive and transmit at the same time. So when the peripheral advertises, that means that there less time for the connection (how much less depends on the advertising interval). Similarly, when your phone connects to the peripheral (B), it now has two connections, and there is even less time for the connection with A. Moreover, these are not synchronized as a peripheral has no influence over this, so here might be quite a lot of overlaps/collision of the connection events with the two connections.

Children
Related