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

[bluetooth mesh] Pb Remote combine light switch control

Hello,

I am merging the pb remote with light control example. Both ran fine when I tested separately. Then I began to merge the two. The server is fine when I merge the two (remote provisioning is ok, but I haven't tested the light control) but I am facing 2 problems in the client and they are both in access_setup(). Error 7 and error 4. I will show there positions in the code comment, I know the cause of error 4 but error is not. Here is the code where the errors occur: error.c

Thank you

Parents
  • Hi Duy,

    Again, when you see a error and find where it occurs, you can set a break point at the line that cause the error and step in to the code (use the assembly stepping on the left hand side) . For example the line cause error code 4 (NO_MEM) you step into that you can find that it was caused by access_model_add() and inside that more likely the call to find_available_model() returned (ACCESS_HANDLE_INVALID == *p_model_handle) and then return NO_MEM. And if you step into find_available_model() you can find that it was because there isn't any access model slot yet to allocate. Then it comes to ACCESS_MODEL_COUNT define, if you add more client, server you need to increase this to match with the number of model on your device.

    Error code 7 is NRF_ERROR_INVALID_PARAM (check nrf_error.h), and you can find that inside access_model_publish_address_set() there is a check if (DSM_ADDR_MAX <= address_handle) most likely the address_handle is over the DSM_ADDR_MAX.

Reply
  • Hi Duy,

    Again, when you see a error and find where it occurs, you can set a break point at the line that cause the error and step in to the code (use the assembly stepping on the left hand side) . For example the line cause error code 4 (NO_MEM) you step into that you can find that it was caused by access_model_add() and inside that more likely the call to find_available_model() returned (ACCESS_HANDLE_INVALID == *p_model_handle) and then return NO_MEM. And if you step into find_available_model() you can find that it was because there isn't any access model slot yet to allocate. Then it comes to ACCESS_MODEL_COUNT define, if you add more client, server you need to increase this to match with the number of model on your device.

    Error code 7 is NRF_ERROR_INVALID_PARAM (check nrf_error.h), and you can find that inside access_model_publish_address_set() there is a check if (DSM_ADDR_MAX <= address_handle) most likely the address_handle is over the DSM_ADDR_MAX.

Children
No Data
Related