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

Bluetooth Mesh Provisioner Example against Mesh Sensor Example. How do I create only one subscription and one send/receive of sensor value?

I am attempting to provision the sensor mesh example using the static provisioner example from the MESH SDK.

It works great. However, the client receives two broadcasts upon a publish at the server.

I want to reduce that to only one broadcast and one piece of data being moved.

My knowledge of mesh provisioning is getting bettter, however it is still limited.

Essentially, upon the server publishing one piece of data (the sensor value), the client receives that value twice as evidenced by two prints of the value.

I want the process to only broadcast or send/receive one piece of data.
I have tried modifying various parts of the client, server, and provisioner source code but have not be successful.

When I provision myself with the IOS nRF Mesh app, only one piece of data is sent/received in the provisioned mesh.

I think this has to do with the static provisioner creating even and odd publication groups and the server,client are added to both.

Regards.

  • Hi,

    Did you try this with unmodified examples? Could you provide me with all the steps you have done so I can try reproduce this?

    Also, provide which Mesh SDK and nRF5 SDK version you are using? What device are you using? Custom board or a DK?

  • Hi Mttrinh,

    I am using unmodified examples for the nordic MESH SDK v5.0.0 against nordic base SDK 17.0.2.

    Compiling in Seger.

    I am using 3 DK's. One for server. One for client. One for provisioner.


    When I push the button on the server to broadcast a new value, I get 2 alerts on the client. I would only like one.

    I am pretty sure it has something to do with the server publishing to two groups and the client subscribing to two groups. I am trying to get rid of the second subscription/publication but haven't figure out how yet. I think this would occur in the provisioner.

    So I took out some of the provisioner state machine steps inside config_scenarios.h going from:

    #define CONFIG_SENSOR_SERVER                            \
        NODE_SETUP_CONFIG_APPKEY_BIND_SENSOR_SERVER,        \
        NODE_SETUP_CONFIG_APPKEY_BIND_SENSOR_SETUP_SERVER,  \
        NODE_SETUP_CONFIG_PUBLICATION_SENSOR_SERVER,        \
        NODE_SETUP_CONFIG_PUBLICATION_SENSOR_SETUP_SERVER,  \
        NODE_SETUP_CONFIG_SUBSCRIPTION_SENSOR_SERVER,       \
        NODE_SETUP_CONFIG_SUBSCRIPTION_SENSOR_SETUP_SERVER

    to:

    #define CONFIG_SENSOR_SERVER                            \
        NODE_SETUP_CONFIG_APPKEY_BIND_SENSOR_SERVER,        \
        NODE_SETUP_CONFIG_APPKEY_BIND_SENSOR_SETUP_SERVER,  \
        NODE_SETUP_CONFIG_PUBLICATION_SENSOR_SERVER,        \
        NODE_SETUP_CONFIG_PUBLICATION_SENSOR_SETUP_SERVER

    This didn't seem to effect anything, though I think I'm on the right line of thinking.

    Continuing on, I tried removing more state transitions.

    #define CONFIG_SCENARIO_SENSOR_CLIENT_EXAMPLE  \
        CONFIG_SCENARIO_COMMON,                    \
        CONFIG_SENSOR_CLIENT,                      \
        CONFIG_SENSOR_CLIENT,                      \
        NODE_SETUP_DONE

    to

    #define CONFIG_SCENARIO_SENSOR_CLIENT_EXAMPLE  \
        CONFIG_SCENARIO_COMMON,                    \
        CONFIG_SENSOR_CLIENT,                      \
        NODE_SETUP_DONE

    and

    #define CONFIG_SENSOR_CLIENT                     \
        NODE_SETUP_GET_NEXT_ELEMENT,                 \
        NODE_SETUP_CONFIG_APPKEY_BIND_SENSOR_CLIENT, \
        NODE_SETUP_CONFIG_PUBLICATION_SENSOR_CLIENT, \
        NODE_SETUP_CONFIG_SUBSCRIPTION_SENSOR_CLIENT
    

    to

    #define CONFIG_SENSOR_CLIENT                     \
        NODE_SETUP_GET_NEXT_ELEMENT,                 \
        NODE_SETUP_CONFIG_APPKEY_BIND_SENSOR_CLIENT, \
        NODE_SETUP_CONFIG_SUBSCRIPTION_SENSOR_CLIENT

    Haven't seen the effect I want yet.

    Regards.

    Appreciated.

  • Hi,

    What you are seeing is the publication retransmission. You can find it here: https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/examples/provisioner/src/node_setup.c#L318 so in addition to the original publication, the message will be re-published one more time. Set this to 0 and it will solve your problem.

Related