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

  • Sure will be waiting for your reply

    {
      "$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": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 16
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 17
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 18
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 19
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 20
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 21
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 22
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "cid": "0059",
          "configComplete": false,
          "crpl": "000a",
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0001",
              "models": [
                {
                  "modelId": "0000"
                },
                {
                  "modelId": "0002"
                },
                {
                  "modelId": "1100"
                },
                {
                  "modelId": "1101"
                }
              ]
            }
          ],
          "features": {
            "friend": 0,
            "lowPower": 2,
            "proxy": 0,
            "relay": 0
          },
          "name": "Sensor Server",
          "netKeys": [
            0
          ],
          "pid": "0000",
          "security": "low",
          "unicastAddress": 23,
          "vid": "0000"
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "cid": "0059",
          "configComplete": false,
          "crpl": "000a",
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0001",
              "models": [
                {
                  "modelId": "0000"
                },
                {
                  "modelId": "0002"
                },
                {
                  "modelId": "1100"
                },
                {
                  "modelId": "1101"
                }
              ]
            }
          ],
          "features": {
            "friend": 0,
            "lowPower": 2,
            "proxy": 0,
            "relay": 0
          },
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "pid": "0000",
          "security": "low",
          "unicastAddress": 24,
          "vid": "0000"
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Light bulb",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 25
        },
        {
          "UUID": "f787347cfc2c47528878cb8303d3c8ad",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Sensor Server",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 26
        },
        {
          "UUID": "f787347cfc2c47528878cb8303d3c8ad",
          "appKeys": [
            0
          ],
          "cid": "0059",
          "configComplete": false,
          "crpl": "000a",
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0001",
              "models": [
                {
                  "modelId": "0000"
                },
                {
                  "modelId": "0002"
                },
                {
                  "modelId": "1102"
                }
              ]
            }
          ],
          "features": {
            "friend": 0,
            "lowPower": 2,
            "proxy": 0,
            "relay": 0
          },
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "pid": "0000",
          "security": "low",
          "unicastAddress": 27,
          "vid": "0000"
        },
        {
          "UUID": "0d49c695b0b444efb2b6396a4f4b8b10",
          "configComplete": false,
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0000"
            }
          ],
          "name": "Mesh Client",
          "netKeys": [
            0
          ],
          "security": "low",
          "unicastAddress": 28
        },
        {
          "UUID": "dbf4a7cc2c6448f1a40b5833d39ba70e",
          "appKeys": [
            0
          ],
          "cid": "0059",
          "configComplete": false,
          "crpl": "000a",
          "deviceKey": "REDACTED",
          "elements": [
            {
              "index": 0,
              "location": "0001",
              "models": [
                {
                  "modelId": "0000"
                },
                {
                  "modelId": "0002"
                },
                {
                  "modelId": "1100"
                },
                {
                  "modelId": "1101"
                }
              ]
            }
          ],
          "features": {
            "friend": 0,
            "lowPower": 2,
            "proxy": 0,
            "relay": 0
          },
          "name": "Mesh Sensor",
          "netKeys": [
            0
          ],
          "pid": "0000",
          "security": "low",
          "unicastAddress": 29,
          "vid": "0000"
        },
        {
          "UUID": "dbf4a7cc2c6448f1a40b5833d39ba70e",
          "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": "ServerExample",
          "netKeys": [
            0
          ],
          "pid": "0000",
          "security": "low",
          "unicastAddress": 30,
          "vid": "0000"
        }
      ],
      "provisioners": [
        {
          "UUID": "00000000000000000000000000000000",
          "allocatedGroupRange": [
            {
              "highAddress": 65279,
              "lowAddress": 49152
            }
          ],
          "allocatedUnicastRange": [
            {
              "highAddress": 32767,
              "lowAddress": 16
            }
          ],
          "name": "BT Mesh Provisioner"
        }
      ],
      "timestamp": "2023-03-13 10:51:31.547760"
    }

  • If you post the entire file, please remember to remove the app keys and the net keys as well. I have removed them again this time.

    I see multiple nodes in this database. Did you start from a fresh database? What does your database backup look like?

    This is the file in the nRF5 SDK for Mesh, unmodified. Your backup file should look like this.
    https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/scripts/interactive_pyaci/database/example_database.json.backup

  • sorry didn't realise i had a reply.This is the fresh data base i deleted the database file and added new one and started provisioning.I will download a new file again from internet and will check again. Also backup file looks like this: 

    {
      "$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": [
      ],
      "provisioners": [
        {
          "UUID": "00000000000000000000000000000000",
          "allocatedGroupRange": [
            {
              "highAddress": 65279,
              "lowAddress": 49152
            }
          ],
          "allocatedUnicastRange": [
            {
              "highAddress": 32767,
              "lowAddress": 16
            }
          ],
          "name": "BT Mesh Provisioner"
        }
      ],
      "timestamp": "2018-03-08 21:59:17.239719"
    }
    

  • That backup file looks OK as far as the node database go (it's empty).

    If you don't feel certain about the file, feel free to download a copy either from the GitHub link I used or the nRF5 SDK for Mesh product website.

  • Thank You so much, Its working now i installed from the website you attached and started the first provisioning with 0. So each time i provision should i copy the new database files?

Related