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

How to provision 2 clients nodes?

I am trying to provision 2 clients for the mesh so that i they all can send the message to a single server.

I will list what all i have tried

1.I took a server node and changed the URI of the node from "EX_URI_DM_CLIENT" to "EX_URI_DM_SERVER". This didnt work

2.inside main.c of provisioner code i changed "m_nw_state.provisioned_devices ==1" to "m_nw_state.provisioned_devices <2" amd also i increased the client node count to 2 

These methods didnt work out.

Please tell me where i am going wrong.I am able to send messges from 1 client to diffrent servers but for my application i want a single node collecting message from various nodes.

I am using segger platform and nrf52832 and nrf52840 boards

and the latest SDK for mesh that is v3.10.

Thankyou

Parents
  • Hi Brijesh, 

    The easiest way of doing this is to use a phone to do provisioning. If the node supports PB-GATT (which the light switch supports) you can use the nRFMesh app on the phone to do provisioning. 

    1. You need to increase the number of clients to be provisioned in the provisioner in addition.

    2. If in check_network_state() you change else if (m_nw_state.provisioned_devices == 0) to else if (m_nw_state.provisioned_devices <2) and  CLIENT_NODE_COUNT to 2 in the provisioner code , it should work. 

    Above is for provisioning phase, in configuration phase you would need to update setup_select_steps() so that mp_config_step = client_config_steps; will be assigned for the first 2 devices not just the first one. You can change    if (addr == UNPROV_START_ADDRESS) to    if (addr < UNPROV_START_ADDRESS+2) so first two device being provision will be configured as the client. 

  • I followed the steps and provisioning was success ful bt configuration was not.

    this is the terminal output

    <t: 1016259>, access_reliable.c, 438, ----- Success p_reliable->model_handle=2---
    <t: 1017062>, main.c, 353, Config client event
    <t: 1017064>, node_setup.c, 262, opcode status field: 0
    <t: 1017067>, node_setup.c, 387, App key bind: 0x1002 server
    <t: 1017077>, access_reliable.c, 438, ----- Success p_reliable->model_handle=2---
    <t: 1044031>, main.c, 353, Config client event
    <t: 1044033>, node_setup.c, 262, opcode status field: 2
    <t: 1044036>, main.c, 294, Configuration of device 1 failed. Press Button 1 to retry.

    Does it have anything to do with the client instance on my 2nd node?

  • Hi Brijesh,

    By spec , there should be one publication address at a time. You can have multiple subscription address, but one publication address. 

    Note that you can choose destination address freely when you access the access layer. The publication /subscription is only applied for model. You can get rid of that by using the access layer directly , then you can send the message to any where you like. But of course with that you may lose interoperability to other vendor.  

  • okay thats done , Now suppose i want to make the controller sleep for some hours and then wakeup for some time do something and sleep again , What is the best way to do it?

  • You can just stop mesh, put the CPU to sleep and set a timer. You can let it sleep up to 96 hours without problem. If you sleep for more than 96 hours you would need to perform IV Index recovery. Please refer to the spec. 

    Please note that, you can't put too many nodes into sleep, mesh requires relay nodes to operate. So only the leaf node can sleep. 

    Another option is to use Low Power Node, but that requires you to establish a friendship. 

  • where can i get the apis for sleep functionality, I see sd_app_evt_wait() in the main function which i suppose is for power optimization or some kind of sleep. I wanna know all kinds of sleep options.Because if sd_app_evt_wait is doing the task then there is no need to use a separate timer i might as well just timer my publication.

    Please share the link also

    thanks hung u r awsome

  • If you stop mesh and start it properly, you should be able to put CPU to sleep with sd_app_evt_wait(). 

    You can have a look here.

Reply Children
Related