Cannot bind app key for one of the model with PYACI Script

Hello

I am trying to bind app key for one of the models with the help of PYACI Python script. I am using latest version v5.0.0 for PYACI script and downloaded it here: https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh , also with same version of documentation for commands https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v2.1.1%2Fmd_scripts_interactive_pyaci_README.html.  And I am using Raspberry pi where my py script is running and nRF52840 with Serial Script running connected to Raspberry Pi with Ports /dev/ttyACM0 (or) /dev/ttyACM1. I am trying to bind app key for Sensor_Server Example and i get like this where all the earlier commands works well.

NOTE: examples are connected to Laptop which is obvious where we can run with bluetooth

 I also tried with Mesh Chat sample like above and get same problem

Another Question: we can identify the sample with last model ID where vendor Setup Model ID bound to "0059000a" which is 8 bit and where it should be 4 bit. Even in app i get the same ID

which is ok to setup in app but in this command - cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x1000)) it should have only 4 bit right?

Please help me as soon as possible. I really in need of help to continue my work further

Regards

Parents
  • Hi Sai,

    While getting the PyACI script to work, I ran into the same error.

    The cause of the error, for my case, was that the nodes at index 0 (db.nodes[0]) was not the Light Bulb node that I am trying to interact with.
    When I determine and use the correct node index, things work as it

    should.

    Could you please check your database.json and see if the nodes you want to talk with are not at index 0?

    If you need help with checking that, you could copy the content of the file into a code block here.

    Regards,

    Hieu

  • Hello

    I apologise for my late response. Here is my content and i am trying to provision Sensor Server Example from nordic samples. Still not able to resolve this issue.

    Regards

  • I have added some comments into your log. Please look at them. I think you must be majorly confused. Please slow down and try to understand each of the functions you are using in the script.\

    ## This is 1st and 2nd node provisioning ##
    
    In [1]: db = MeshDB("database/example_database.json")
    
    In [2]: db.provisioners
    Out[2]: [{'name': 'BT Mesh Provisioner', 'UUID': _UUID(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'), 'allocated_unicast_range': [{'low_address': 0010, 'high_address': 7fff}], 'allocated_group_range': [{'low_address': c000, 'high_address': feff}]}]
    
    In [3]: p = Provisioner(device, db)
    
    In [4]: 2023-04-04 21:54:47,078 - INFO - COM6: Success
    2023-04-04 21:54:47,080 - INFO - COM6: Success
    2023-04-04 21:54:47,084 - INFO - COM6: SubnetAdd: {'subnet_handle': 0}
    2023-04-04 21:54:47,088 - INFO - COM6: AppkeyAdd: {'appkey_handle': 0}
    2023-04-04 21:54:47,091 - INFO - COM6: AppkeyAdd: {'appkey_handle': 1}
    In [4]:
    
    In [4]: p.scan_start()
    
    2023-04-04 21:54:53,633 - INFO - COM6: Success
    In [5]: 2023-04-04 21:54:53,754 - INFO - COM6: Received UUID 7faea34d1484433380515cb2eb7b8ccc with RSSI: -50 dB
    In [5]:
    
    In [5]: p.scan_stop()
    
    2023-04-04 21:55:00,198 - INFO - COM6: Success
    In [6]: p.provision(name="chat")
    
    In [7]: 2023-04-04 21:55:13,857 - INFO - COM6: Provision: {'context': 0}
    2023-04-04 21:55:13,917 - INFO - COM6: Link established
    2023-04-04 21:55:14,053 - INFO - COM6: Received capabilities
    2023-04-04 21:55:14,054 - INFO - COM6: Number of elements: 1
    2023-04-04 21:55:14,058 - INFO - COM6: OobUse: {'context': 0}
    2023-04-04 21:55:14,311 - INFO - COM6: ECDH request received
    2023-04-04 21:55:14,317 - INFO - COM6: EcdhSecret: {'context': 0}
    2023-04-04 21:55:14,927 - INFO - COM6: Provisioning complete
    2023-04-04 21:55:14,927 - INFO - COM6:  Address(es): 0x10-0x10
    2023-04-04 21:55:14,929 - INFO - COM6:  Device key: REDACTED
    2023-04-04 21:55:14,930 - INFO - COM6:  Network key: REDACTED
    2023-04-04 21:55:14,932 - INFO - COM6: Adding device key to subnet 0
    2023-04-04 21:55:14,932 - INFO - COM6: Adding publication address of root element
    2023-04-04 21:55:14,936 - INFO - COM6: DevkeyAdd: {'devkey_handle': 8}
    2023-04-04 21:55:14,937 - INFO - COM6: AddrPublicationAdd: {'address_handle': 0}
    2023-04-04 21:55:15,105 - INFO - COM6: Provisioning link closed
    In [7]:
    
    In [7]: cc = ConfigurationClient(db)
    
    In [8]: device.model_add(cc)
    
    In [9]: cc.publish_set(8, 0)
    
    In [10]: cc.composition_data_get()
    
    In [11]: 2023-04-04 21:55:42,796 - INFO - COM6: PacketSend: {'token': 1}
    2023-04-04 21:55:42,825 - INFO - COM6: {event: MeshTxComplete, data: {'token': 1}}
    In [11]:
    
    In [11]: cc.composition_data_get()
    
    In [12]: 2023-04-04 21:55:52,327 - INFO - COM6: PacketSend: {'token': 2}
    2023-04-04 21:55:52,350 - INFO - COM6: {event: MeshTxComplete, data: {'token': 2}}
    2023-04-04 21:55:52,503 - INFO - COM6.ConfigurationClient: Received composition data (page 0x00): {
      "cid": "0059",
      "pid": "0000",
      "vid": "0000",
      "crpl": 10,
      "features": {
        "relay": 0,
        "proxy": 0,
        "friend": 0,
        "low_power": 2
      },
      "elements": [
        {
          "index": 0,
          "location": "0001",
          "models": [
            {
              "modelId": "0000"
            },
            {
              "modelId": "0002"
            },
            {
              "modelId": "0059000a"
            }
          ]
        }
      ]
    }
    In [12]:
    
    
    
    In [12]: cc.appkey_add(0)
    
    In [13]: 2023-04-04 21:55:55,314 - INFO - COM6: PacketSend: {'token': 3}
    2023-04-04 21:55:55,367 - INFO - COM6: {event: MeshTxComplete, data: {'token': 3}}
    2023-04-04 21:55:55,436 - INFO - COM6.ConfigurationClient: Appkey status: AccessStatus.SUCCESS
    2023-04-04 21:55:55,438 - INFO - COM6.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0010
    In [13]:
    
    
    
    
    
    
    
    
    
    
    In [13]: cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x0059,0x000a))
    // Hieu: Expectation: Working with node addr 0x0010, model (0x000a, 0x0059)
    //		 So this command will result in invalid model
    
    In [14]: 2023-04-04 21:56:12,008 - INFO - COM6: PacketSend: {'token': 4}
    2023-04-04 21:56:12,031 - INFO - COM6: {event: MeshTxComplete, data: {'token': 4}}
    2023-04-04 21:56:12,043 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.INVALID_MODEL
    // Hieu: As expected
    
    
    
    
    
    
    
    
    
    
    
    
    In [14]:
    
    In [14]: cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x0059,0x000a,0x0059))
    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    Cell In[14], line 1
    ----> 1 cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x0059,0x000a,0x0059))
    
    TypeError: ModelId.__init__() takes from 2 to 3 positional arguments but 4 were given
    
    
    
    
    
    
    
    
    // Hieu: Expectation: Working with node addr 0x0010, model (0x000a, 0x0059)
    //		 So this command should succeed
    In [15]: cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x000a,0x0059))
    
    In [16]: 2023-04-04 21:56:40,723 - INFO - COM6: PacketSend: {'token': 5}
    2023-04-04 21:56:40,749 - INFO - COM6: {event: MeshTxComplete, data: {'token': 5}}
    2023-04-04 21:56:40,757 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.SUCCESS
    2023-04-04 21:56:40,761 - INFO - COM6.ConfigurationClient: Appkey bind 0 to model 0059000a at 0010
    // Hieu: As expected
    
    
    
    
    
    
    
    
    
    
    
    In [16]:
    
    In [16]: p.scan_start()
    
    2023-04-04 21:57:30,853 - INFO - COM6: Success
    In [17]: 2023-04-04 21:57:35,388 - INFO - COM6: Received UUID 3442243ef35a46a58bbddbc10ca5395a with RSSI: -66 dB
    In [17]:
    
    In [17]: p.scan_stop()
    
    2023-04-04 21:57:42,453 - INFO - COM6: Success
    In [18]: p.provision(name="chat1")
    
    In [19]: 2023-04-04 21:57:54,168 - INFO - COM6: Provision: {'context': 0}
    2023-04-04 21:57:54,245 - INFO - COM6: Link established
    2023-04-04 21:57:54,382 - INFO - COM6: Received capabilities
    2023-04-04 21:57:54,382 - INFO - COM6: Number of elements: 1
    2023-04-04 21:57:54,385 - INFO - COM6: OobUse: {'context': 0}
    2023-04-04 21:57:54,666 - INFO - COM6: ECDH request received
    2023-04-04 21:57:54,674 - INFO - COM6: EcdhSecret: {'context': 0}
    2023-04-04 21:57:57,268 - INFO - COM6: Provisioning complete
    2023-04-04 21:57:57,277 - INFO - COM6:  Address(es): 0x11-0x11
    2023-04-04 21:57:57,282 - INFO - COM6:  Device key: REDACTED
    2023-04-04 21:57:57,286 - INFO - COM6:  Network key: REDACTED
    2023-04-04 21:57:57,288 - INFO - COM6: Adding device key to subnet 0
    2023-04-04 21:57:57,290 - INFO - COM6: Adding publication address of root element
    2023-04-04 21:57:57,294 - INFO - COM6: DevkeyAdd: {'devkey_handle': 9}
    2023-04-04 21:57:57,297 - INFO - COM6: AddrPublicationAdd: {'address_handle': 1}
    2023-04-04 21:57:57,445 - INFO - COM6: Provisioning link closed
    In [19]:
    
    In [19]: cc.publish_set(9, 1)
    
    In [20]: cc.composition_data_get()
    
    In [21]: 2023-04-04 21:58:10,288 - INFO - COM6: PacketSend: {'token': 6}
    2023-04-04 21:58:10,313 - INFO - COM6: {event: MeshTxComplete, data: {'token': 6}}
    In [21]: cc.composition_data_get()
    
    In [22]: 2023-04-04 21:58:18,670 - INFO - COM6: PacketSend: {'token': 7}
    2023-04-04 21:58:18,693 - INFO - COM6: {event: MeshTxComplete, data: {'token': 7}}
    2023-04-04 21:58:18,847 - INFO - COM6.ConfigurationClient: Received composition data (page 0x00): {
      "cid": "0059",
      "pid": "0000",
      "vid": "0000",
      "crpl": 10,
      "features": {
        "relay": 0,
        "proxy": 0,
        "friend": 0,
        "low_power": 2
      },
      "elements": [
        {
          "index": 0,
          "location": "0001",
          "models": [
            {
              "modelId": "0000"
            },
            {
              "modelId": "0002"
            },
            {
              "modelId": "0059000a"
            }
          ]
        }
      ]
    }
    In [22]:
    
    In [22]: cc.appkey_add(0)
    
    In [23]: 2023-04-04 21:58:22,615 - INFO - COM6: PacketSend: {'token': 8}
    2023-04-04 21:58:22,681 - INFO - COM6: {event: MeshTxComplete, data: {'token': 8}}
    2023-04-04 21:58:22,753 - INFO - COM6.ConfigurationClient: Appkey status: AccessStatus.SUCCESS
    2023-04-04 21:58:22,755 - INFO - COM6.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0011
    In [23]:
    
    
    
    
    
    
    // Hieu: Expectation: Working with node addr 0x0011, model (0x000a, 0x0059)
    //		 So this command should result in invalid address, because db.nodes[0].unicast_address is 0x0010
    In [23]: cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x0059,0x000a))
    
    In [24]: 2023-04-04 21:58:34,760 - INFO - COM6: PacketSend: {'token': 9}
    2023-04-04 21:58:34,791 - INFO - COM6: {event: MeshTxComplete, data: {'token': 9}}
    2023-04-04 21:58:34,804 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.INVALID_ADDRESS
    // As expected
    
    
    
    
    
    
    
    
    
    
    
    
    In [24]:
    
    
    // Hieu: Expectation: Working with node addr 0x0011, model (0x000a, 0x0059)
    //		 So this command should result in invalid address, because db.nodes[0].unicast_address is 0x0010
    In [24]: cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x000a,0x0059))
    
    In [25]: 2023-04-04 21:58:50,665 - INFO - COM6: PacketSend: {'token': 10}
    2023-04-04 21:58:50,686 - INFO - COM6: {event: MeshTxComplete, data: {'token': 10}}
    2023-04-04 21:58:50,694 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.INVALID_ADDRESS
    In [25]:
    // As expected
    
    
    
    
    
    
    
    
    
    
    
    
    // Hieu: Expectation: Working with node addr 0x0011, model (0x000a, 0x0059)
    //		 So this command should result in invalid address, because db.nodes[1].unicast_address+1 is 0x0012
    In [25]: cc.model_app_bind(db.nodes[1].unicast_address + 1, 0, mt.ModelId(0x000a,0x0059))
    
    In [26]: 2023-04-04 22:01:04,558 - INFO - COM6: PacketSend: {'token': 11}
    2023-04-04 22:01:04,580 - INFO - COM6: {event: MeshTxComplete, data: {'token': 11}}
    2023-04-04 22:01:04,592 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.INVALID_ADDRESS
    // As expected
    
    
    
    
    
    
    
    
    
    
    
    
    
    In [26]:
    
    // Hieu: Expectation: Working with node addr 0x0011, model (0x000a, 0x0059)
    //		 So this command should succeed EVEN THOUGH IT IS MALFORMED, because db.nodes[0].unicast_address+1 is still 0x0011
    In [26]: cc.model_app_bind(db.nodes[0].unicast_address + 1, 0, mt.ModelId(0x000a,0x0059))
    
    In [27]: 2023-04-04 22:01:14,926 - INFO - COM6: PacketSend: {'token': 12}
    2023-04-04 22:01:14,952 - INFO - COM6: {event: MeshTxComplete, data: {'token': 12}}
    2023-04-04 22:01:14,962 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.SUCCESS
    2023-04-04 22:01:14,964 - INFO - COM6.ConfigurationClient: Appkey bind 0 to model 0059000a at 0011
    // As expected
    
    
    
    
    
    
    
    
    
    
    *********************************************************************************************************************************************************************************************************************************
    ## This is 3rd node provisioning ##
    In [1]: db = MeshDB("database/example_database.json")
    
    In [2]: db.provisioners
    Out[2]: [{'name': 'BT Mesh Provisioner', 'UUID': _UUID(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'), 'allocated_unicast_range': [{'low_address': 0010, 'high_address': 7fff}], 'allocated_group_range': [{'low_address': c000, 'high_address': feff}]}]
    
    In [3]: p = Provisioner(device, db)
    
    In [4]: 2023-04-04 22:19:31,223 - INFO - COM6: Success
    2023-04-04 22:19:31,225 - INFO - COM6: Success
    2023-04-04 22:19:31,229 - INFO - COM6: SubnetAdd: {'subnet_handle': 0}
    2023-04-04 22:19:31,233 - INFO - COM6: AppkeyAdd: {'appkey_handle': 0}
    2023-04-04 22:19:31,237 - INFO - COM6: AppkeyAdd: {'appkey_handle': 1}
    In [4]:
    
    In [4]: p.scan_start()
    
    2023-04-04 22:19:42,574 - INFO - COM6: Success
    In [5]: 2023-04-04 22:19:44,391 - INFO - COM6: Received UUID 3442243ef35a46a58bbddbc10ca5395a with RSSI: -57 dB
    In [5]:
    
    In [5]: p.scan_stop()
    
    2023-04-04 22:19:52,264 - INFO - COM6: Success
    In [6]: p.provision(name="chat2")
    
    In [7]: 2023-04-04 22:20:23,601 - INFO - COM6: Provision: {'context': 0}
    2023-04-04 22:20:23,676 - INFO - COM6: Link established
    2023-04-04 22:20:23,813 - INFO - COM6: Received capabilities
    2023-04-04 22:20:23,813 - INFO - COM6: Number of elements: 1
    2023-04-04 22:20:23,816 - INFO - COM6: OobUse: {'context': 0}
    2023-04-04 22:20:26,155 - INFO - COM6: ECDH request received
    2023-04-04 22:20:26,163 - INFO - COM6: EcdhSecret: {'context': 0}
    2023-04-04 22:20:26,760 - INFO - COM6: Provisioning complete
    2023-04-04 22:20:26,760 - INFO - COM6:  Address(es): 0x12-0x12
    2023-04-04 22:20:26,761 - INFO - COM6:  Device key: REDACTED
    2023-04-04 22:20:26,761 - INFO - COM6:  Network key: REDACTED
    2023-04-04 22:20:26,763 - INFO - COM6: Adding device key to subnet 0
    2023-04-04 22:20:26,764 - INFO - COM6: Adding publication address of root element
    2023-04-04 22:20:26,768 - INFO - COM6: DevkeyAdd: {'devkey_handle': 8}
    2023-04-04 22:20:26,769 - INFO - COM6: AddrPublicationAdd: {'address_handle': 0}
    2023-04-04 22:20:26,930 - INFO - COM6: Provisioning link closed
    In [7]:
    
    In [7]: cc = ConfigurationClient(db)
    
    In [8]: device.model_add(cc)
    
    In [9]: cc.publish_set(8, 0)
    
    In [10]: cc.composition_data_get()
    
    In [11]: 2023-04-04 22:29:09,505 - INFO - COM6: PacketSend: {'token': 1}
    2023-04-04 22:29:09,534 - INFO - COM6: {event: MeshTxComplete, data: {'token': 1}}
    2023-04-04 22:29:09,686 - INFO - COM6.ConfigurationClient: Received composition data (page 0x00): {
      "cid": "0059",
      "pid": "0000",
      "vid": "0000",
      "crpl": 10,
      "features": {
        "relay": 0,
        "proxy": 0,
        "friend": 0,
        "low_power": 2
      },
      "elements": [
        {
          "index": 0,
          "location": "0001",
          "models": [
            {
              "modelId": "0000"
            },
            {
              "modelId": "0002"
            },
            {
              "modelId": "0059000a"
            }
          ]
        }
      ]
    }
    In [11]:
    
    In [11]: cc.appkey_add(0)
    
    In [12]: 2023-04-04 22:29:21,802 - INFO - COM6: PacketSend: {'token': 2}
    2023-04-04 22:29:21,863 - INFO - COM6: {event: MeshTxComplete, data: {'token': 2}}
    2023-04-04 22:29:21,933 - INFO - COM6.ConfigurationClient: Appkey status: AccessStatus.SUCCESS
    2023-04-04 22:29:21,936 - INFO - COM6.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0012
    In [12]:
    
    In [12]: len(db.nodes)
    Out[12]: 3
    
    In [13]: db.nodes[0]
    Out[13]: {'UUID': _UUID(b'\x7f\xae\xa3M\x14\x84C3\x80Q\\\xb2\xeb{\x8c\xcc'), 'device_key': Key(REDACTED), 'unicast_address': 0010, 'net_keys': [{'index': 0}], 'config_complete': False, 'name': 'chat', 'security': <SecurityLevel.LOW: 'low'>, 'cid': 0059, 'vid': 0000, 'pid': 0000, 'crpl': 000a, 'features': {'relay': <FeatureState.DISABLED: 0>, 'proxy': <FeatureState.DISABLED: 0>, 'friend': <FeatureState.DISABLED: 0>, 'low_power': <FeatureState.NOT_SUPPORTED: 2>}, 'elements': [{'index': 0, 'location': 0001, 'models': [{'model_id': 0000, 'subscribe': [], 'publish': None, 'bind': []}, {'model_id': 0002, 'subscribe': [], 'publish': None, 'bind': []}, {'model_id': 0059000a, 'subscribe': [], 'publish': None, 'bind': [0]}], 'name': ''}], 'app_keys': [0], 'secure_network_beacon': None, 'network_transmit': None, 'relay_retransmit': None, 'default_TTL': None}
    
    In [14]: db.nodes[1]
    Out[14]: {'UUID': _UUID(b'4B$>\xf3ZF\xa5\x8b\xbd\xdb\xc1\x0c\xa59Z'), 'device_key': Key(REDACTED), 'unicast_address': 0011, 'net_keys': [{'index': 0}], 'config_complete': False, 'name': 'chat1', 'security': <SecurityLevel.LOW: 'low'>, 'cid': 0059, 'vid': 0000, 'pid': 0000, 'crpl': 000a, 'features': {'relay': <FeatureState.DISABLED: 0>, 'proxy': <FeatureState.DISABLED: 0>, 'friend': <FeatureState.DISABLED: 0>, 'low_power': <FeatureState.NOT_SUPPORTED: 2>}, 'elements': [{'index': 0, 'location': 0001, 'models': [{'model_id': 0000, 'subscribe': [], 'publish': None, 'bind': []}, {'model_id': 0002, 'subscribe': [], 'publish': None, 'bind': []}, {'model_id': 0059000a, 'subscribe': [], 'publish': None, 'bind': [0]}], 'name': ''}], 'app_keys': [0], 'secure_network_beacon': None, 'network_transmit': None, 'relay_retransmit': None, 'default_TTL': None}
    
    In [15]: db.nodes[2]
    Out[15]: {'UUID': _UUID(b'4B$>\xf3ZF\xa5\x8b\xbd\xdb\xc1\x0c\xa59Z'), 'device_key': Key(REDACTED), 'unicast_address': 0012, 'net_keys': [{'index': 0}], 'config_complete': False, 'name': 'chat2', 'security': <SecurityLevel.LOW: 'low'>, 'cid': 0059, 'vid': 0000, 'pid': 0000, 'crpl': 10, 'features': {'relay': <FeatureState.DISABLED: 0>, 'proxy': <FeatureState.DISABLED: 0>, 'friend': <FeatureState.DISABLED: 0>, 'low_power': <FeatureState.NOT_SUPPORTED: 2>}, 'elements': [{'index': 0, 'location': 0001, 'models': [{'model_id': 0000, 'subscribe': [], 'publish': None, 'bind': []}, {'model_id': 0002, 'subscribe': [], 'publish': None, 'bind': []}, {'model_id': 0059000a, 'subscribe': [], 'publish': None, 'bind': []}], 'name': ''}], 'app_keys': [0], 'secure_network_beacon': None, 'network_transmit': None, 'relay_retransmit': None, 'default_TTL': None}
    
    In [16]:
    
    *********************************************************************************************************************************************************************************************************************************
    ## This is 3 nodes database file ##
    
    {
      "$schema": "",
      "appKeys": [
        {
          "boundNetKey": 0,
          "index": 0,
          "key": "REDACTED",
          "name": "lights"
        },
        {
          "boundNetKey": 0,
          "index": 1,
          "key": "REDACTED",
          "name": "locks"
        }
      ],
      "groups": [
        {
          "address": 49153,
          "name": "Room 1",
          "parentAddress": 0
        },
        {
          "address": 49154,
          "name": "Room 2",
          "parentAddress": 0
        }
      ],
      "ivIndex": 0,
      "ivUpdate": 0,
      "meshName": "BT Mesh",
      "meshUUID": "01020304050607080102030405060708",
      "netKeys": [
        {
          "index": 0,
          "key": "REDACTED",
          "minSecurity": "low",
          "name": "root",
          "phase": 0
        }
      ],
      "nodes": [
        {
          "UUID": "7faea34d1484433380515cb2eb7b8ccc",
          "appKeys": [
            0
          ],
          "cid": "0059",
          "configComplete": false,
          "crpl": "000a",
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0001",
              "models": [
                {
                  "modelId": "0000"
                },
                {
                  "modelId": "0002"
                },
                {
                  "bind": [
                    0
                  ],
                  "modelId": "0059000a"
                }
              ]
            }
          ],
          "features": {
            "friend": 0,
            "lowPower": 2,
            "proxy": 0,
            "relay": 0
          },
          "name": "chat",
          "netKeys": [
            0
          ],
          "pid": "0000",
          "security": "low",
          "unicastAddress": 16,
          "vid": "0000"
        },
        {
          "UUID": "3442243ef35a46a58bbddbc10ca5395a",
          "appKeys": [
            0
          ],
          "cid": "0059",
          "configComplete": false,
          "crpl": "000a",
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0001",
              "models": [
                {
                  "modelId": "0000"
                },
                {
                  "modelId": "0002"
                },
                {
                  "bind": [
                    0
                  ],
                  "modelId": "0059000a"
                }
              ]
            }
          ],
          "features": {
            "friend": 0,
            "lowPower": 2,
            "proxy": 0,
            "relay": 0
          },
          "name": "chat1",
          "netKeys": [
            0
          ],
          "pid": "0000",
          "security": "low",
          "unicastAddress": 17,
          "vid": "0000"
        },
        {
          "UUID": "3442243ef35a46a58bbddbc10ca5395a",
          "appKeys": [
            0
          ],
          "cid": "0059",
          "configComplete": false,
          "crpl": 10,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0001",
              "models": [
                {
                  "modelId": "0000"
                },
                {
                  "modelId": "0002"
                },
                {
                  "modelId": "0059000a"
                }
              ]
            }
          ],
          "features": {
            "friend": 0,
            "lowPower": 2,
            "proxy": 0,
            "relay": 0
          },
          "name": "chat2",
          "netKeys": [
            0
          ],
          "pid": "0000",
          "security": "low",
          "unicastAddress": 18,
          "vid": "0000"
        }
      ],
      "provisioners": [
        {
          "UUID": "00000000000000000000000000000000",
          "allocatedGroupRange": [
            {
              "highAddress": 65279,
              "lowAddress": 49152
            }
          ],
          "allocatedUnicastRange": [
            {
              "highAddress": 32767,
              "lowAddress": 16
            }
          ],
          "name": "BT Mesh Provisioner"
        }
      ],
      "timestamp": "2023-04-04 22:29:21.933455"
    }

    Please be informed that I will be out of office (actually from today) and return Tuesday Apr 11 for the Easter holiday.

    Regards,

    Hieu  

  • Hello Hieu,

    It works! Thank You so much for your effort and help. one last question: how to chat private with mesh chat example when i provision with PyACI script? where to find the node address?

    Regards

  • Hi Sai,

    You can find it in the provisioning output:

    In [7]: 2023-04-04 21:55:13,857 - INFO - COM6: Provision: {'context': 0}
    2023-04-04 21:55:13,917 - INFO - COM6: Link established
    2023-04-04 21:55:14,053 - INFO - COM6: Received capabilities
    2023-04-04 21:55:14,054 - INFO - COM6: Number of elements: 1
    2023-04-04 21:55:14,058 - INFO - COM6: OobUse: {'context': 0}
    2023-04-04 21:55:14,311 - INFO - COM6: ECDH request received
    2023-04-04 21:55:14,317 - INFO - COM6: EcdhSecret: {'context': 0}
    2023-04-04 21:55:14,927 - INFO - COM6: Provisioning complete
    2023-04-04 21:55:14,927 - INFO - COM6: Address(es): 0x10-0x10
    2023-04-04 21:55:14,929 - INFO - COM6: Device key: REDACTED
    2023-04-04 21:55:14,930 - INFO - COM6: Network key: REDACTED
    2023-04-04 21:55:14,932 - INFO - COM6: Adding device key to subnet 0
    2023-04-04 21:55:14,932 - INFO - COM6: Adding publication address of root element
    2023-04-04 21:55:14,936 - INFO - COM6: DevkeyAdd: {'devkey_handle': 8}
    2023-04-04 21:55:14,937 - INFO - COM6: AddrPublicationAdd: {'address_handle': 0}
    2023-04-04 21:55:15,105 - INFO - COM6: Provisioning link closed

    If your node has more than one element, it will be given an address range, one unicast address for each element.
    (It's in this case that you use db.nodes[idx]+0 to address element 0, db.nodes[idx]+1 to address element 1, etc.)

    The element addressing is only of concerns if you modify the Mesh Chat sample to have more elements. By default, it only has one element.

    Regards,

    Hieu

  • Hello Hieu

    Yeah i did, i dont think so its working correctly. when i chat privately i should get in another screen right? . Also i checked with server and client example same thing happens i get error looks like its not working between 2 devices.

    
    In [1]: db = MeshDB("database/example_database.json")
    
    In [2]: db.provisioners
    Out[2]: [{'name': 'BT Mesh Provisioner', 'UUID': _UUID(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'), 'allocated_unicast_range': [{'low_address': 0010, 'high_address': 7fff}], 'allocated_group_range': [{'low_address': c000, 'high_address': feff}]}]
    
    In [3]: p = Provisioner(device, db)
    
    In [4]: 2023-04-13 15:11:26,751 - INFO - COM6: Success
    2023-04-13 15:11:26,751 - INFO - COM6: Success
    2023-04-13 15:11:26,751 - INFO - COM6: SubnetAdd: {'subnet_handle': 0}
    2023-04-13 15:11:26,766 - INFO - COM6: AppkeyAdd: {'appkey_handle': 0}
    2023-04-13 15:11:26,768 - INFO - COM6: AppkeyAdd: {'appkey_handle': 1}
    In [4]:
    
    In [4]: p.scan_start()
    
    2023-04-13 15:11:34,934 - INFO - COM6: Success
    In [5]: 2023-04-13 15:11:39,722 - INFO - COM6: Received UUID 7faea34d1484433380515cb2eb7b8ccc with RSSI: -61 dB
    In [5]: p.scan_stop()
    
    2023-04-13 15:11:42,136 - INFO - COM6: Success
    In [6]: p.provision(name="chat")
    
    In [7]: 2023-04-13 15:11:47,455 - INFO - COM6: Provision: {'context': 0}
    2023-04-13 15:11:47,499 - INFO - COM6: Link established
    2023-04-13 15:11:47,641 - INFO - COM6: Received capabilities
    2023-04-13 15:11:47,641 - INFO - COM6: Number of elements: 1
    2023-04-13 15:11:47,641 - INFO - COM6: OobUse: {'context': 0}
    2023-04-13 15:11:49,959 - INFO - COM6: ECDH request received
    2023-04-13 15:11:49,971 - INFO - COM6: EcdhSecret: {'context': 0}
    2023-04-13 15:11:50,586 - INFO - COM6: Provisioning complete
    2023-04-13 15:11:50,586 - INFO - COM6:  Address(es): 0x10-0x10
    2023-04-13 15:11:50,586 - INFO - COM6:  Device key: REDACTED
    2023-04-13 15:11:50,586 - INFO - COM6:  Network key: REDACTED
    2023-04-13 15:11:50,586 - INFO - COM6: Adding device key to subnet 0
    2023-04-13 15:11:50,586 - INFO - COM6: Adding publication address of root element
    2023-04-13 15:11:50,586 - INFO - COM6: DevkeyAdd: {'devkey_handle': 8}
    2023-04-13 15:11:50,598 - INFO - COM6: AddrPublicationAdd: {'address_handle': 0}
    2023-04-13 15:11:50,761 - INFO - COM6: Provisioning link closed
    In [7]:
    
    In [7]: cc = ConfigurationClient(db)
    
    In [8]: device.model_add(cc)
    
    In [9]: cc.publish_set(8, 0)
    
    In [10]: cc.composition_data_get()
    
    In [11]: 2023-04-13 15:12:33,072 - INFO - COM6: PacketSend: {'token': 1}
    2023-04-13 15:12:33,097 - INFO - COM6: {event: MeshTxComplete, data: {'token': 1}}
    2023-04-13 15:12:33,242 - INFO - COM6.ConfigurationClient: Received composition data (page 0x00): {
      "cid": "0059",
      "pid": "0000",
      "vid": "0000",
      "crpl": 10,
      "features": {
        "relay": 0,
        "proxy": 0,
        "friend": 0,
        "low_power": 2
      },
      "elements": [
        {
          "index": 0,
          "location": "0001",
          "models": [
            {
              "modelId": "0000"
            },
            {
              "modelId": "0002"
            },
            {
              "modelId": "0059000a"
            }
          ]
        }
      ]
    }
    In [11]:
    
    In [11]: cc.appkey_add(0)
    
    In [12]: 2023-04-13 15:12:40,890 - INFO - COM6: PacketSend: {'token': 2}
    2023-04-13 15:12:40,945 - INFO - COM6: {event: MeshTxComplete, data: {'token': 2}}
    2023-04-13 15:12:41,017 - INFO - COM6.ConfigurationClient: Appkey status: AccessStatus.SUCCESS
    2023-04-13 15:12:41,018 - INFO - COM6.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0010
    In [12]:
    
    In [12]: cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x000a,0x0059))
    
    In [13]: 2023-04-13 15:12:49,930 - INFO - COM6: PacketSend: {'token': 3}
    2023-04-13 15:12:49,944 - INFO - COM6: {event: MeshTxComplete, data: {'token': 3}}
    2023-04-13 15:12:49,958 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.SUCCESS
    2023-04-13 15:12:49,967 - INFO - COM6.ConfigurationClient: Appkey bind 0 to model 0059000a at 0010
    In [13]:
    
    In [13]: p.scan_start()
    
    2023-04-13 15:13:53,372 - INFO - COM6: Success
    In [14]: 2023-04-13 15:13:56,384 - INFO - COM6: Received UUID 3442243ef35a46a58bbddbc10ca5395a with RSSI: -53 dB
    In [14]:
    
    In [14]: p.scan_stop()
    
    2023-04-13 15:14:01,005 - INFO - COM6: Success
    In [15]: p.provision(name="chat1")
    
    In [16]: 2023-04-13 15:14:18,193 - INFO - COM6: Provision: {'context': 0}
    2023-04-13 15:14:18,225 - INFO - COM6: Link established
    2023-04-13 15:14:18,364 - INFO - COM6: Received capabilities
    2023-04-13 15:14:18,364 - INFO - COM6: Number of elements: 1
    2023-04-13 15:14:18,364 - INFO - COM6: OobUse: {'context': 0}
    2023-04-13 15:14:20,694 - INFO - COM6: ECDH request received
    2023-04-13 15:14:20,711 - INFO - COM6: EcdhSecret: {'context': 0}
    2023-04-13 15:14:21,333 - INFO - COM6: Provisioning complete
    2023-04-13 15:14:21,335 - INFO - COM6:  Address(es): 0x11-0x11
    2023-04-13 15:14:21,335 - INFO - COM6:  Device key: REDACTED
    2023-04-13 15:14:21,335 - INFO - COM6:  Network key: REDACTED
    2023-04-13 15:14:21,335 - INFO - COM6: Adding device key to subnet 0
    2023-04-13 15:14:21,335 - INFO - COM6: Adding publication address of root element
    2023-04-13 15:14:21,341 - INFO - COM6: DevkeyAdd: {'devkey_handle': 9}
    2023-04-13 15:14:21,341 - INFO - COM6: AddrPublicationAdd: {'address_handle': 1}
    2023-04-13 15:14:21,487 - INFO - COM6: Provisioning link closed
    In [16]: #
    
    In [17]: cc.publish_set(9, 1)
    
    In [18]: cc.composition_data_get()
    
    In [19]: 2023-04-13 15:15:32,144 - INFO - COM6: PacketSend: {'token': 4}
    2023-04-13 15:15:32,152 - INFO - COM6: {event: MeshTxComplete, data: {'token': 4}}
    2023-04-13 15:15:32,310 - INFO - COM6.ConfigurationClient: Received composition data (page 0x00): {
      "cid": "0059",
      "pid": "0000",
      "vid": "0000",
      "crpl": 10,
      "features": {
        "relay": 0,
        "proxy": 0,
        "friend": 0,
        "low_power": 2
      },
      "elements": [
        {
          "index": 0,
          "location": "0001",
          "models": [
            {
              "modelId": "0000"
            },
            {
              "modelId": "0002"
            },
            {
              "modelId": "0059000a"
            }
          ]
        }
      ]
    }
    In [19]:
    
    In [19]: cc.appkey_add(0)
    
    In [20]: 2023-04-13 15:15:39,526 - INFO - COM6: PacketSend: {'token': 5}
    2023-04-13 15:15:39,574 - INFO - COM6: {event: MeshTxComplete, data: {'token': 5}}
    2023-04-13 15:15:39,653 - INFO - COM6.ConfigurationClient: Appkey status: AccessStatus.SUCCESS
    2023-04-13 15:15:39,653 - INFO - COM6.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0011
    In [20]:
    
    In [20]: cc.model_app_bind(db.nodes[0].unicast_address + 1, 0, mt.ModelId(0x000a,0x0059))
    
    In [21]: 2023-04-13 15:15:46,199 - INFO - COM6: PacketSend: {'token': 6}
    2023-04-13 15:15:46,220 - INFO - COM6: {event: MeshTxComplete, data: {'token': 6}}
    2023-04-13 15:15:46,229 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.SUCCESS
    2023-04-13 15:15:46,231 - INFO - COM6.ConfigurationClient: Appkey bind 0 to model 0059000a at 0011
    In [21]:
    
    In [21]: cc.model_publication_set(db.nodes[0].unicast_address + 1, mt.ModelId(0x000a,0x0059), mt.Publish(db.nodes[0].unicast_address, index=0, ttl=1))
    
    In [22]: 2023-04-13 15:15:52,625 - INFO - COM6: PacketSend: {'token': 7}
    2023-04-13 15:15:52,677 - INFO - COM6: {event: MeshTxComplete, data: {'token': 7}}
    2023-04-13 15:15:52,817 - INFO - COM6.ConfigurationClient: Model publication status: AccessStatus.SUCCESS
    2023-04-13 15:15:52,817 - INFO - COM6.ConfigurationClient: Publication status for model 0059000a at element 17 to {'address': 0010, 'index': 0, 'ttl': 1, 'period': 0, 'retransmit': {'count': 0, 'interval_steps': 0, 'interval': 50}, 'credentials': <FriendshipCredentials.DISABLED: 0>}
    In [22]:
    
    In [22]: cc.publish_set(8, 0)
    
    In [23]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x000a,0x0059), mt.Publish(db.groups[0].address, index=0, ttl=1))
    
    In [24]: 2023-04-13 15:16:05,136 - INFO - COM6: PacketSend: {'token': 8}
    2023-04-13 15:16:05,185 - INFO - COM6: {event: MeshTxComplete, data: {'token': 8}}
    2023-04-13 15:16:05,326 - INFO - COM6.ConfigurationClient: Model publication status: AccessStatus.SUCCESS
    2023-04-13 15:16:05,329 - INFO - COM6.ConfigurationClient: Publication status for model 0059000a at element 16 to {'address': c001, 'index': 0, 'ttl': 1, 'period': 0, 'retransmit': {'count': 0, 'interval_steps': 0, 'interval': 50}, 'credentials': <FriendshipCredentials.DISABLED: 0>}
    In [24]:
    
    In [24]: cc.publish_set(9, 1)
    
    In [25]: cc.model_subscription_add(db.nodes[0].unicast_address + 1, db.groups[0].address, mt.ModelId(0x000a,0x0059))
    
    In [26]: 2023-04-13 15:16:15,850 - INFO - COM6: PacketSend: {'token': 9}
    2023-04-13 15:16:15,870 - INFO - COM6: {event: MeshTxComplete, data: {'token': 9}}
    2023-04-13 15:16:15,870 - INFO - COM6.ConfigurationClient: Model subscription status: AccessStatus.SUCCESS
    2023-04-13 15:16:15,882 - INFO - COM6.ConfigurationClient: Added subscription 'c001' to model 0059000a at element 0011

    this is server and client output, 1st it was like "error getting chip temperature", after i set publish its like "<err> bt_mesh_access: Failed to publish (err -22)". There is problem with this command"cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x1101), mt.Publish(db.groups[0].address, index=0, ttl=1))".

    
    In [1]: db = MeshDB("database/example_database.json")
    
    In [2]: db.provisioners
    Out[2]: [{'name': 'BT Mesh Provisioner', 'UUID': _UUID(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'), 'allocated_unicast_range': [{'low_address': 0010, 'high_address': 7fff}], 'allocated_group_range': [{'low_address': c000, 'high_address': feff}]}]
    
    In [3]: p = Provisioner(device, db)
    
    In [4]: 2023-04-13 15:50:23,613 - INFO - COM6: Success
    2023-04-13 15:50:23,617 - INFO - COM6: Success
    2023-04-13 15:50:23,622 - INFO - COM6: SubnetAdd: {'subnet_handle': 0}
    2023-04-13 15:50:23,624 - INFO - COM6: AppkeyAdd: {'appkey_handle': 0}
    2023-04-13 15:50:23,628 - INFO - COM6: AppkeyAdd: {'appkey_handle': 1}
    In [4]:
    
    In [4]: p.scan_start()
    
    2023-04-13 15:50:29,875 - INFO - COM6: Success
    In [5]: 2023-04-13 15:50:33,463 - INFO - COM6: Received UUID 0d49c695b0b444efb2b6396a4f4b8b10 with RSSI: -75 dB
    In [5]:
    
    In [5]: p.scan_stop()
    
    2023-04-13 15:50:35,783 - INFO - COM6: Success
    In [6]: p.provision(name="server")
    
    In [7]: 2023-04-13 15:50:45,992 - INFO - COM6: Provision: {'context': 0}
    2023-04-13 15:50:46,029 - INFO - COM6: Link established
    2023-04-13 15:50:46,190 - INFO - COM6: Received capabilities
    2023-04-13 15:50:46,190 - INFO - COM6: Number of elements: 1
    2023-04-13 15:50:46,200 - INFO - COM6: OobUse: {'context': 0}
    2023-04-13 15:50:48,557 - INFO - COM6: ECDH request received
    2023-04-13 15:50:48,557 - INFO - COM6: EcdhSecret: {'context': 0}
    2023-04-13 15:50:49,454 - INFO - COM6: Provisioning complete
    2023-04-13 15:50:49,454 - INFO - COM6:  Address(es): 0x10-0x10
    2023-04-13 15:50:49,454 - INFO - COM6:  Device key: REDACTED
    2023-04-13 15:50:49,460 - INFO - COM6:  Network key: REDACTED
    2023-04-13 15:50:49,461 - INFO - COM6: Adding device key to subnet 0
    2023-04-13 15:50:49,461 - INFO - COM6: Adding publication address of root element
    2023-04-13 15:50:49,467 - INFO - COM6: DevkeyAdd: {'devkey_handle': 8}
    2023-04-13 15:50:49,467 - INFO - COM6: AddrPublicationAdd: {'address_handle': 0}
    2023-04-13 15:50:49,607 - INFO - COM6: Provisioning link closed
    In [7]:
    
    In [7]: cc = ConfigurationClient(db)
    
    In [8]: device.model_add(cc)
    
    In [9]: cc.publish_set(8, 0)
    
    In [10]: cc.composition_data_get()
    
    In [11]: 2023-04-13 15:51:08,633 - INFO - COM6: PacketSend: {'token': 1}
    2023-04-13 15:51:08,654 - INFO - COM6: {event: MeshTxComplete, data: {'token': 1}}
    2023-04-13 15:51:09,267 - INFO - COM6.ConfigurationClient: Received composition data (page 0x00): {
      "cid": "0059",
      "pid": "0000",
      "vid": "0000",
      "crpl": 10,
      "features": {
        "relay": 0,
        "proxy": 0,
        "friend": 0,
        "low_power": 2
      },
      "elements": [
        {
          "index": 0,
          "location": "0001",
          "models": [
            {
              "modelId": "0000"
            },
            {
              "modelId": "0002"
            },
            {
              "modelId": "1100"
            },
            {
              "modelId": "1101"
            }
          ]
        }
      ]
    }
    In [11]:
    
    In [11]: cc.appkey_add(0)
    
    In [12]: 2023-04-13 15:51:14,601 - INFO - COM6: PacketSend: {'token': 2}
    2023-04-13 15:51:14,661 - INFO - COM6: {event: MeshTxComplete, data: {'token': 2}}
    2023-04-13 15:51:14,740 - INFO - COM6.ConfigurationClient: Appkey status: AccessStatus.SUCCESS
    2023-04-13 15:51:14,740 - INFO - COM6.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0010
    In [12]:
    
    In [12]: cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x1101))
    
    In [13]: 2023-04-13 15:51:27,709 - INFO - COM6: PacketSend: {'token': 3}
    2023-04-13 15:51:27,723 - INFO - COM6: {event: MeshTxComplete, data: {'token': 3}}
    2023-04-13 15:51:27,757 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.SUCCESS
    2023-04-13 15:51:27,757 - INFO - COM6.ConfigurationClient: Appkey bind 0 to model 1101 at 0010
    In [13]:
    
    In [13]: p.scan_start()
    
    2023-04-13 15:51:44,684 - INFO - COM6: Success
    In [14]: 2023-04-13 15:51:44,721 - INFO - COM6: Received UUID 3442243ef35a46a58bbddbc10ca5395a with RSSI: -65 dB
    In [14]: p.scan_stop()
    
    2023-04-13 15:51:50,034 - INFO - COM6: Success
    In [15]: p.provision(name="client")
    
    In [16]: 2023-04-13 15:52:01,670 - INFO - COM6: Provision: {'context': 0}
    2023-04-13 15:52:01,734 - INFO - COM6: Link established
    2023-04-13 15:52:01,873 - INFO - COM6: Received capabilities
    2023-04-13 15:52:01,873 - INFO - COM6: Number of elements: 1
    2023-04-13 15:52:01,875 - INFO - COM6: OobUse: {'context': 0}
    2023-04-13 15:52:04,203 - INFO - COM6: ECDH request received
    2023-04-13 15:52:04,208 - INFO - COM6: EcdhSecret: {'context': 0}
    2023-04-13 15:52:04,814 - INFO - COM6: Provisioning complete
    2023-04-13 15:52:04,814 - INFO - COM6:  Address(es): 0x11-0x11
    2023-04-13 15:52:04,814 - INFO - COM6:  Device key: REDACTED
    2023-04-13 15:52:04,814 - INFO - COM6:  Network key: REDACTED
    2023-04-13 15:52:04,820 - INFO - COM6: Adding device key to subnet 0
    2023-04-13 15:52:04,820 - INFO - COM6: Adding publication address of root element
    2023-04-13 15:52:04,823 - INFO - COM6: DevkeyAdd: {'devkey_handle': 9}
    2023-04-13 15:52:04,823 - INFO - COM6: AddrPublicationAdd: {'address_handle': 1}
    2023-04-13 15:52:04,986 - INFO - COM6: Provisioning link closed
    In [16]:
    
    In [16]: cc.publish_set(9, 1)
    
    In [17]: cc.composition_data_get()
    
    In [18]: 2023-04-13 15:52:20,886 - INFO - COM6: PacketSend: {'token': 4}
    2023-04-13 15:52:20,908 - INFO - COM6: {event: MeshTxComplete, data: {'token': 4}}
    2023-04-13 15:52:21,058 - INFO - COM6.ConfigurationClient: Received composition data (page 0x00): {
      "cid": "0059",
      "pid": "0000",
      "vid": "0000",
      "crpl": 10,
      "features": {
        "relay": 0,
        "proxy": 0,
        "friend": 0,
        "low_power": 2
      },
      "elements": [
        {
          "index": 0,
          "location": "0001",
          "models": [
            {
              "modelId": "0000"
            },
            {
              "modelId": "0002"
            },
            {
              "modelId": "1102"
            }
          ]
        }
      ]
    }
    In [18]:
    
    In [18]: cc.appkey_add(0)
    
    In [19]: 2023-04-13 15:52:26,776 - INFO - COM6: PacketSend: {'token': 5}
    2023-04-13 15:52:26,875 - INFO - COM6: {event: MeshTxComplete, data: {'token': 5}}
    2023-04-13 15:52:26,973 - INFO - COM6.ConfigurationClient: Appkey status: AccessStatus.SUCCESS
    2023-04-13 15:52:26,973 - INFO - COM6.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0011
    In [19]:
    
    In [19]: cc.model_app_bind(db.nodes[0].unicast_address + 1, 0, mt.ModelId(0x1102))
    
    In [20]: 2023-04-13 15:52:40,984 - INFO - COM6: PacketSend: {'token': 6}
    2023-04-13 15:52:41,004 - INFO - COM6: {event: MeshTxComplete, data: {'token': 6}}
    2023-04-13 15:52:41,051 - INFO - COM6.ConfigurationClient: Model app bind status: AccessStatus.SUCCESS
    2023-04-13 15:52:41,066 - INFO - COM6.ConfigurationClient: Appkey bind 0 to model 1102 at 0011
    In [20]:
    
    In [20]: cc.model_publication_set(db.nodes[0].unicast_address + 1, mt.ModelId(0x1102), mt.Publish(db.nodes[0].unicast_address, index=0, ttl=1))
    
    In [21]: 2023-04-13 15:53:44,054 - INFO - COM6: PacketSend: {'token': 7}
    2023-04-13 15:53:44,100 - INFO - COM6: {event: MeshTxComplete, data: {'token': 7}}
    2023-04-13 15:53:44,242 - INFO - COM6.ConfigurationClient: Model publication status: AccessStatus.SUCCESS
    2023-04-13 15:53:44,242 - INFO - COM6.ConfigurationClient: Publication status for model 1102 at element 17 to {'address': 0010, 'index': 0, 'ttl': 1, 'period': 0, 'retransmit': {'count': 0, 'interval_steps': 0, 'interval': 50}, 'credentials': <FriendshipCredentials.DISABLED: 0>}
    In [21]:
    
    In [21]: cc.publish_set(8, 0)
    
    In [22]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x1101), mt.Publish(db.groups[0].address, index=0, ttl=1))
    
    In [23]: 2023-04-13 15:54:23,177 - INFO - COM6: PacketSend: {'token': 8}
    2023-04-13 15:54:26,576 - INFO - COM6: {event: MeshTxComplete, data: {'token': 8}}
    In [23]:
    
    In [23]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x1101), mt.Publish(db.groups[0].address, index=0, ttl=1))
    
    In [24]: 2023-04-13 15:54:36,182 - INFO - COM6: PacketSend: {'token': 9}
    In [24]:
    
    In [24]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x1101), mt.Publish(db.groups[0].address, index=0, ttl=1))
    
    In [25]: 2023-04-13 15:55:37,658 - INFO - COM6: PacketSend: {'token': 10}
    In [25]:
    
    In [25]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x1101), mt.Publish(db.groups[0].address, index=0, ttl=1))
    
    In [26]: 2023-04-13 15:56:31,375 - INFO - COM6: PacketSend: {'token': 11}
    2023-04-13 15:56:36,100 - INFO - COM6: {event: MeshTxComplete, data: {'token': 11}}
    In [26]:
    
    In [26]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x1101), mt.Publish(db.groups[0].address, index=0, ttl=1))
    
    In [27]: 2023-04-13 15:58:05,989 - INFO - COM6: PacketSend: {'token': 12}
    2023-04-13 15:58:10,766 - INFO - COM6: {event: MeshTxComplete, data: {'token': 12}}
    In [27]:
    
    In [27]: cc.publish_set(9, 1)
    
    In [28]: cc.model_subscription_add(db.nodes[0].unicast_address + 1, db.groups[0].address, mt.ModelId(0x1102))
    
    In [29]: 2023-04-13 15:58:55,990 - INFO - COM6: PacketSend: {'token': 13}
    2023-04-13 15:58:56,020 - INFO - COM6: {event: MeshTxComplete, data: {'token': 13}}
    2023-04-13 15:58:56,036 - INFO - COM6.ConfigurationClient: Model subscription status: AccessStatus.SUCCESS
    2023-04-13 15:58:56,040 - INFO - COM6.ConfigurationClient: Added subscription 'c001' to model 1102 at element 0011
    In [29]:
    
    In [29]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x1101), mt.Publish(db.groups[0].address, index=0, ttl=1))
    
    In [30]: 2023-04-13 15:59:01,456 - INFO - COM6: PacketSend: {'token': 14}
    2023-04-13 15:59:01,513 - INFO - COM6: {event: MeshTxComplete, data: {'token': 14}}
    2023-04-13 15:59:01,655 - INFO - COM6.ConfigurationClient: Model publication status: AccessStatus.INVALID_ADDRESS
    In [30]:
    
    In [30]: cc.publish_set(8, 0)
    
    In [31]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x1101), mt.Publish(db.groups[0].address, index=0, ttl=1))
    
    In [32]: 2023-04-13 15:59:13,116 - INFO - COM6: PacketSend: {'token': 15}

    Regards

  • Hello Sai,

    Nothing obvious stands out from your PyACI log. Did you check if the group address is setup?

    Can you repeat your test with provisioning done by the nRF Mesh mobile app? If the result is the same, then the problem is not relevant to the PyACI script.

    Regards,

    Hieu

Reply Children
Related