Re: BT Mesh Health Server Fault Periodic Publication#bluetoothmesh #zephyrbluetoothmesh
(added zephyr-users back to CC - please don’t drop it since others may benefit from this information as well)
On 9 Apr 2019, at 14.28, William Fish <@WilliamFish> wrote:
/* Health SVR: publish periodicaly to a remote address */There are a many problems with the above:
1. The model publication is expected to be configured by a configuration client - not statically like this. If everything else is initialised correctly (it’s not - see my other points) it *might* work if you’re also using BT_SETTINGS and calling settings_load() from your application, but I’ve never tested it.
2. You’re missing an update callback. This is mandatory for periodic publication.
3. You’re missing a pub->msg where the publication message is expected to be encoded by your app.
The two last issues will likely cause unexpected behaviour and faults. If you had asserts enabled than issue 2 should trigger an assert (see access.c line 216).
In general, it’s recommended to use the BT_MESH_MODEL_PUB_DEFINE() macro for defining the publication context.