Trying to receive only one packet per connection interval for every connection on a multi-link environment on SDK 1.7.0

Hi,

The project is a multi-link environment of nrf52840, The 7 peripherals has the task of send data constantly of a sensors. All is working on coded_s8.

The objective is keep the higher data rate of msgs received by central, but to guarantee the uniformity between every peripheral. For that i have done a deep investigation on how the central schedule the connections, and what is the best strategy to receive the data.

The ATT_MTU is set to minimum 23 bytes because of coded_s8.

Time on air of a packet= 80+256+16+24+(23*8*8)+(24*8)+(3*8)=2'064ms

So if I disable Connection Event Length extension with:

static int EvtLen(void)
{       
        int err;
	struct net_buf *buf;
	sdc_hci_cmd_vs_conn_event_extend_t *evt_enable;

	buf = bt_hci_cmd_create(SDC_HCI_OPCODE_CMD_VS_CONN_EVENT_EXTEND,
				sizeof(*evt_enable));
	if (!buf) {
		printk("Could not allocate LLPM command buffer\n");
		return -ENOMEM;
	}
        evt_enable = net_buf_add(buf, sizeof(*evt_enable));
	evt_enable->enable = 0;

	err = bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_CONN_EVENT_EXTEND, buf, NULL);
	if (err) {
		printk("Error enabling EVENT %d\n", err);
		return err;
	}

	printk("EVENT mode enabled\n");
	return 0;
}

And fix the maximum T event length on Kconfig with:

CONFIG_SDC_MAX_CONN_EVENT_LEN_DEFAULT=2500
Theorically making this configuration i guarantee that on a connection interval of 2500ms*7devices=17500ms/1.25=14 units i have enought time to attend the 7 devices and receive 1 packet of every one (Maybe could be packet drop but no may be systematic). Unfortunately I am not able to achieve this. Most of the times one or 2 devices keep sending half data comparing with the rest. I tried to modify a little the conn_interval without success.
If you could suggest me something more to try I will appreciate it, all code shared is done on Central
Thank you and regards.
Parents
  • I have another related question of schedule of central:

    Imagine the next context, only one peripheral with a maximum forced Tevent=2.5ms, Extended connection Event disabled, and a Conn_interval=1000ms.

    Independently of how much messages queued on tx of peripheral, theorically the Central only is going to receive 1 message every second, isn't it? Because on all Conn_interval of 1000ms the Central attend to peripheral once while the 2.5ms of Tevent.

    Thank you, regards.

  • Hi,

    If you could suggest me something more to try I will appreciate it

    Yes, if you could try to increase CONFIG_SDC_MAX_CONN_EVENT_LEN_DEFAULT closer to 3600 us. Looking at a sniffer trace a captured  a while back, the transmission time plus T_IFS for a 27 byte s8 encoded packet is actually 2600 us. You also need  time to time receive the acknowledgment packet from the central.

    Also, when determining what connection interval to use, note that there is a ~1.4 ms delay between scheduling of connection events that need to be accounted for:

    sotillo2409 said:
    Independently of how much messages queued on tx of peripheral, theorically the Central only is going to receive 1 message every second, isn't it? Because on all Conn_interval of 1000ms the Central attend to peripheral once while the 2.5ms of Tevent.

    Yes, that is correct.

    Best regards,

    Vidar

  • Also, be ware that the GAP peripheral may send a connection parameter update request to change the initial connection parameters set by the central

    This was happening, i reject the petiton and now is working correctly.

    On Uart example(where i based my project) that callback isn't visible on main.c, i am stuck on this point like a month. I was trying to change Conn_interval on differents ways and valors and all was useless hahahaha.

    Yes, if you could try to increase CONFIG_SDC_MAX_CONN_EVENT_LEN_DEFAULT closer to 3600 us. Looking at a sniffer trace a captured  a while back, the transmission time plus T_IFS for a 27 byte s8 encoded packet is actually 2600 us. You also need  time to time receive the acknowledgment packet from the central.

    And with this my project is working perfectly now, i am so gratefull with you, 

    thank you, regards.

  • Great! I'm glad to hear that it works now.

    sotillo2409 said:
    On Uart example(where i based my project) that callback isn't visible on main.c, i am stuck on this point like a month. I was trying to change Conn_interval on differents ways and valors and all was useless hahahaha.

    It's unfortunate that you were stuck on this for so long. I recommend you install our nRF Sniffer for Bluetooth LE if you ever need to troubleshoot similar issues in the future.

  • I recommend you install our nRF Sniffer for Bluetooth LE if you ever need to troubleshoot similar issues in the future.

    Unfortunatelly that sniffer doen't sniff coded_s8 connection packets, and all my project is based on that, but thank you 

  • Support for coded PHY got introduced in version 4.0.0 of the sniffer actually. A nRF52840DK or nRF52840 Dongle is needed to use this feature.

  • I have follow the tutorial of nRF Sniffer step by step with a nrf52840 dongle and i am able to sniff o Wireshark, but is impossible to me find the configuration or filter to make it on coded_s8.

    Knowing that is possible I willl re-investigate and probably update the version, Thanks for the information.

Reply Children
Related