Thanks, we can try those numbers. All but the min_ce_len/max_ce_len are already configurable by classroom code. I'll need to build a new firmware to allow changes for min_ce_len/max_ce_len. I'm using the defaults for those and they are 16 / 768.
On Thu, Apr 9, 2020 at 2:05 AM Ondrej Pilat <ondrej.pi...@ozobot.com> wrote: > Hi, > > I cannot find any documentation about Nimble connection events scheduling. > I have following scenario: > > NRF52 Nimble is in dual role setting. Peripheral device connected to a PC > with at least BLE 4.2 and MTU more than 153B. Central is connected to 18 > peripheral devices BLE 4.1 with MTU 27B. > > Do you think that Nimble can keep interval window 12.5ms with the PC and > 37.5ms with all peripherals? > > My assumption are following: > > - only one packet per each connection event > - send/receive 132B packet between NRF52 and PC each connection event > - send/receive 20B packet between NRF52 and peripheral each connection > event > > I made following rough computation: > > PC <-> NRF52: 132B data + 21B header => (153B * 8) / 1Mbps => 1224 uS + > 150 uS IFR + 80 uS ACK + 150 uS IFR => 1604 uS * 2 (send/receive) => 3208 > uS > > NRF52 <-> peripheral: 20B data + 21B header => (41B * 8) / 1Mbps => 328uS > + 150 uS IFR + 80 uS ACK + 150uS IFR => 708uS * 2 (send/receive) => 1416 uS > > It means one big and six small packets should fit in each PC <-> NRF52 > connection event 3208 + 6 * 1416 = 11 704 < 12.5ms interval window. For 18 > peripherals it means 3 such cycles to serve them all therefore 37.5ms > interval window between NRF52 and a peripheral. > > Are following parameters good to achieve this: > > NRF52 <-> PC > > static const struct ble_gap_conn_params ble_gap_conn_params_ideal = { > .scan_itvl = BLE_GAP_SCAN_FAST_INTERVAL_MIN, > .scan_window = BLE_GAP_SCAN_FAST_WINDOW, > .itvl_min = 10, > .itvl_max = 10, > .latency = 0, > .supervision_timeout = 500, > .min_ce_len = 5, // 3.208 / 0.625 = 5.1328 > .max_ce_len = 6, > }; > > NRF52 <-> Peripheral > > static const struct ble_gap_conn_params ble_gap_conn_params_ideal = { > .scan_itvl = BLE_GAP_SCAN_FAST_INTERVAL_MIN, > .scan_window = BLE_GAP_SCAN_FAST_WINDOW, > .itvl_min = 30, > .itvl_max = 30, > .latency = 0, > .supervision_timeout = 500, > .min_ce_len = 2, // 1.416 / 0.625 = 2.2656 > .max_ce_len = 3, > }; > > Regards > > Ondrej > -- >