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

Is there a way to control the unprovisioned device (a light) with nrf5 sdk for mesh?

Hi support team,

I am a beginner with Nordic nrf5 sdk for mesh.  I begin with the sample light_switch. Currently I want to toggle the status (on/off) of the unprovisioned light by phone APP.

Is there a method to implement it?

I have read the source code and understood the sdk, but not clearly.   I just think that the APP can send the scan request after receiving the advertisement for provisioning service, 

and then at light side it will receive the scan request and BLE_GAP_EVT_SCAN_REQ_REPORT event can be handled.   I plan to toggle the status of the unprovisioned light when received 

the BLE_GAP_EVT_SCAN_REQ_REPORT  event. Is this method practicable? or Is there another way to implement this functionality? 

Any suggestion will be appreciated. 

  • Hi Young, 

    Could you give some more information on what you plan to do ?

    Are you planning to be able to control a node without connecting to it ? 

    If you do provisioning you can find that after you connect to the unprovisioned node you can click Identify and the node will start blinking. 

    I don't think using BLE_GAP_EVT_SCAN_REQ_REPORT  event to react would be a good idea. Your device will response to all of the central device around because there is no payload inside the scan request. 

  • Hi Hung,

    Thanks for your reply. 

    I am using nrf5 sdk for mesh v5.0.0 and nrf5 sdk v17.0.2.

    In fact, I want to select a specific unprovisioned node (a light) from all the unprovisioned nodes, because I want to divide all unprovisioned nodes into a few networks.  However these nodes are in the same state, e.g. off, so I want to figure out a method to find the specific unprovisioned node to provision.  

    According to what you said "If you do provisioning you can find that after you connect to the unprovisioned node you can click Identify and the node will start blinking.", actually it is not possible to connect all unprovisioned nodes one by  one. 

    I just thought of the BLE_GAP_EVT_SCAN_REQ_REPORT  event.  The provisioner (smartphone) just sends scan request but not connect request later and see if the corresponding node's state is changed (toggled). When the unprovisoned node received the scan request which is sent to itself, it toggles the state (on/off), and then I can know if this node is the node which I want to provision.  But if the node is a provisioned node and received a scan request, it will do nothing. 

    Is it practicable? or Is there a better way to implement the functionality? 

    Additionally I am reading the light_switch sample, I didn't find where BLE_GAP_EVT_SCAN_REQ_REPORT  event is handled in the sample. 

    Thanks for any suggestion.

  • Please be aware that BLE_GAP_EVT_SCAN_REQ_REPORT  would trigger when there is any central that doing active scanning. So you will response to any phones, laptops, anything that can send a scan request. Not ideal solution. 

    But I still don't really understand what you want to do . 


    Let's say you have 10 unprovisioned nodes A1 to A10 and 10 provisioned node B1 to B10. You can see the list of all the unprovisioned node A1 to A10. 

    What you do mean by "I want to figure out a method to find the specific unprovisioned node to provision" ?  

    If you want to provision A4 you just connect to A4 and click identify the A4 node will response. 

    On the opposite, if you just hold a node and you want to know which node address is this, you can use RSSI on the phone to check which node is the closest to you. 

  • Hi Hung,

    Thanks so much for your quick reply.

    As you said, there are 10 unprovisoned nodes A1-A10 (10 lights). Now I just want to provision for A4, but I don't know which one is A4, so before provisioning, I need to find A4.  Maybe it is more clearly.

  • What you can do is to click on the App to select A4 , then when it's connected to the phone (nRF Mesh app) you click on Identity. Then A4 will start to blink (if you implement that on a nRF52 DK kit the LED 1 to LED4 will start blinking). Then you would know which in the 10 nodes is A4 and can take the device. 

Related