<?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>Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44683/client-2-3-cannot-send-error-yet-message-is-sent</link><description>Hi, 
 I have modified the light switch demo so that all messages from the client are sent to all servers. I have done this by subscribing all servers to GROUP_ADDRESS_ODD in node_setup.c . Now when I send using button 2/3 (unacked) I get the message Client</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Mar 2019 16:40:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44683/client-2-3-cannot-send-error-yet-message-is-sent" /><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/176284?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 16:40:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f7fc6be-f9bc-449b-bedd-549c363b2fa6</guid><dc:creator>jonappleseed</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/176276?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 16:10:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2af7fc1b-6437-4f6e-84e3-48d765e3668d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jon,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think I know what could be wrong here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As I mentioned, by spec you should not have 2 segmented messages being sent at the same time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This mean repeat should not be set to something but 0. If you have repeats it will call&amp;nbsp;access_model_publish() multiple times and causing the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you do want to repeat your unacknowledged message for redundancy, you can do it with your own code and retry if you see error&amp;nbsp;&lt;span&gt;NRF_ERROR_INVALID_STATE until you can successfully queue the message.&amp;nbsp;&lt;/span&gt;&lt;span&gt;It shouldn&amp;#39;t take too long to send a segmented message or instaburst.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/176126?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 10:06:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91c4ed66-be8f-4855-a4e4-accf6ba3a3a9</guid><dc:creator>jonappleseed</dc:creator><description>&lt;p&gt;Hi, I know the error is originating from the following (in transport.c - segmented_packet_tx()):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;for (uint32_t i = 0; i &amp;lt; TRANSPORT_SAR_SESSIONS_MAX; ++i)
    {
        if (m_trs_sar_sessions[i].session.session_type == TRS_SAR_SESSION_TX &amp;amp;&amp;amp;
            m_trs_sar_sessions[i].metadata.net.src == p_metadata-&amp;gt;net.src &amp;amp;&amp;amp;
            m_trs_sar_sessions[i].metadata.net.dst.value == p_metadata-&amp;gt;net.dst.value)
        {
            return NRF_ERROR_INVALID_STATE;
        }
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My prediction is that there is an overlap between the previous and current sending caused by the packets being larger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175850?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 09:30:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4401ad95-7058-4add-a196-06f03d986a53</guid><dc:creator>jonappleseed</dc:creator><description>&lt;p&gt;When increasing the number of bytes so that it uses Instaburst, I have found that calling&amp;nbsp;generic_onoff_client_set_unack() with # repeats set to 0, removes this error. However, this is not ideal either.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175736?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 15:37:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ebfe0e6-e547-47e8-8803-c36154fbb3d3</guid><dc:creator>jonappleseed</dc:creator><description>&lt;p&gt;Reducing the # bytes to 3 has removed the error. Changing &lt;span&gt;HAL_BUTTON_PRESS_FREQUENCY&lt;/span&gt; had no effect (I am using RTT to for button presses). However, I would like to test the diffrerence between Instaburst and non-Instaburst. At 3 bytes no messages will be sent with Instaburst.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175563?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 09:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a981b883-7f92-44cc-87a9-df1578fd8ecf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have a look at the code you can find that on Button 0 and 1 we cancel the previous reliable message before doing the next when on Button 2 and 3 we dont.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As I mentioned only one segmented message at a time. On button 2 and 3 if you press and hold the button for more than 400ms (which I assume you do) the stack will try to send the unreliable segmented again and will receive a &lt;span&gt;NRF_ERROR_INVALID_STATE because the last one has not been finished.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My suggestion is to try changing the&amp;nbsp;HAL_BUTTON_PRESS_FREQUENCY time (button debouncing) to say 1 second and check if you still have the issue.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How big is your data ? have you tried to test with sending one single byte ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175462?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 17:04:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89399360-fdf9-4a22-a4cc-23b7789ed443</guid><dc:creator>jonappleseed</dc:creator><description>&lt;p&gt;The problem is actually caused in packet_alloc_and_tx() in access.c (~line 462). In the case of buttons 2/3 the if statement is true, causing the status to be returned as &lt;span&gt;NRF_ERROR_INVALID_STATE&lt;/span&gt; rather than &lt;span&gt;NRF_SUCCESS as in the case of buttons 0 and 1.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175460?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 16:49:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41b94eda-941c-4097-b4c9-0964b48409fb</guid><dc:creator>jonappleseed</dc:creator><description>&lt;p&gt;I found that it&amp;#39;s being set for any clients/buttons at that line.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175456?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 16:28:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a75cb9ac-8847-47a4-8524-d7470bf3ca05</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, segmented messages can only be sent one by one.You can&amp;#39;t have 2 segmented messages sending at the same time.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175446?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 16:03:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0903a25b-11f4-4855-9707-b3be91201960</guid><dc:creator>jonappleseed</dc:creator><description>&lt;p&gt;Ok, so it is being set in segmented_packet_tx() in transport.c (line 1205)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175420?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 15:04:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b598ba95-30df-4f8a-8f62-1ca2d056a3f1</guid><dc:creator>jonappleseed</dc:creator><description>&lt;p&gt;I have modified the client by making it send bytes of data rather than a single byte and I&amp;#39;ve also added some timing code. However, this should not explain why Client 2 and 3 give this error but 0 and 1 do not. I have also enable Instaburst, but I have the same code without Instaburst enabled with the same problem. I will try to find where &lt;span&gt;NRF_ERROR_INVALID_STATE&lt;/span&gt; is being set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Client 2/3 Cannot Send Error yet message is sent</title><link>https://devzone.nordicsemi.com/thread/175385?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 14:22:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39b3a827-0d3c-4cd2-8cc0-ab911c2259bb</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jon,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you sure you haven&amp;#39;t modified the client ? I don&amp;#39;t think the client would act any different if you have all server to subscribe to&amp;nbsp;&lt;span&gt;GROUP_ADDRESS_ODD. When you are sending with unAcked message, the client wouldn&amp;#39;t care who are subscribing.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please try to step into the code (or printing log) to see what exactly throwing&amp;nbsp;NRF_ERROR_INVALID_STATE.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>