<?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>Best method to determine a mesh node is able to communicate with other node</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61593/best-method-to-determine-a-mesh-node-is-able-to-communicate-with-other-node</link><description>Hi teams, 
 I am finding a way to check whether a mesh node is currently able to communicate with other node. 
 We are planning to deploy many mesh nodes to proper position where each nodes can successfully communicate with each other. 
 Each nodes will</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Aug 2020 15:04:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61593/best-method-to-determine-a-mesh-node-is-able-to-communicate-with-other-node" /><item><title>RE: Best method to determine a mesh node is able to communicate with other node</title><link>https://devzone.nordicsemi.com/thread/263282?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2020 15:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83603541-2cff-44d6-8200-520b3459f948</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply. Most of our staff have been away on holiday and I just got back from vacation, hence the delay in response.&lt;/p&gt;
&lt;p&gt;From our developer regarding this:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This will not work all the time. First, it is not advisable to modify core stack modules. Secondly, even if customer implements this idea, he will still miss the checking of online status if the node receives a packet, but the packet does not reach the access layer (for example, friendship packets, or packets that are only relayed but not consumed).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The better idea to check if the node is receiving any packet or not, is to use &amp;quot;internal_event.c&amp;quot; module, and observe the &amp;quot;INTERNAL_EVENT_NET_PACKET_RECEIVED&amp;quot;. To use this module, set `INTERNAL_EVT_ENABLE` to `1` in the `nrf_mesh_config_app.h` file, and call `internal_event_init()` API from the `main.c` file.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best method to determine a mesh node is able to communicate with other node</title><link>https://devzone.nordicsemi.com/thread/259332?ContentTypeID=1</link><pubDate>Fri, 10 Jul 2020 06:24:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ad7d4ab-4f66-408f-b7be-7351279a2fce</guid><dc:creator>choehyunho</dc:creator><description>&lt;p&gt;I have added simple public API function to check online status from application side like below.&lt;/p&gt;
&lt;p&gt;I assumed that if the message is arrived in access_incoming_handle(), it means that this node is on-line, i.e. can receive or send to other nodes.&lt;/p&gt;
&lt;p&gt;Can you check whether my assumption is valid?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;Index: /trunk/nRF5_SDK_for_Mesh/mesh/access/src/access.c
===================================================================
--- /trunk/nRF5_SDK_for_Mesh/mesh/access/src/access.c	(revision 113)
+++ /trunk/nRF5_SDK_for_Mesh/mesh/access/src/access.c	(revision 114)
@@ -72,4 +72,5 @@
     uint8_t is_load_failed : 1;
     uint8_t is_restoring_ended : 1;
+    uint8_t is_online : 1;
 } local_access_status_t;
 
@@ -953,4 +954,5 @@
     m_status.is_metadata_stored = 0;
     m_status.is_load_failed = 0;
+    m_status.is_online = 0;
 
     mesh_config_file_clear(MESH_OPT_ACCESS_FILE_ID);
@@ -1008,4 +1010,7 @@
 {
     const nrf_mesh_address_t * p_dst = &amp;amp;p_message-&amp;gt;meta_data.dst;
+
+    /* If there is a incoming message whether it is for relay or not, it means onlined. */
+    m_status.is_online = 1;
 
     if (nrf_mesh_is_address_rx(p_dst))
@@ -1091,4 +1096,5 @@
     m_status.is_load_failed = 0;
     m_status.is_restoring_ended = 0;
+    m_status.is_online = 0;
 }
 
@@ -1986,2 +1992,12 @@
     return NRF_SUCCESS;
 }
+
+bool nrf_mesh_is_device_online(void)
+{
+    if (nrf_mesh_is_device_provisioned() &amp;amp;&amp;amp; m_status.is_online)
+    {
+        m_status.is_online = 0;
+        return true;
+    }
+    return false;
+}
Index: /trunk/nRF5_SDK_for_Mesh/mesh/core/api/nrf_mesh_externs.h
===================================================================
--- /trunk/nRF5_SDK_for_Mesh/mesh/core/api/nrf_mesh_externs.h	(revision 113)
+++ /trunk/nRF5_SDK_for_Mesh/mesh/core/api/nrf_mesh_externs.h	(revision 114)
@@ -226,4 +226,14 @@
 extern bool nrf_mesh_is_device_provisioned(void);
 
+/**
+ * Checks if the device is online.
+ *
+ * @note The result is reset every time after it was read.
+ *
+ * @retval true   The device is online.
+ * @retval false  The device is not online.
+ */
+extern bool nrf_mesh_is_device_online(void);
+
 /** @} end of NRF_MESH_EXTERNS */
 
Index: /trunk/nRF5_SDK_for_Mesh/mesh/stack/api/mesh_stack.h
===================================================================
--- /trunk/nRF5_SDK_for_Mesh/mesh/stack/api/mesh_stack.h	(revision 113)
+++ /trunk/nRF5_SDK_for_Mesh/mesh/stack/api/mesh_stack.h	(revision 114)
@@ -214,4 +214,14 @@
 
 /**
+ * Check if the device is online.
+ *
+ * @note The result is reset every time after it was read.
+ *
+ * @retval true   The device is online.
+ * @retval false  The device is not online.
+ */
+bool mesh_stack_is_device_online(void);
+
+/**
  * Resets the device.
  *
Index: /trunk/nRF5_SDK_for_Mesh/mesh/stack/src/mesh_stack.c
===================================================================
--- /trunk/nRF5_SDK_for_Mesh/mesh/stack/src/mesh_stack.c	(revision 113)
+++ /trunk/nRF5_SDK_for_Mesh/mesh/stack/src/mesh_stack.c	(revision 114)
@@ -214,4 +214,9 @@
 }
 
+bool mesh_stack_is_device_online(void)
+{
+    return nrf_mesh_is_device_online();
+}
+
 #if PERSISTENT_STORAGE
 static void mesh_evt_handler(const nrf_mesh_evt_t * p_evt)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best method to determine a mesh node is able to communicate with other node</title><link>https://devzone.nordicsemi.com/thread/256244?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2020 14:32:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0779a3d1-18c7-477b-a53f-5283d4c5fcd1</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;The health server attention callback has a very specific function. This callback is triggered after receiving a Health Server Attention Set message. So, you may, for example, blink an LED in this callback after receiving a message. This way&amp;nbsp;you can get a visual indication that there is a connectivity between two nodes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best method to determine a mesh node is able to communicate with other node</title><link>https://devzone.nordicsemi.com/thread/254894?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 07:46:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3e90f88-1b5c-4ca9-b6e8-946d41d9fb97</guid><dc:creator>choehyunho</dc:creator><description>&lt;p&gt;Hi, Mttrinh.&lt;/p&gt;
&lt;p&gt;Thank you for your answer. I was quite dedicated to another task and still haven&amp;#39;t enough time to this subject.&lt;/p&gt;
&lt;p&gt;But, while reviewing some features in the Mesh SDK, I think Mesh health server/client&amp;nbsp;model can be useful for this purpose.&lt;/p&gt;
&lt;p&gt;Is it possible that I assign health_server_attention_cb in my main procedure and get some information about this node is linked with other nodes or not?&lt;/p&gt;
&lt;p&gt;Because I just wonder about the whole node status, not the specific model, this may be better for my purpose.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best method to determine a mesh node is able to communicate with other node</title><link>https://devzone.nordicsemi.com/thread/252656?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 09:11:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8b26b6f-ca20-4c97-b2f1-37ae7b14b279</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the late response.&lt;/p&gt;
&lt;p&gt;I would suggest making use of the available mechanisms. I see two ways to implement this:&lt;/p&gt;
&lt;p&gt;Method 1:&lt;br /&gt;For desired received model messages, you can intercept the &amp;quot;access_message_rx_meta_t&amp;quot; data which contains the RSSI value, and use this value to drive LEDs as per your choice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is bit hacky and it will require intercepting this information either in `app_*.c` modules, or in `access.c` module in `access_incoming_handle()` function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Method 2:&lt;br /&gt;This is more elaborate but more powerful. You&amp;nbsp;can implement and make use of the RSSI monitor models in the combination of health server and client models (that can publish health status messages periodically). The RSSI models are described here:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v4.1.0/md_models_vendor_rssi_monitor_README.html?cp=7_2_2_4_5_2" rel="nofollow"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v4.1.0/md_models_vendor_rssi_monitor_README.html?cp=7_2_2_4_5_2&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>