This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE MESH with variable number of Sensors

We have an application where we have a large number of sensors, some relay nodes and one or more gateways. The sensors and relay nodes are provisioned by the gateways and then start publishing data. Each gateway has a number of sensors publishing data to its Unicast address. That number of sensors is unknown in advance. 

As I understand it, for each Sensor Server Model, I need a Sensor Client Model instance on the Gateway. I've been looking at how to implement this in the most practical manner and the issue I am running into is that we don't know what the number of sensors is in advance. I could solve that in several ways:

1) Let all Sensors subscribe to the same Sensor Client and implement my own code on top of that to deal with de-multiplexing the sensor data. That would not be according to the BLE MESH spec, but consumes fewer resources.

2) Pre-allocate more Sensor Client Models than I'll ever need (wasteful)

3) Dynamically allocate Client Models: according to the BLE Spec that means I need to re-provision the Gateway every time a new sensor joins (very wasteful)

The same is true for the Health Server in each of our Nodes. Do I have to create an instance for every single one? Is there a better way? 

Thanks!

Related