<?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>Apparently two channels are colliding?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21897/apparently-two-channels-are-colliding</link><description>Dear Nordic, 
 Device: nRF51422. Protocol: ANT+. Softdevice: S210 v5.0.0 
 I have 3 devices: two masters (No. 1 and 2) and one slave (No. 3). In my application, I pair the slave to the two masters, store both channels IDs, and close all channels, until</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 May 2017 15:59:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21897/apparently-two-channels-are-colliding" /><item><title>RE: Apparently two channels are colliding?</title><link>https://devzone.nordicsemi.com/thread/85977?ContentTypeID=1</link><pubDate>Mon, 29 May 2017 15:59:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dad5854b-f69f-40bb-93e7-cc7429034d93</guid><dc:creator>angel</dc:creator><description>&lt;p&gt;Hi Nordic,&lt;/p&gt;
&lt;p&gt;Petter and I found the solution to the problem. Something quite weird was happening whenever the previous function was executed, and a lot of CHANNEL_COLLISION events were happening. The solution was to change the strategy from OPEN CH0, OPEN CH1, SEND both, CLOSE CH0, CLOSE CH1 to OPEN CH0, SEND CH0, CLOSE CH0, OPEN CH1, SEND CH1, CLOSE CH1. This way we never get channel collision and everything works fine. The only drawback though is the delay in sending the message to CH1 with respect to the event in the slave, which can go to maximum around 200 - 300 ms (max timeout in CH0).&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Apparently two channels are colliding?</title><link>https://devzone.nordicsemi.com/thread/85975?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 12:24:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfcc75ea-bd0f-427e-a768-03b3da1f0699</guid><dc:creator>angel</dc:creator><description>&lt;p&gt;Hi Petter,&lt;/p&gt;
&lt;p&gt;I just did it, here is the identificator: Case ID 36279&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Apparently two channels are colliding?</title><link>https://devzone.nordicsemi.com/thread/85973?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 11:38:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:157c38a9-8787-44c2-ab87-7db89b19c46e</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If you open a case through your MyPage at nordicsemi.com you can upload it to me privately there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Apparently two channels are colliding?</title><link>https://devzone.nordicsemi.com/thread/85974?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 11:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f125dab-83e6-4936-b23d-bddb45f6642b</guid><dc:creator>angel</dc:creator><description>&lt;p&gt;Hi Petter,&lt;/p&gt;
&lt;p&gt;Can I send it to you privately?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Apparently two channels are colliding?</title><link>https://devzone.nordicsemi.com/thread/85972?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 11:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c887e9c-579e-4073-8873-2bc11e236977</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Could you share your complete projects (zip them) so I can compile and test them here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Apparently two channels are colliding?</title><link>https://devzone.nordicsemi.com/thread/85971?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 10:30:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adb9c87d-130a-4f99-80ea-85665d1f70ea</guid><dc:creator>angel</dc:creator><description>&lt;p&gt;Hi Petter, thanks for the fast reply. Here you have the piece of code I use to send the message:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void send_message_and_get_ack(message_t* p_message, channel_t* p_channel_0, channel_t* p_channel_1)
{
    if(p_message-&amp;gt;current_status == PROTOCOL_STATUS_DISABLED)
    {
        p_message-&amp;gt;payload = PROTOCOL_STATUS_ENABLED;
    }
    else if(p_message-&amp;gt;current_status == PROTOCOL_STATUS_ENABLED)
    {
        p_message-&amp;gt;payload = PROTOCOL_STATUS_DISABLED;
    }

    static uint64_t time_start = 0; //variable for timeout

    if(!is_front_paired() || is_only_rear_message(p_message))
    {
        open_channel(p_channel_0);
        static uint8_t ack_retries = 0; // counter for ack retries
        // send and get ack from rear
        send_message(p_channel_0, p_message);
        bool message_failed = false;
        while(p_message-&amp;gt;class != p_channel_0-&amp;gt;received_ack)
        {
            if((get_timer_count() - time_start) &amp;gt; messages_defined.ack_timeout)
            {
                time_start = get_timer_count();
                ack_retries++;
                send_message(p_channel_0, p_message);
                if(ack_retries &amp;gt; MAX_ACK_RETRIES)
                {
                    message_failed = true;
                    break;
                }
            }
        }
        time_start = get_timer_count();
        ack_retries = 0;
        p_channel_0-&amp;gt;received_ack = 0x00;
        if(!message_failed)
        {
            p_channel_0-&amp;gt;master_present = 0x01;
            toggle_message_status(p_message, &amp;amp;messages_defined);
        }
        else                    //failed, what do? go to status OFF?
        {
            p_message-&amp;gt;current_status = PROTOCOL_STATUS_DISABLED;
        }
        close_channel(p_channel_0);
    }
    else
    {
        static uint8_t ack_retries_0 = 0; // counter for ack retries
        static uint8_t ack_retries_1 = 0; // counter for ack retries
        bool message_failed = false;

        open_channel(p_channel_0);
        open_channel(p_channel_1);
        send_message(p_channel_0, p_message);
        send_message(p_channel_1, p_message);

        bool message_failed_0 = false;
        bool message_failed_1 = false;

        bool message_succeed_0 = false;
        bool message_succeed_1 = false;

        while(true)
        {
            if(p_message-&amp;gt;class == p_channel_0-&amp;gt;received_ack)
            {
                p_channel_0-&amp;gt;master_present = 0x01;
                message_succeed_0 = true;
            }
            if(p_message-&amp;gt;class == p_channel_1-&amp;gt;received_ack)
            {
                p_channel_1-&amp;gt;master_present = 0x01;
                message_succeed_1 = true;
            }
            if((get_timer_count() - time_start) &amp;gt; messages_defined.ack_timeout)
            {
                time_start = get_timer_count();

                if(p_message-&amp;gt;class != p_channel_0-&amp;gt;received_ack &amp;amp;&amp;amp; !message_succeed_0)
                {
                    ack_retries_0++;
                    send_message(p_channel_0, p_message);
                }

                if(p_message-&amp;gt;class != p_channel_1-&amp;gt;received_ack &amp;amp;&amp;amp; !message_succeed_1)
                {
                    ack_retries_1++;
                    send_message(p_channel_1, p_message);
                }

                if(ack_retries_0 &amp;gt; MAX_ACK_RETRIES)
                {
                    message_failed_0 = true;
                }

                if(ack_retries_1 &amp;gt; MAX_ACK_RETRIES)
                {
                    message_failed_1 = true;
                }

                if(message_failed_0 &amp;amp;&amp;amp; message_failed_1)
                {
                    message_failed = true;
                    break;
                }
            }
            if((message_succeed_0 &amp;amp;&amp;amp; message_succeed_1) ||
               (message_succeed_0 &amp;amp;&amp;amp; message_failed_1) ||
               (message_succeed_1 &amp;amp;&amp;amp; message_failed_0) ||
               (message_failed_0 &amp;amp;&amp;amp; message_failed_1)
                )
            {
                break;
            }
        }
        time_start = get_timer_count();
        ack_retries_0 = 0;
        ack_retries_1 = 0;
        p_channel_0-&amp;gt;received_ack = 0x00;
        p_channel_1-&amp;gt;received_ack = 0x00;

        if(message_succeed_0 || message_succeed_1) //only if one of them, just to allow everything
        {
            toggle_message_status(p_message, &amp;amp;messages_defined);
        }
        else
        {
            p_message-&amp;gt;current_status = PROTOCOL_STATUS_DISABLED;
        }
        close_channel(p_channel_0);
        close_channel(p_channel_1);
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Apparently two channels are colliding?</title><link>https://devzone.nordicsemi.com/thread/85976?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 09:01:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48c9174f-59dd-4ded-b6ba-ee4297680d8c</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Strange. I&amp;#39;m not sure what could cause this. Would it be possible to share your complete projects so I can test them here? Or simple projects that reproduces the behavior?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>