Skip to content
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

Bluetooth: controller: Switching to non conn adv fails for Mesh LPN #23805

Closed
trond-snekvik opened this issue Mar 26, 2020 · 1 comment · Fixed by #23807 or #23852
Closed

Bluetooth: controller: Switching to non conn adv fails for Mesh LPN #23805

trond-snekvik opened this issue Mar 26, 2020 · 1 comment · Fixed by #23807 or #23852
Assignees
Labels
area: Bluetooth Mesh area: Bluetooth bug The issue is a bug, or the PR is fixing a bug

Comments

@trond-snekvik
Copy link
Contributor

The Bluetooth Mesh Low Power Node feature fails sending its poll packet when GATT proxy is enabled.

The Bluetooth mesh advertises a connectable advertisement at 1 second interval for its proxy feature. The LPN role aborts this advertisement every 30 seconds to send a non-connectable 20 ms interval advertisement (the "LPN poll"). The LPN poll gets 90 ms to send a couple of advertisements before switching back to connectable 1 second advertisement, but in those 90 ms no advertisements are sent.

To Reproduce
The error can be reproduced on current master with two devices running the tests/bluetooth/mesh_shell, designating the problematic device "DUT", the other "tester":

The devices need initial setup through the shell the first time after erasing:

Tester:

$ mesh init
$ mesh provision 0 1 0
$ mesh friend on

After this, the tester only needs the mesh init command after each reboot.

DUT first time setup:

$ mesh init
$ mesh provision 0 2 0

To trigger the invalid behavior on the DUT, call:

$ mesh lpn on

This triggers the following output:

uart:~$ mesh lpn on
Friendship (as LPN) established to Friend 0x0001
[00:00:46.652,984] <inf> bt_mesh_lpn: Friendship established with 0x0001

Now, send the following command:

$ mesh poll

This triggers the following output:

uart:~$ mesh poll
[00:01:00.055,541] <wrn> bt_mesh_lpn: No response from Friend during ReceiveWindow
[00:01:02.502,227] <wrn> bt_mesh_lpn: No response from Friend during ReceiveWindow
[00:01:04.948,913] <wrn> bt_mesh_lpn: No response from Friend during ReceiveWindow
[00:01:07.395,599] <wrn> bt_mesh_lpn: No response from Friend during ReceiveWindow
[00:01:09.395,996] <err> bt_mesh_lpn: No response from Friend after 4 retries
Friendship (as LPN) lost with Friend 0x0001

If the DUT reboots, you’ll need to call mesh init, mesh lpn on and mesh poll again.

The error happens when calling mesh poll, as this triggers the non-connectable advertisement (followed by a period of scanning). Enabling CONFIG_BT_CTLR_DEBUG_PINS=y shows the controller stopping connectable advertisements, then waiting 90 ms before starting them again. The connectable advertisements start immediately after the 90 ms, as expected.

Expected behavior
The controller should send 3-4 non-connectable advertisements during the 90 ms. The correct behavior is observable if we disable the proxy feature on the shell (CONFIG_BT_MESH_GATT_PROXY=n), likely because the advertiser will be idle when the non-connectable advertisements are requested.

Impact
Mesh LPN feature is unusable with the GATT proxy feature, a quite common combination.

Environment

  • nRF52832_xxAA on PCA10040
  • Software based Bluetooth controller.
@trond-snekvik trond-snekvik added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth area: Bluetooth Mesh labels Mar 26, 2020
@trond-snekvik
Copy link
Contributor Author

cc @jhedberg

cvinayak added a commit to cvinayak/zephyr that referenced this issue Mar 26, 2020
Update the ticks_current value on last stopped ticker
instance, so that when a new ticker instance is started
the anchor ticks calculation uses the correct current tick
with respect to supplied anchor ticks.

Fixes zephyrproject-rtos#23805.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
carlescufi pushed a commit that referenced this issue Mar 26, 2020
Update the ticks_current value on last stopped ticker
instance, so that when a new ticker instance is started
the anchor ticks calculation uses the correct current tick
with respect to supplied anchor ticks.

Fixes #23805.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
cvinayak added a commit to cvinayak/zephyr that referenced this issue Mar 27, 2020
Update the ticks_current value on last stopped ticker
instance, so that when a new ticker instance is started
the anchor ticks calculation uses the correct current tick
with respect to supplied anchor ticks.

Fixes zephyrproject-rtos#23805.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
jhedberg pushed a commit that referenced this issue Apr 22, 2020
Update the ticks_current value on last stopped ticker
instance, so that when a new ticker instance is started
the anchor ticks calculation uses the correct current tick
with respect to supplied anchor ticks.

Fixes #23805.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
hakehuang pushed a commit to hakehuang/zephyr that referenced this issue Apr 30, 2020
Update the ticks_current value on last stopped ticker
instance, so that when a new ticker instance is started
the anchor ticks calculation uses the correct current tick
with respect to supplied anchor ticks.

Fixes zephyrproject-rtos#23805.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
pkral78 pushed a commit to cloudfieldcz/zephyr that referenced this issue Aug 4, 2020
Update the ticks_current value on last stopped ticker
instance, so that when a new ticker instance is started
the anchor ticks calculation uses the correct current tick
with respect to supplied anchor ticks.

Fixes zephyrproject-rtos#23805.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
cvinayak added a commit to cvinayak/zephyr that referenced this issue Sep 23, 2020
Update the ticks_current value on last stopped ticker
instance, so that when a new ticker instance is started
the anchor ticks calculation uses the correct current tick
with respect to supplied anchor ticks.

Fixes zephyrproject-rtos#23805.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
nashif pushed a commit that referenced this issue Nov 17, 2020
Update the ticks_current value on last stopped ticker
instance, so that when a new ticker instance is started
the anchor ticks calculation uses the correct current tick
with respect to supplied anchor ticks.

Fixes #23805.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Mesh area: Bluetooth bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
2 participants