This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Configuration Problem

Hi.

I have been trying to implement my own Model into the Light Switch Example  (Mesh SDK 4.2, SD s140 7.0.1, Hardware: nrf52840 DK), according to this Thread: 

Adding Simple OnOff Model to Generic OnOff Server Example - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com) .

I want to use the Provisioner Example instead of the Mobile App for Provisioning, so I made Changes in the Provisioner Example by adding additional Code to the following files:

  • node_setup.c
  • config_scenarios.h
  • config_steps.h

I tried it out with my Server Model. Provisioning works fine but when it comes to the Configuration Process, i get the opcode status field : 13  Error, which according to the Information in access_status.h means: "The requested bind operation cannot be performed due to general constraints."

My guess is that i, for whatever reason, can't bind my own server model instance and the health server model Instance to the same element. Since it is kind of a "Standard" Error, i hope someone here can help me to get to the bottom of this. 

Best regards.

  • Hi,

    I only found one place in the stack code returning ACCESS_STATUS_CANNOT_BIND, and that is in config_server.c on lines 2518 to 2524. From that it looks like you are either trying to bind the config model itself, or your vendor model is using the config model id instead of a custom vendor model id.

    Regards,
    Terje

  • Hi, thx for the quick Reply.

    The client model id is 0x0000, i understand that i cannot use this value as an id for my server model. I tried it with different id values ( 0x1000, 0xB000) but i still get the same Error. 

    I initialize my server on an Element Index of the Generic OnOff Model, along with commenting out the initialization of the Generic OnOff Model, so maybe there is something wrong with that:

    static void models_init_cb(void)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Initializing and adding models\n");
        //app_model_init();
          ERROR_CHECK(modelname_server_init(&my_modelname_server_0, APP_ONOFF_ELEMENT_INDEX)); //NOTE Added
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "My Modelname Model Handle: %d\n", my_modelname_server_0.model_handle);
    }
    // My Server Init Function
    
    uint32_t modelname_server_init(modelname_server_t * p_server, uint16_t element_index)
    {
        if (p_server == NULL ||
            p_server->get_cb == NULL ||
            p_server->set_cb == NULL)
        {
            return NRF_ERROR_NULL;
        }
    
        access_model_add_params_t init_params;
        init_params.element_index =  element_index;
        init_params.model_id.model_id = MODELNAME_SERVER_MODEL_ID;
        init_params.model_id.company_id = MODELNAME_COMPANY_ID; // = COMPANY_ID_NORDIC
        init_params.p_opcode_handlers = &m_opcode_handlers[0];
        init_params.opcode_count = sizeof(m_opcode_handlers) / sizeof(m_opcode_handlers[0]);
        init_params.p_args = p_server;
        init_params.publish_timeout_cb = handle_publish_timeout;
        return access_model_add(&init_params, &p_server->model_handle);
    }

  • Hi,

    Terje is out of office, have you solved your problem? 

    Best regards,
    Kaja

  • Hi Kaja,

    Sadly not yet, because i really dont get what I'm doing wrong.

    So a solution and/or some general advice on how to add a custom model to the Light Switch Example (Mesh SDK 5.0 or Mesh SDK 4.2 is both fine) would help me a lot.

    Thanks in advance for your Time.

    Best regards.   

  • Hi, 

    I'm taking over the case because Terje is away.

    I would suggest to try provisioning it with a phone (enabling PB-GATT), just to get to know if the model is initialize properly. 
    You can also think of using the PyACI to do provisioning. It's more flexible and easier to get to know if something is wrong using these universal provisioners (phone or PyACI). 

    Also, please try testing with only adding the custom model in (please try adding the Simple OnOff model in \models\vendor\simple_on_off ) without removing the Generic OnOff. 

Related