Extend number of devices for PAwR (Coded PHY)

Hi all !

I'm writing this message because I'm having problems trying to increase the number of devices in PAwR (I use Coded PHY).

I based my development on the SDK 2.8.0 example (Periodic_adv_conn / Periodic_sync_conn). I also tried Periodic_adv_rsp / Periodic_sync_rsp examples without success.

I've modified it so that I don't have to connect every time via on the TX side:

Fullscreen
1
bt_conn_le_create_synced function()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

On the RX side, I have a fixed subevent and slot numbers to answer to TX.

Based on SDK example, I can exchange data with 25 devices (5 subevents / 5 slots)

I used the following configuration:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#define NUM_RSP_SLOTS 5
#define NUM_SUBEVENTS 5
#define SUBEVENT_INTERVAL 0x30
static const struct bt_le_per_adv_param per_adv_params = {
.interval_min = 0xFF,
.interval_max = 0xFF,
.options = 0,
.num_subevents = NUM_SUBEVENTS,
.subevent_interval = SUBEVENT_INTERVAL,
.response_slot_delay = 0x5,
.response_slot_spacing = 0x50,
.num_response_slots = NUM_RSP_SLOTS,
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I try to increase the number of devices (8 subevents / 20 slots per subevent), I don't get the same behavior.

Below are the timings I use depending on the number of subevents and slots.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
#define NUM_RSP_SLOTS 20
#define NUM_SUBEVENTS 8
static const struct bt_le_per_adv_param per_adv_params = {
.interval_min = 0x960,
.interval_max = 0x960,
.options = 0,
.num_subevents = NUM_SUBEVENTS,
.subevent_interval = 0xF0,
.response_slot_delay = 0x10,
.response_slot_spacing = 0x50,
.num_response_slots = NUM_RSP_SLOTS,
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I saw that the PAwR feature is still experimental in the las version of the SDK, could this be related or is there something I'm doing wrong?

Thank you in advance for your answers or feedbacks.

Yann

Parents
  • Hi Yann,

    Your configurations seem feasible. Could you please provide more details on what kind of failure you are facing?

    Are there any logs? What are the symptoms?

    Hieu

  • Hi Hieu,

    Thanks for you answer.

    Yes sure, what I can see is that with the initial parameters (5 subevents / 5 slots per subevent) I can synchronize and exchange data between transmitter and receiver.

    Transmitter:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    [00:00:00.011,535] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.011,566] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.011,596] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906
    [00:00:00.012,786] <inf> bt_hci_core: Identity: C8:22:35:1D:70:9F (random)
    [00:00:00.012,817] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x104e, manufacturer 0x0059
    [00:00:00.012,847] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x104e
    Start Periodic Advertising
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Receiver:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    Synced to 69:D7:06:00:1C:75 (random) with 5 subevents
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Now if I update parameters (Subevents 8 / Slots per subevent 20)

    With these settings, the device receiving the PAwR signals can't synchronize.

    Transmitter:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    [00:00:00.011,352] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.011,383] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.011,413] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906
    [00:00:00.012,573] <inf> bt_hci_core: Identity: C8:22:35:1D:70:9F (random)
    [00:00:00.012,634] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x104e, manufacturer 0x0059
    [00:00:00.012,664] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x104e
    Start Periodic Advertising
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Receiver:

    Fullscreen
    1
    2
    3
    4
    5
    Synced to 71:31:A2:CE:53:E5 (random) with 8 subevents
    Failed to set subevents to sync to (err -5)
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    Failed to send response (err -5)
    Receive Terminated Callback
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

     

Reply
  • Hi Hieu,

    Thanks for you answer.

    Yes sure, what I can see is that with the initial parameters (5 subevents / 5 slots per subevent) I can synchronize and exchange data between transmitter and receiver.

    Transmitter:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    [00:00:00.011,535] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.011,566] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.011,596] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906
    [00:00:00.012,786] <inf> bt_hci_core: Identity: C8:22:35:1D:70:9F (random)
    [00:00:00.012,817] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x104e, manufacturer 0x0059
    [00:00:00.012,847] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x104e
    Start Periodic Advertising
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    PAwR RSP : Subevent : 0 Slot : 2
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Receiver:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    Synced to 69:D7:06:00:1C:75 (random) with 5 subevents
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Now if I update parameters (Subevents 8 / Slots per subevent 20)

    With these settings, the device receiving the PAwR signals can't synchronize.

    Transmitter:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    [00:00:00.011,352] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.011,383] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.011,413] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906
    [00:00:00.012,573] <inf> bt_hci_core: Identity: C8:22:35:1D:70:9F (random)
    [00:00:00.012,634] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x104e, manufacturer 0x0059
    [00:00:00.012,664] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x104e
    Start Periodic Advertising
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Receiver:

    Fullscreen
    1
    2
    3
    4
    5
    Synced to 71:31:A2:CE:53:E5 (random) with 8 subevents
    Failed to set subevents to sync to (err -5)
    DEBUG - CMD RESP 0x0 0x1 0x0 0x0 0x0
    Failed to send response (err -5)
    Receive Terminated Callback
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

     

Children
  • Hi Yann,

    Unfortunately, I am working remotely and do not have enough device to reproduce the issue.

    What do you think about starting from the working baseline, and slowly change the configurations, and do incremental tests to see at which point the issue occurs?

    I recommend this order:

    1. Periodic Advertising Interval
    2. Subevent Interval
    3. Number of Subevents
    4. Response Slot Delay
    5. Response Slot Spacing
    6. Number of Response Slots

    If you are able to detect which one fail, try switching up the order, but of course keep it feasible (e.g., don't increase Number of Subevents before you have widened the Advertising Interval)

    It would give us some clues on what is wrong.

  • Hi Hieu,

    No problem, I can check again from my side if I change parameters step by step and I will tell you.

    Just a question, from your side in Nordic did you already tried to use PAwR with more than 25 devices (5 subevents / 5 slots) ?

    Thank you,

    Yann

  • Hi Yann,

    We have tested more than 25 devices. We wrote about it a little here:  Getting started with Bluetooth Electronic Shelf Labels (ESL) and Periodic Advertising with Responses (PAwR) .

    Regards,

    Hieu

  • Hi Hieu,

    Thank you for your reply. I will have a look on the tutorial.

    Best regards,

    Yann

  • Hi Hieu,

    I prepared a modified version of the periodic_adv/sync_conn example with my PAwR timings.

    Can you please have a look on it ?

    You can try from your side if you want, I used a nrf52840dk for the ADV side and only one nrf52840dk for the SYNC side and it's not possible to exchange data. 

    You will find diff to easily see my changes.

    ADV Side

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    diff --git a/src/main.c b/src/main.c
    index 49c1c52..b04a8b4 100644
    --- a/src/main.c
    +++ b/src/main.c
    @@ -9,22 +9,40 @@
    #include <zephyr/bluetooth/gap.h>
    #include <zephyr/bluetooth/hci.h>
    -#define NUM_RSP_SLOTS 5
    -#define NUM_SUBEVENTS 5
    -#define PACKET_SIZE 5
    +#define NUM_RSP_SLOTS 20
    +#define NUM_SUBEVENTS 8
    +// #define NUM_RSP_SLOTS 5
    +// #define NUM_SUBEVENTS 5
    +#define PACKET_SIZE 5
    #define SUBEVENT_INTERVAL 0x30
    +#define BT_LE_EXT_ADV_NCONN_CODED BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | \
    + BT_LE_ADV_OPT_CODED, \
    + BT_GAP_ADV_FAST_INT_MIN_2, \
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    SYNC side

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    diff --git a/src/main.c b/src/main.c
    index db858ef..172acf8 100644
    --- a/src/main.c
    +++ b/src/main.c
    @@ -57,6 +57,7 @@ static void term_cb(struct bt_le_per_adv_sync *sync,
    static struct bt_le_per_adv_response_params rsp_params;
    NET_BUF_SIMPLE_DEFINE_STATIC(rsp_buf, sizeof(bt_addr_le_t) + 2 * sizeof(uint8_t));
    +uint8_t myDummyBuf[] = {0x11, 0x22, 0x33, 0x44, 0x55};
    static void recv_cb(struct bt_le_per_adv_sync *sync,
    const struct bt_le_per_adv_sync_recv_info *info, struct net_buf_simple *buf)
    @@ -79,25 +80,17 @@ static void recv_cb(struct bt_le_per_adv_sync *sync,
    rsp_params.response_subevent = info->subevent;
    rsp_params.response_slot = 0;
    - err = bt_le_oob_get_local(BT_ID_DEFAULT, &oob);
    - if (err) {
    - printk("Failed to get OOB data (err %d)\n", err);
    -
    - return;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks,

    Yann