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

Reply
  • 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

Children
  • 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

  • Hi,

    You need to understand the content of the file. The file gives you all the information about your mesh network in a JSON format.

    If you go into the "nodes" property, you can see an array containing the information of all nodes in your network. I know you are trying to connect to a device running the Sensor Server example, but you can see there are multiple of them.
    I recommend you rename the device in the example code, and flash it. Then it would stand out in your database, and you can find its index in the "nodes" array and replace it into the db.nodes[index] part of the failing command.

    An alternative is to restart the network with a fresh database file and repeat the test from the beginning. You will still need to know the index of your node. But if it is the first node you have ever added to the new mesh, its index would be 0.

    I made a mistake requesting the content of the file. I forgot that it also includes all the keys that encrypt your network. Posting the content here destroy the security of your mesh. Once you have figure out and understand how things work, please recreate the keys. The simplest method is to reset the network and begin again with a fresh new database.json file, please restore it by making a copy of example_database.json.backup and rename it.
    I have now removed all keys from your reply. But it is still the best practice for you to reset the network or replace the keys.

    My sincere apologies for that inconvenience.

    Regards,

    Hieu

  • Hello Hieu

    I also did not think of security keys. anyways since u have seen my content i will remove that even though u changed it. Thank You for noticing and reacting immediately. I will delete the file and make new one and follow the steps as you said and will let you know.

    Thank You once again

  • If you go into the "nodes" property, you can see an array containing the information of all nodes in your network. I know you are trying to connect to a device running the Sensor Server example, but you can see there are multiple of them.
    I recommend you rename the device in the example code, and flash it. Then it would stand out in your database, and you can find its index in the "nodes" array and replace it into the db.nodes[index] part of the failing command.

    I checked with this solution and

    An alternative is to restart the network with a fresh database file and repeat the test from the beginning. You will still need to know the index of your node. But if it is the first node you have ever added to the new mesh, its index would be 0.

    This solution and still gets same error

  • Can you get me just the "nodes" section of your current database.json file?

    Please remember to remove all Device Keys. With NotePad++ I often do it quickly by replacing "device.*key.*\r\n" with "REDACTED."

    This week I am fully occupied Monday and Tuesday with non-DevZone tasks. Please understand if my follow-up will be delayed.

Related