I'm trying to get two nodes working in a Friend/LPN configuration, but when I restart or deep-sleep the LPN (which has the BLE settings set to persist, ie the node automatically rejoins the mesh and remembers the friendship), I see the Friend node terminate the friendship, sometimes even after the LPN has restarted and been on for a few seconds. Currently they are only set to be Friend/LPN in menuconfig, I haven't started adding any lines of code specific to that yet. How can I prevent this from happening? Time doesn't seem to be the entire issue as the friendship will be terminated even if the LPN wakes up again almost immediately, ie pushing the reset button.
The friendship is usually rapidly re-established, but it shouldn't be lost in the first place.
BLE Mesh Friendship gets terminated when node sleeps/reboots
BLE Mesh Friendship gets terminated when node sleeps/reboots
Last edited by ZacDaMan on Wed Nov 16, 2022 3:54 am, edited 2 times in total.
Re: BLE Mesh Friendship gets terminated when node sleeps
Potentially related - every now and then (not consistently), when the LPN wakes up it will come up with
And on the Friend side of things, I'll sometimes see the corresponding messages
or (at different times)
Code: Select all
W (16372) BLE_MESH: Retrying the first Friend Poll, 1 attempts
W (16802) BLE_MESH: Retrying the first Friend Poll, 2 attempts
W (17222) BLE_MESH: Retrying the first Friend Poll, 3 attempts
W (17652) BLE_MESH: Retrying the first Friend Poll, 4 attempts
W (18082) BLE_MESH: Retrying the first Friend Poll, 5 attempts
E (18512) BLE_MESH: Timeout waiting for the first Friend Update
W (18522) EXAMPLE: FRIENDSHIP TERMINATED
W (25102) EXAMPLE: FRIENDSHIP ESTABLISHED
Code: Select all
W (1554539) BLE_MESH: Existing LPN re-requesting Friendship
W (1554539) EXAMPLE: FRIENDSHIP TERMINATED
W (1554929) BLE_MESH: No matching LPN addr 0x0012
W (1555329) BLE_MESH: No matching LPN addr 0x0012
W (1555769) BLE_MESH: No matching LPN addr 0x0012
W (1555879) BLE_MESH: Friendship not established with 0x0012
W (1563849) EXAMPLE: FRIENDSHIP ESTABLISHED
Code: Select all
W (135069) BLE_MESH: Friendship lost with 0x0012
Re: BLE Mesh Friendship gets terminated when node sleeps/reboots
Can you give me the code of this project. I have an assignment for this part, but I don't know how to implement.
Re: BLE Mesh Friendship gets terminated when node sleeps/reboots
This is still puzzling me; I added a call to
on startup, which returns ESP_OK first try, meaning the friendship is present and remembered when the device starts, but a few seconds later it will still be terminated by the Friend node. Can I adjust the PollTimeout? Or do I need to be manually polling more frequently? Once the friendship is lost and then re-established, it won't be lost again until I restart the device, which is confusing.
Code: Select all
esp_ble_mesh_lpn_poll()
Re: BLE Mesh Friendship gets terminated when node sleeps/reboots
On further inspection, calling esp_ble_mesh_lpn_poll() returns ESP_OK both before and after the friendship is terminated, and again when the friendship is re-established, leaving me unsure what the purpose of this function is.
Who is online
Users browsing this forum: No registered users and 88 guests