Skip to content

Bluetooth: Regression in MESH tests #6083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MariuszSkamra opened this issue Feb 9, 2018 · 6 comments
Closed

Bluetooth: Regression in MESH tests #6083

MariuszSkamra opened this issue Feb 9, 2018 · 6 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug

Comments

@MariuszSkamra
Copy link
Collaborator

Seems that patch ad7c9d3 introduces regression in MESH tests.

Affected TCs:
MESH/NODE/IVU/BI-01-C
MESH/NODE/IVU/BI-02-C
MESH/NODE/IVU/BI-04-C
MESH/NODE/IVU/BI-05-C
MESH/NODE/IVU/BI-06-C
MESH/NODE/IVU/BV-01-C
MESH/NODE/IVU/BV-03-C
MESH/NODE/IVU/BV-04-C
MESH/NODE/IVU/BV-05-C
MESH/NODE/KR/BI-05-C
MESH/NODE/KR/BV-02-C
MESH/NODE/KR/BV-03-C

Test Cases are failing, because PTS is not receiving Secure Network Beacons.

@nashif nashif added bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug labels Feb 9, 2018
@jhedberg
Copy link
Member

jhedberg commented Feb 9, 2018

@MariuszSkamra do you have any more details of what's going on? Does this look like a host or controller issue? (e.g. do you see the host sending the right advertising HCI commands, etc?)

@jhedberg
Copy link
Member

jhedberg commented Feb 9, 2018

One thing to note what makes secure network beacons "special", unlike mesh network packets which are configured by default to 3 transmissions (3 advertising events), beacons only have a single transmission. This means that the host-side advertising thread will stop the advertising much sooner. The formula used for the duration is as follows:

duration = (BT_MESH_ADV(buf)->count + 1) * (adv_int + 10);

In the case of secure network beacons buf->count is 0 and adv_int is 20, so the above should yield a duration of 30ms.

@jhedberg
Copy link
Member

jhedberg commented Feb 9, 2018

@cvinayak based on the description from @MariuszSkamra it sounds like with the new controller settings the controller doesn't succeed in sending out a single advertising event if the advertising is stopped in 30ms.

@cvinayak
Copy link
Collaborator

If there is scanning active, then my assumptions are that with an optimized scan window changes due to ad7c9d3, starting an advertisement event is delayed upto twice the scan window in comparison to older implementation wherein the first advertising event happened to be delay only by one scan window( the current active one).

@jhedberg
Copy link
Member

jhedberg commented Feb 10, 2018

This is mesh, so continuous scanning with 10ms window is always active. The only exception is if we're acting as a Low Power Node, but that's not the case here. Twice the scan window would mean max 20ms delay, so the 30ms wait that the host does before stopping advertising should be enough, shouldn't it? @cvinayak as long as we're stuck with standard HCI, would you recommend some improvement/fix to the way that we calculate the advertising duration on the host side (time between receiving command complete for write_adv_enable and disabling advertising). As I mentioned earlier, given COUNT desired retransmissions and ADV_INT advertising interval the host currently sets the duration as (COUNT + 1) * (ADV_INT + 10)

@jhedberg
Copy link
Member

Btw, I suppose this all shows that the Mesh vendor extension can't come soon enough.

cvinayak added a commit to cvinayak/zephyr that referenced this issue Feb 12, 2018
Fix, add the missing code for the removal of any accumulated
soft latencies or negative drift ticks when scheduling next
interval expiry with added laziness.

Typically a first interval would accumulate soft latencies
and this has to be removed if the interval is rescheduled
with any added laziness (scheduled to the next soft real
time interval).

Example, scan windows block any new scheduling until the end
of the window, adding latencies to any soft real time ticker
expiry which should try to execute as early as possible after
the scan window.

Fixes: zephyrproject-rtos#6083

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
cvinayak added a commit to cvinayak/zephyr that referenced this issue Feb 12, 2018
New advertising started while scanning is already enabled
would delay the first advertisement event until the end of
the current overlapping scan window in the Zephyr native BLE
controller implementation. Hence, consider this scan window
duration when calculating the advertising stop.

Relates to: zephyrproject-rtos#6083

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
jhedberg pushed a commit that referenced this issue Feb 12, 2018
New advertising started while scanning is already enabled
would delay the first advertisement event until the end of
the current overlapping scan window in the Zephyr native BLE
controller implementation. Hence, consider this scan window
duration when calculating the advertising stop.

Relates to: #6083

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
cvinayak added a commit to cvinayak/zephyr that referenced this issue Mar 20, 2018
Fix, add the missing code for the removal of any accumulated
soft latencies or negative drift ticks when scheduling next
interval expiry with added laziness.

Typically a first interval would accumulate soft latencies
and this has to be removed if the interval is rescheduled
with any added laziness (scheduled to the next soft real
time interval).

Example, scan windows block any new scheduling until the end
of the window, adding latencies to any soft real time ticker
expiry which should try to execute as early as possible after
the scan window.

Fixes: zephyrproject-rtos#6083

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
nashif pushed a commit that referenced this issue Apr 30, 2018
Fix, add the missing code for the removal of any accumulated
soft latencies or negative drift ticks when scheduling next
interval expiry with added laziness.

Typically a first interval would accumulate soft latencies
and this has to be removed if the interval is rescheduled
with any added laziness (scheduled to the next soft real
time interval).

Example, scan windows block any new scheduling until the end
of the window, adding latencies to any soft real time ticker
expiry which should try to execute as early as possible after
the scan window.

Fixes: #6083

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants