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

adding second element to a light control server node mesh example

Hi, I'm trying to add another element with a simple onoff model to control a second LED on the same server node. I get APP_ERROR. I try declaring m_server0, m_server1, generic_get0_cb, generic_get1_cb, etc.. but in that way I would have to call simple_on_off_server_init(&m_server0, 0) and simple_on_off_server_init(&m_server1, 1) in configuration_setup(), but in header function of simple_on_off_server_init its written we should only call it once. What am I missing to add another element with the same simple on off model into it. thanks a lot. Also changed ACCESS_ELEMENT_COUNT

Parents
  • It was in ERROR_CHECK(access_model_subscription_list_alloc(m_server1.model_handle)); on the second call of this function because I declare two m_serverX, one per element. That was because my ACCESS_MODEL_COUNT was set to 2 (one config model and one simple_on_off) instead of 3 (1 config and 2 simple_on_off), I don't have this error anymore, I got provisioning message on RTT, so.. Now I still have to check on client's code side to map button function to control the second LED on this the server. But as I wrote above, I still not sure about my server code, I'm not sure I really have 2 elements with a simple_on_off_model in each. I'm working on this today. If you have any suggestion or advice to help me solve this I would really appreciate this. I'm trying with 1 client(switchs) and 1 server(2 leds).Thanks to follow my case, I really appreciate it, my first experience with Nordic devices and Bluetooth Mesh.

Reply
  • It was in ERROR_CHECK(access_model_subscription_list_alloc(m_server1.model_handle)); on the second call of this function because I declare two m_serverX, one per element. That was because my ACCESS_MODEL_COUNT was set to 2 (one config model and one simple_on_off) instead of 3 (1 config and 2 simple_on_off), I don't have this error anymore, I got provisioning message on RTT, so.. Now I still have to check on client's code side to map button function to control the second LED on this the server. But as I wrote above, I still not sure about my server code, I'm not sure I really have 2 elements with a simple_on_off_model in each. I'm working on this today. If you have any suggestion or advice to help me solve this I would really appreciate this. I'm trying with 1 client(switchs) and 1 server(2 leds).Thanks to follow my case, I really appreciate it, my first experience with Nordic devices and Bluetooth Mesh.

Children
No Data
Related