<?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>Duplicate messages received by mesh server</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40218/duplicate-messages-received-by-mesh-server</link><description>Hello, 
 I am developing an application in which mesh client in some cases needs to send consecutive messages to the mesh server. I use a modified version of Simple On/Off model and reliable transfers. 
 The problem is that client tries to send second</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Nov 2018 21:13:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40218/duplicate-messages-received-by-mesh-server" /><item><title>RE: Duplicate messages received by mesh server</title><link>https://devzone.nordicsemi.com/thread/156964?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 21:13:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d00e0336-2b81-475b-8f15-ed90748f63ab</guid><dc:creator>CodeLoader</dc:creator><description>&lt;p&gt;Thanks a lot! Even though I think server responds in less than 2 seconds, this value is still too small for the needed application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Duplicate messages received by mesh server</title><link>https://devzone.nordicsemi.com/thread/156897?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 13:47:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baa01e97-95ac-49bc-b88e-36191764f380</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;As you can see in the code snippet belo, the add_reliable_message() function will reschedule an event if a timeout occurs:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void add_reliable_message(uint16_t index, const access_reliable_t * p_message)
{
    NRF_MESH_ASSERT(!m_reliable.pool[index].in_use);
    uint32_t time_now = timer_now();
    memcpy(&amp;amp;(m_reliable.pool[index].params), p_message, sizeof(access_reliable_t));
    m_reliable.pool[index].interval = calculate_interval(p_message);
    m_reliable.pool[index].params.timeout += time_now;
    m_reliable.pool[index].next_timeout = time_now + m_reliable.pool[index].interval;

    bearer_event_critical_section_begin();
    if (is_earliest_timeout(index))
    {
        timer_sch_reschedule(&amp;amp;m_reliable.timer, m_reliable.pool[index].next_timeout);
        m_reliable.next_timeout_index = index;
    }
    m_reliable.pool[index].in_use = true;
    m_reliable.active_count++;
    bearer_event_critical_section_end();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If the server takes a bit too long time to respond with a status message, the client may have reached the timeout &amp;amp; sent another set message.&lt;/p&gt;
&lt;p&gt;You could try changing the min timeout value for an reliable message in the access layer (see access_reliable.h):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * Minimum timeout for a reliable message in microseconds.
 * @note Mesh Profile Specification v1.0 recommends this to be minimum 60s.
 */
#define ACCESS_RELIABLE_TIMEOUT_MIN  (SEC_TO_US(2))

/** Maximum timeout for a reliable message in microseconds. */
#define ACCESS_RELIABLE_TIMEOUT_MAX  (SEC_TO_US(60))&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It seems the min timeout value used to be 30 seconds in an &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v2.0.0%2Fgroup__ACCESS__RELIABLE__DEFINES.html"&gt;older mesh sdk version&lt;/a&gt;, but I would test out a few values &amp;amp; see if this solves your issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Duplicate messages received by mesh server</title><link>https://devzone.nordicsemi.com/thread/156342?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 14:33:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7001df01-8744-4154-a4aa-7c6a74b6fc8c</guid><dc:creator>CodeLoader</dc:creator><description>&lt;p&gt;I am using Mesh SDK v2.2.0&lt;/p&gt;
&lt;p&gt;I put a log into&amp;nbsp;packet_tx function, which is called by&amp;nbsp;access_model_publish, and I could see that sometimes client transmits the message 2 times almost immediately one after another, before receiving the status from the server&lt;/p&gt;
&lt;p&gt;And server replies to both of these messages&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Duplicate messages received by mesh server</title><link>https://devzone.nordicsemi.com/thread/156305?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 12:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bee712a-5813-45a0-86b5-a338b2c175ac</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Which Mesh SDK version are you currently using? v2.0.1?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>