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

How can I test unprovisioning feature in interactive_pyaci?

Hi everyone, I am currently looking into an Bluetooth mesh example from Nordic website.

I wonder how can I make a node unprovisioned which belongs to a group in this example?

I cannot find any python function about unprovisioning in the given code.

Any suggestion?

Thank you

Parents
  • Hi Hariboss, 

    If you have a look at the class ConfigurationClient in config.py you can find that there is an opcode: _NODE_RESET to reset the node. 
    This will be handled in the node in handle_node_reset() function in config_server.c 

    So yo need to call cc.appkey_add() to reset ( unprovision) the node. 
    Note that this will note remove the node from the database, you would need to do it manually. Also the provisioner will not reuse the address that has been assigned to the node, you can simple use the next incremented addresses for new nodes. 

Reply
  • Hi Hariboss, 

    If you have a look at the class ConfigurationClient in config.py you can find that there is an opcode: _NODE_RESET to reset the node. 
    This will be handled in the node in handle_node_reset() function in config_server.c 

    So yo need to call cc.appkey_add() to reset ( unprovision) the node. 
    Note that this will note remove the node from the database, you would need to do it manually. Also the provisioner will not reuse the address that has been assigned to the node, you can simple use the next incremented addresses for new nodes. 

Children
  • Hi Hung,

    What do you mean by saying "this will note remove the node from the database, you would need to do it manually"?

    Do you mean that remove the node from the database json file by myself?

    Thank you

  • Hi Hariboss, 

    Please read it as "this will not remove the node from the database, you would need to do it manually"
    You can either remove the node manually in the .json file or you can modify the database.py to have an extra function to automatically remove the node from the database automatically after you send the node_reset command. 

    Please be aware that here we only assuming that the node when receiving node_reset will follow the command and erase provisioning data. But it's not guaranteed. A node can choose to ignore that command. To really remove a node from a network, you would need to blacklist the node and update the whole network (other nodes) with a new netkey. 

Related