<?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>zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81032/zigbee-messages-not-received-in-app-layer</link><description>Hi, 
 I&amp;#39;m evaluating the performance of the Zigbee protocol implementation on the nRF connect SDK using nRF52840dk:s. nRF connect SDK 1.7.0, ZBOSS I&amp;#39;m not sure where to find but assumes latest as I write this (oct 2021). Windows 10. 
 I want to send data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Dec 2021 14:51:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81032/zigbee-messages-not-received-in-app-layer" /><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/342754?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 14:51:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7435e1a-e5ae-47bd-8a2b-8feb2743ff43</guid><dc:creator>devtester</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I have tested setting the transaction time to 0xFF as suggested, it seem to work much better after that. Thanks for the answer, and the suggestion of not using the thread as I do too!&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/341573?ContentTypeID=1</link><pubDate>Wed, 01 Dec 2021 15:41:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7726063a-0de9-4bbb-8e2c-2d8bb4c34c9b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;From our Zigbee team:&lt;br /&gt;&lt;span&gt;&amp;quot;Transition Time&amp;quot; field should be set to 0xFF to inform the device to alter the level attribute as fast as possible. Customer provided the code which sets it to &amp;quot;0&amp;quot; (macro definition &amp;quot;DIMM_TRANSACTION_TIME&amp;quot;) and that&amp;#39;s probably the reason why the callback is not called on every reception. Furthermore, using the Zephyr&amp;#39;s semaphore to lock/unlock the thread to print the received data is probably not the best choice since the data can be received more often than scheduler is able to unlock the thread and lock it again (because of the 10ms systick).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So can you please test by setting the transition time to 0xFF instead of 0x00. I am missing some HW to test it right now. I can test once I am back in the office, if you like, but it would be faster for you to test yourself.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/336777?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 07:55:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06998c81-5f9f-4582-9815-f791cbea3c99</guid><dc:creator>devtester</dc:creator><description>&lt;p&gt;Thanks, looking forward to hear their answer! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/336773?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 07:23:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56f524d3-c9bb-4db9-ab7f-84a3bea89965</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am sorry for the late reply. I have looked at it, and I see the same behavior as you do. I have forwarded the question to our Zigbee team. I have not heard back from them yet, but I will let you know as soon as I do.&lt;/p&gt;
&lt;p&gt;Sorry for the delay!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/336577?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 05:22:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6ac9238-0b29-469a-8f85-f54fa6bc4ab0</guid><dc:creator>devtester</dc:creator><description>&lt;p&gt;Any news on this issue? Are you looking into it or what&amp;#39;s happening?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/335978?ContentTypeID=1</link><pubDate>Tue, 26 Oct 2021 12:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ddf8f26-5178-410b-97fd-05b7956acbb7</guid><dc:creator>devtester</dc:creator><description>&lt;p&gt;Here&amp;#39;s a run I did of the project with N_MESSAGES set to 30, ZED to the left and ZC to the right.&lt;/p&gt;
&lt;p&gt;The ZED prints that it sends 30 messages.&lt;/p&gt;
&lt;p&gt;The ZC only receives 16 messages in the app layer, 14 have not been reported. Nothing is printed from zcl_device_cb, but a semaphore is incremented for each message received and the print is done in the thread_process_data() thread.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1635250152584v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I started in and use NCS v1.7.0, have verified by creating new freestanding projects and pasting the exact files I sent you, the behavior is still there.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve also added CONFIG_USE_SEGGER_RTT=y, CONFIG_RTT_CONSOLE=y, and CONFIG_UART_CONSOLE=n to the proj.conf to log it via RTT instead of UART, but no difference.&lt;/p&gt;
&lt;p&gt;LOG_ZIGBEE is a preprocessor function I&amp;#39;ve defined, only adds some more text to the printed string. I&amp;#39;ve never been able to see anything when I try to use LOG_INF(). I also find RTT very unreliable, communication drops when I connect to a second board or reboot devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/335941?ContentTypeID=1</link><pubDate>Tue, 26 Oct 2021 11:31:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88ae6ce7-b385-4fe4-a352-753d8bfcbb5a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, so I got the project that you sent me in a message. What am I looking for in the two logs? What are you lacking, and what device is lacking it? (ZED or ZC?)&lt;/p&gt;
&lt;p&gt;I see that you use printk quite heavily, so it isn&amp;#39;t that easy to change to RTT logging, which may help.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What NCS version did you start this project in, and what version are you running it in? I see that in the latest NCS version, all the zigbee samples uses LOG_INF(), and not LOG_ZIGBEE. Can you please try to port it to the latest version?&lt;/p&gt;
&lt;p&gt;In that case it is easier to change to RTT backend on the logging module (see how it is done in the NCS\nrf\samples\bluetooth\peripheral_uart sample). That sample uses the RTT for logging, since the UART is used by the application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/335850?ContentTypeID=1</link><pubDate>Tue, 26 Oct 2021 06:31:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c9f6717-3a06-4840-af80-eaf04cdd448a</guid><dc:creator>devtester</dc:creator><description>&lt;p&gt;I trigger a semaphore for each time I get a ZB_ZCL_LEVEL_CONTROL_SET_VALUE_CB_ID in my zcl device cb, that I take in another thread which is incrementing and printing a counter for each lap it runs.&lt;/p&gt;
&lt;p&gt;The semaphore is defined with K_SEM_MAX_LIMIT as limit, the extra threads with priority 7 and I&amp;#39;ve tested to increase the default thread (that I&amp;#39;m initiating Zigbee from, not sure if this is a isr or not) priority to 1. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is my receiving routine in the ZC: &lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void zcl_device_cb(zb_bufid_t bufid)
{
	zb_zcl_device_callback_param_t  *device_cb_param =
		ZB_BUF_GET_PARAM(bufid, zb_zcl_device_callback_param_t);

	device_cb_param-&amp;gt;status = RET_OK; //Set default response value

	switch (device_cb_param-&amp;gt;device_cb_id) {
	case ZB_ZCL_LEVEL_CONTROL_SET_VALUE_CB_ID:

		k_sem_give(&amp;amp;new_data_sem);

		break;

	case ZB_ZCL_SET_ATTR_VALUE_CB_ID:
		printk(&amp;quot;Set_attr_value cb. \n&amp;quot;);
		break;

	default:
		printk(&amp;quot;Default cb\n&amp;quot;);
		break;
	}
}

void thread_process_data(void *dummy1, void *dummy2, void *dummy3)
{
	uint8_t count = 0;
	while(1){
		k_sem_take(&amp;amp;new_data_sem, K_FOREVER);
		printk(&amp;quot;Thread lap %d\n&amp;quot;, ++count);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the corresponding sending in the ZED:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void cmd_sent(zb_bufid_t bufid)
{
	gettimeofday(&amp;amp;tv_stop, NULL);
	zb_zcl_command_send_status_t *status  = ZB_BUF_GET_PARAM(bufid,
						zb_zcl_command_send_status_t);
	time_current = CALC_US(); //NOTE: Should be some kind of buffer to not drop data points.
	k_sem_give(&amp;amp;sem_new_data);
	// k_sleep(K_MSEC(20));//7 ms somewhat usable

	gettimeofday(&amp;amp;tv_start, NULL);
	zb_buf_free(bufid);

	if (control_level++ &amp;lt; N_MESSAGES){
		zb_buf_get_out_delayed(send_level_control_message);
	}
}

// static void send_level_control_message(zb_bufid_t bufid, zb_uint16_t cmd_id)
static void send_level_control_message(zb_bufid_t bufid)
{
	ZB_ZCL_LEVEL_CONTROL_SEND_MOVE_TO_LEVEL_REQ(
		bufid,
		partner_ctx.short_addr,
		ZB_APS_ADDR_MODE_16_ENDP_PRESENT,
		partner_ctx.endpoint,
		LEVEL_CONTROL_SWITCH_ENDPOINT,
		ZB_AF_HA_PROFILE_ID,
		ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
		cmd_sent,
		control_level, //Increment for visualization
		DIMM_TRANSACTION_TIME);
}


void thread_process_data(void *dummy1, void *dummy2, void *dummy3)
{
	while(1)
	{
		k_sem_take(&amp;amp;sem_new_data, K_FOREVER);
		time_total += time_current;
		printk(&amp;quot;Control sent: %3d. Time: %.3f ms, avg: %.1f ms.\n&amp;quot;,
			control_level,
			time_current*0.001,
			(time_total/control_level)*0.001);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I&amp;#39;m aware for instance UART logging can be slow, but since I do that in another thread I should be safe, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: zigbee messages not received in app layer</title><link>https://devzone.nordicsemi.com/thread/335778?ContentTypeID=1</link><pubDate>Mon, 25 Oct 2021 13:40:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b78cf32-f261-4854-9a47-9eed21630279</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]packets are dropped in the receiver side (often up to ~80%) before they reach the application level[/quote]
&lt;p&gt;How do you determine that this is the case? For all I know, it is correct, but are you sure that the logging is not truncated, if you are trying to log very fast? If so, what is your log backend?&lt;/p&gt;
&lt;p&gt;Is there a way for me to replicate this? Do you have some projects that you can share that replicates the issue?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>