Re: How to configure BLE Mesh FN and LPN?
Hi Frank,toggle quoted messageShow quoted text
You need to have CONFIG_BT_MESH_FRIEND=y and/or CONFIG_BT_MESH_LOW_POWER=y enabled to get access to Friendship functionality. You might also want to look at the various BT_MESH_LPN_* and BT_MESH_FRIEND_* options found in subsys/bluetooth/host/mesh/Kconfig, however their default values should be enough to get you started.
As Friend there’s nothing special you need to do in your application, except enable the Kconfig option for it and make sure the corresponding Configuration Model State is enabled (either statically as the default value or by a configuration client).
As LPN you need to call bt_mesh_lpn_set(true) to go into Low Power mode. The reason why this is at runtime is to allow for devices that have variable power sources, e.g. an internal battery but may also be plugged to a stable external power source from time to time. The selection of Friend node happens automatically, but you can control the process by setting CONFIG_BT_MESH_LPN_RECV_WIN_FACTOR, CONFIG_BT_MESH_LPN_RSSI_FACTOR and CONFIG_BT_MESH_LPN_MIN_QUEUE_SIZE to desired values. To get a good understanding of these and how they influence the Friend Offer Delay calculation please refer to the Mesh specification (sections 18.104.22.168.1 and 22.214.171.124.1 in particular).
As for meshctl from BlueZ, I’m not sure if it has any Friendship features. It can definitely not act as a Friend or LPN since it is GATT-only (Friendship is an advertising-only concept in the current spec), but it might have Configuration Client support to toggle the Friend state at runtime (note: LPN has no matching Configuration Model state so you need to use the Zephyr API I mentioned earlier).
On 5 Dec 2018, at 19.02, frv <F.Vieren@...> wrote: