<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Turn on client LED with another&amp;#39;s client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44512/turn-on-client-led-with-another-s-client-signal-in-mesh-network</link><description>Hello to everyone. 
 I&amp;#180;m working with the Light_switch examples (server-client-provisioner) in BLE Mesh 3.10 for nRF52 DK PCA10040. I&amp;#180;m trying to make a network with 2 clients and 2 servers. Obviously, both clients can send a message to servers and I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 30 Mar 2019 00:14:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44512/turn-on-client-led-with-another-s-client-signal-in-mesh-network" /><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/179315?ContentTypeID=1</link><pubDate>Sat, 30 Mar 2019 00:14:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80205874-9bf5-4315-a592-0708b858df46</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;Thank you, I&amp;#39;ll try it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/179247?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 13:18:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:073e1fa6-0809-4a3a-b33e-11b401d2fd7e</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;You can find the&amp;nbsp;ACCESS_MODEL_COUNT and&amp;nbsp;ACCESS_ELEMENT_COUNT in nrf_mesh_config_app.h(found in light switch/client/inlcude).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/179072?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 20:34:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a31e0a76-580e-4cc6-a71f-efbd62441c7f</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;Where can I increment those counts?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/178946?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 13:31:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7241b9de-6f17-4c17-89a3-c7689492ceb0</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Have you increased the element count and the model count?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/178195?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2019 19:17:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6caa2ef-ea33-4d8f-a180-bdb28dc9a1d8</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/54268004_5F00_342826669773539_5F00_2775383028879327232_5F00_n.png" /&gt;&lt;/p&gt;
&lt;p&gt;Sorry for not answering before.&lt;br /&gt;The image shows all the elements that the Client has in the App.&lt;br /&gt;Are the same elements that has in a &amp;quot;normal&amp;quot; client code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/177609?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 14:10:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51c0e085-4d42-4bbc-a0b3-7fe9d2dc8f4b</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Do the server model show up in nRF Mesh app?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/177134?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 15:45:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82672172-7767-4b38-bda5-f7072b87ea07</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;There&amp;acute;s no error codes and the client example is working normally.&lt;br /&gt;It&amp;#39;s like the server code wasn&amp;#39;t there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/176708?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2019 12:56:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44f5f55e-2d9c-4ad3-a47e-2c8a8d6d68f6</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Can you give me more details on what is not working? Do you get any error codes?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/175486?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 20:28:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b40d2db-46d9-4b30-8e44-2c9050cf4b58</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*****CLIENT*****/

#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

/* HAL */
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;simple_hal.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;

/* Core */
#include &amp;quot;nrf_mesh_config_core.h&amp;quot;
#include &amp;quot;nrf_mesh_gatt.h&amp;quot;
#include &amp;quot;nrf_mesh_configure.h&amp;quot;
#include &amp;quot;nrf_mesh.h&amp;quot;
#include &amp;quot;mesh_stack.h&amp;quot;
#include &amp;quot;device_state_manager.h&amp;quot;
#include &amp;quot;access_config.h&amp;quot;

/* Provisioning and configuration */
#include &amp;quot;mesh_provisionee.h&amp;quot;
#include &amp;quot;mesh_app_utils.h&amp;quot;

/* Models */
#include &amp;quot;generic_onoff_client.h&amp;quot;

/* Logging and RTT */
#include &amp;quot;log.h&amp;quot;
#include &amp;quot;rtt_input.h&amp;quot;

/* Example specific includes */
#include &amp;quot;app_config.h&amp;quot;
#include &amp;quot;nrf_mesh_config_examples.h&amp;quot;
#include &amp;quot;light_switch_example_common.h&amp;quot;
#include &amp;quot;example_common.h&amp;quot;
#include &amp;quot;ble_softdevice_support.h&amp;quot;

#define APP_STATE_OFF                (0)
#define APP_STATE_ON                 (1)

#define APP_UNACK_MSG_REPEAT_COUNT   (2)

static generic_onoff_client_t m_clients[CLIENT_MODEL_INSTANCE_COUNT];
static bool                   m_device_provisioned;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hello Mttrinh, thank you for answer.&lt;br /&gt;Actually, in the main.c code, looks like the one above. I&amp;#39;ve done some chenges in the code, adding libraries, the generic_onoff_server model and another stuff:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*****CLIENT*****/

#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

/* HAL */
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;simple_hal.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;

/* Core */
#include &amp;quot;nrf_mesh_config_core.h&amp;quot;
#include &amp;quot;nrf_mesh_gatt.h&amp;quot;
#include &amp;quot;nrf_mesh_configure.h&amp;quot;
#include &amp;quot;nrf_mesh.h&amp;quot;
#include &amp;quot;mesh_stack.h&amp;quot;
#include &amp;quot;device_state_manager.h&amp;quot;
#include &amp;quot;access_config.h&amp;quot;
#include &amp;quot;proxy.h&amp;quot;

/* Provisioning and configuration */
#include &amp;quot;mesh_provisionee.h&amp;quot;
#include &amp;quot;mesh_app_utils.h&amp;quot;

/* Models */
#include &amp;quot;generic_onoff_client.h&amp;quot;
#include &amp;quot;generic_onoff_server.h&amp;quot;

/* Logging and RTT */
#include &amp;quot;log.h&amp;quot;
#include &amp;quot;rtt_input.h&amp;quot;

/* Example specific includes */
#include &amp;quot;app_config.h&amp;quot;
#include &amp;quot;example_common.h&amp;quot;
#include &amp;quot;nrf_mesh_config_examples.h&amp;quot;
#include &amp;quot;light_switch_example_common.h&amp;quot;
#include &amp;quot;app_onoff.h&amp;quot;
#include &amp;quot;ble_softdevice_support.h&amp;quot;

#define APP_STATE_OFF                (0)
#define APP_STATE_ON                 (1)
#define ONOFF_SERVER_0_LED           (BSP_LED_0) //***********************
#define APP_ONOFF_ELEMENT_INDEX      (0)         //***********************

#define APP_UNACK_MSG_REPEAT_COUNT   (2)

static generic_onoff_client_t m_clients[CLIENT_MODEL_INSTANCE_COUNT];
static bool                   m_device_provisioned;

//SERVER FUNCTION
/*************************************************************************************************/
/*************************************************************************************************/
/*************************************************************************************************/
static void app_onoff_server_set_cb(const app_onoff_server_t * p_server, bool onoff);
static void app_onoff_server_get_cb(const app_onoff_server_t * p_server, bool * p_present_onoff);

/* Generic OnOff server structure definition and initialization */
APP_ONOFF_SERVER_DEF(m_onoff_server_0,
                     APP_CONFIG_FORCE_SEGMENTATION,
                     APP_CONFIG_MIC_SIZE,
                     app_onoff_server_set_cb,
                     app_onoff_server_get_cb)
/*************************************************************************************************/
/*************************************************************************************************/
/*************************************************************************************************/&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, I copy-paste this part of the server code to the client:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//SERVER FUNCTION
/*************************************************************************************************/
/*************************************************************************************************/
/*************************************************************************************************/
/* Callback for updating the hardware state */
static void app_onoff_server_set_cb(const app_onoff_server_t * p_server, bool onoff)
{
    /* Resolve the server instance here if required, this example uses only 1 instance. */

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Setting GPIO value: %d\n&amp;quot;, onoff)

    hal_led_pin_set(ONOFF_SERVER_0_LED, onoff);
}

/* Callback for reading the hardware state */
static void app_onoff_server_get_cb(const app_onoff_server_t * p_server, bool * p_present_onoff)
{
    /* Resolve the server instance here if required, this example uses only 1 instance. */

    *p_present_onoff = hal_led_pin_get(ONOFF_SERVER_0_LED);
}

static void app_model_init(void)
{
    /* Instantiate onoff server on element index APP_ONOFF_ELEMENT_INDEX */
    ERROR_CHECK(app_onoff_init(&amp;amp;m_onoff_server_0, APP_ONOFF_ELEMENT_INDEX));
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;App OnOff Model Handle: %d\n&amp;quot;, m_onoff_server_0.server.model_handle);
}
/*************************************************************************************************/
/*************************************************************************************************/
/*************************************************************************************************/&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But I can&amp;#39;t make it work.&lt;br /&gt;Any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/175423?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 15:14:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80c1c3c0-465c-4ac1-8381-ccf3737df1ef</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, you should be able to do this. Additional to the code that makes the server turn on the LED, you need to add a Generic OnOoff Server model to the client example.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on client LED with another's client signal in Mesh Network</title><link>https://devzone.nordicsemi.com/thread/175199?ContentTypeID=1</link><pubDate>Sun, 10 Mar 2019 02:10:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68f5990f-0fba-4351-bb4e-8875d36c71b5</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;Any suggestions? please...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>