Questions about the distance measurement mesh model

Hello

My application is based on the Distance measurement sample which uses a BLE  scan response callback to trigger the measurement synchronization sequence in reflector mode and scan callback to trigger synchronization sequence in  initiator mode. With the Distance mesh model the measurement sequence is started with the bt_mesh_dm_cli_measurement_start API

It seems that simply calling this API every time a scan packet arrives is going to overwhelm the mesh network. On the other hand it would be great to receive more than one measurement so averaging can be applied. What's your recommendation on how frequently should  bt_mesh_dm_cli_measurement_start API be called?
Also

There is an API bt_mesh_dm_cli_results_get() which returns the measurement results.

However the results are available in the bt_mesh_dm_cli_measurement_start() callback. 
Can you clarify when this function should be called?

Do you plan to add a sample how the DM model should be used? That would very helpful

Thank you

Andy

Parents Reply Children
  • Hi,

    Here is the result of the conversation I had with the Mesh developers.

    Do you plan to add a sample how the DM model should be used? That would very helpful

    Currently we don't have any official samples planned. I will look into it and see if I can create an unofficial sample, but I can not guarantee anything w.r.t. time horizon and/or if it ever will be done.

    It seems that simply calling this API every time a scan packet arrives is going to overwhelm the mesh network. On the other hand it would be great to receive more than one measurement so averaging can be applied. What's your recommendation on how frequently should  bt_mesh_dm_cli_measurement_start API be called?

    We imagine distance measurement to be used not so often. Since, mesh nodes (such as lights) are often static, this feature could be useful during initial deployment of the network to find out topology of the network. At that time feature can be used to map-out the whole network and relative positions of the devices. You need to be aware that when distance measurement is being done the node cannot participate in mesh network operation as distance measurement library takes control of the radio to do the measurement. After network is deployed, distance measurement can be done say once in a day, or only where there is change in the network (like replacing devices). If the devices move around, DM can be triggered when, for example, accelerometer detects the movement. It really depends on the use case and imagination.

    It is up to you as a developer to decide how to use the function calls to suit your applications/designs needs, but as mentioned there are limitations such as the operation node cannot participate in the mesh communication during DM ranging. 

    There is an API bt_mesh_dm_cli_results_get() which returns the measurement results.

    However the results are available in the bt_mesh_dm_cli_measurement_start() callback. 
    Can you clarify when this function should be called?

    bt_mesh_dm_cli_results_get() allows client to fetch several past measurements from the server at later point.

    bt_mesh_dm_cli_measurement_start() will start the measurement and provide results for 'that' measurement.

    Let me know if this answers your questions!

    Kind regards,
    Andreas

  • Thank you 

    Having trouble incorporating DM mesh into my application.

    I already have several vendor models, so I added 

    BT_MESH_MODEL_DM_CLI(&dm_client) and 
    BT_MESH_MODEL_DM_SRV(&dm_srv) to my model composition
    When I call 
    bt_mesh_dm_cli_measurement_start() I get error -125 (EADDRNOTAVAIL)
    Indeed the dm_client->model->pub.addr is 0
    What should it be set to ?
    Would be great to get a working sample with instructions how to provision 
    Thanks
  • Update. Used mesh dm client in mesh shell. Get same error -125

    The dm client is in the composition
    ~$ mesh models dm instance get-all
    Model instance found at addr 0x00C8. Element index: 0

    Please advise

  • Hi,

    I am unfortunately out of office until next week, so there will be some wait time. I will get back to you earliest then.

    Kind regards,
    Andreas

  • I was able to get around error -125 by setting the client->model->pub->addr to the unicast address of the node that initiates the measurement - now get error -22
Related