I used a mesh example (the example name is "mesh") for testing, and enabled low-power nodes using CONFIG_BT_MESH_LOW_POWER=y, and disabled the automatic start of low-power node mode.
I added bt_mesh_lpn_set to the button callback. When I press the button, it will call bt_mesh_lpn_set (1) to enter low-power mode, and when I press it again, it will call bt_mesh_lpn_set(0) to return to normal node mode.
Additionally, I have prepared two devices for testing, one with a friend node enabled and the other as a regular node.So for now, the ordinary node is called node a, the friend node is called node b, and the low-power node to be tested is called node c
After powering on and configuring the three devices, node A can now send messages to node C normally. Then, I press the button on node C to put it into low-power mode. Node C automatically establishes a friendship with node B. When node A sends messages to node C again, node B can also cache and forward these messages normally.
But when I wanted node c to exit low-power mode and return to normal node, there was a problem. Call bt_mesh_lpn_set (0), the return value is 0, indicating successful execution. The log of node b also shows that the friendship has been disconnected. However, at this time, send a message to node c using node a, but node c will not receive it
At this point, I press the button again to call bt_mesh_lpn_set (1), and node b and node c will re-establish their friendship. Node a can successfully send messages to node c through node b
How should this problem be solved?