<?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>ESB vs. Gazelle Max Polling Rate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112457/esb-vs-gazelle-max-polling-rate</link><description>Hi all, 
 
 I have an application that is pretty simple. One master that needs to stream small payloads (sub 32 byte) to a receiving device. The payload is a fixed size and all I care about is achieving the maximum polling rate/update rate possible. I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Jul 2024 08:33:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112457/esb-vs-gazelle-max-polling-rate" /><item><title>RE: ESB vs. Gazelle Max Polling Rate</title><link>https://devzone.nordicsemi.com/thread/491998?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2024 08:33:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8e1e30d-35f0-4757-9e4e-8ea40e06bfe2</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Glad that Håkon&amp;#39;s suggestion helped, and thank you for sharing the conclusion. Håkon is currently out of office, so I&amp;#39;ll mark this case as verified and close it.&lt;/p&gt;
&lt;p&gt;As always please feel free to create new cases for new inqueries and questions,&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ESB vs. Gazelle Max Polling Rate</title><link>https://devzone.nordicsemi.com/thread/491439?ContentTypeID=1</link><pubDate>Sat, 29 Jun 2024 17:30:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b2fc447-2983-410e-9906-2118b7b5c693</guid><dc:creator>coder123</dc:creator><description>&lt;p&gt;Just to follow up on this, I was able to replicate what you showed.If anyone is curious, the logging in the event callbacks was the problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you very much for the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ESB vs. Gazelle Max Polling Rate</title><link>https://devzone.nordicsemi.com/thread/491155?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2024 14:21:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bbadfb4-9fe4-4bb9-9263-94762e667c2c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="coder123"]To my knowledge, my configuration is using the 2M PHY, requires no acknowledgements, and attempts no retries, and is sending a static 8 byte payload.[/quote]
&lt;p&gt;All PHY modes can be configured with .noack=true. 2MBit will be the fastest.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="coder123"]My transmit code is essentially just a while loop that adds the packet to the Tx buffer and then sends it out. To me this all seems like the absolute fastest configuration I can have. When doing some statistics, I am getting roughly 475 packets per second on the receiving end. To me this seems......low? Maybe not, I have no context as to what should be reasonably expected.[/quote]
&lt;p&gt;This seems low. Try disabling or limiting logging, and setup a 1 second k_timer to count/print the amount of packets received &lt;strong&gt;and&lt;/strong&gt; the packets sent on the PTX side.&lt;/p&gt;
&lt;p&gt;I did a quick test with no receiver (since its noack=true), and I&amp;#39;m getting around 4000 payloads sent per second.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the .diff based on ncs v2.6.1:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;diff --git a/samples/esb/esb_ptx/prj.conf b/samples/esb/esb_ptx/prj.conf
index 621266d17..d8e9e282d 100644
--- a/samples/esb/esb_ptx/prj.conf
+++ b/samples/esb/esb_ptx/prj.conf
@@ -5,3 +5,4 @@
 #
 CONFIG_NCS_SAMPLES_DEFAULTS=y
 CONFIG_ESB=y
+CONFIG_LOG_MODE_IMMEDIATE=y
diff --git a/samples/esb/esb_ptx/src/main.c b/samples/esb/esb_ptx/src/main.c
index b64950ab7..f5ff7f4b2 100644
--- a/samples/esb/esb_ptx/src/main.c
+++ b/samples/esb/esb_ptx/src/main.c
@@ -24,6 +24,9 @@ static const struct gpio_dt_spec leds[] = {
        GPIO_DT_SPEC_GET(DT_ALIAS(led3), gpios),
 };
 
+
+volatile uint32_t packet_count;
+
 BUILD_ASSERT(DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(led0), gpios),
                          DT_GPIO_CTLR(DT_ALIAS(led1), gpios)) &amp;amp;&amp;amp;
             DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(led0), gpios),
@@ -48,7 +51,8 @@ void event_handler(struct esb_evt const *event)
 
        switch (event-&amp;gt;evt_id) {
        case ESB_EVENT_TX_SUCCESS:
-               LOG_DBG(&amp;quot;TX SUCCESS EVENT&amp;quot;);
+               //LOG_DBG(&amp;quot;TX SUCCESS EVENT&amp;quot;);
+               packet_count++;
                break;
        case ESB_EVENT_TX_FAILED:
                LOG_DBG(&amp;quot;TX FAILED EVENT&amp;quot;);
@@ -181,6 +185,15 @@ static void leds_update(uint8_t value)
        (void)gpio_port_set_masked_raw(leds[0].port, mask, val);
 }
 
+void my_timer_handler(struct k_timer *dummy)
+{
+       static uint32_t last_packet_count;
+       printk(&amp;quot;Packet count per sec: %d\n&amp;quot;, packet_count-last_packet_count);
+       last_packet_count = packet_count;
+}
+
+K_TIMER_DEFINE(my_status_timer, my_timer_handler, NULL);
+
 int main(void)
 {
        int err;
@@ -205,8 +218,8 @@ int main(void)
 
        LOG_INF(&amp;quot;Initialization complete&amp;quot;);
        LOG_INF(&amp;quot;Sending test packet&amp;quot;);
-
-       tx_payload.noack = false;
+       k_timer_start(&amp;amp;my_status_timer, K_SECONDS(1), K_SECONDS(1));
+       tx_payload.noack = true;
        while (1) {
                if (ready) {
                        ready = false;
@@ -219,6 +232,6 @@ int main(void)
                        }
                        tx_payload.data[1]++;
                }
-               k_sleep(K_MSEC(100));
+               k_cpu_idle();
        }
 }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With fast ramp-up, you should see even more.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ESB vs. Gazelle Max Polling Rate</title><link>https://devzone.nordicsemi.com/thread/490972?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2024 01:07:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93a1b669-11f7-4f12-8130-f1c0ed1d1e07</guid><dc:creator>coder123</dc:creator><description>&lt;p&gt;Thank you for the response. I had a feeling ESB was the better route if just concerned about update rate. That was also a very interesting article that shows the low latency and capabilities.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Similar to my original question, I am now interested in what ESB configuration results in the most packets per second sent over the air. Like I said, my packet size is under 32 bytes so nothing crazy.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have currently slightly modified the ESB transmitter and receiver sample codes and have them running on 2 NRF52840DKs that are sitting next to each other.&lt;/p&gt;
&lt;p&gt;I modified my transmitter to have this configuration.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1719449833280v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;My receiver has this configuration:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1719449881581v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My transmit code looks like:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1719449934436v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To my knowledge, my configuration is using the 2M PHY, requires no acknowledgements, and attempts no retries, and is sending a static 8 byte payload.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My transmit code is essentially just a while loop that adds the packet to the Tx buffer and then sends it out. To me this all seems like the absolute fastest configuration I can have. When doing some statistics, I am getting roughly 475 packets per second on the receiving end. To me this seems......low? Maybe not, I have no context as to what should be reasonably expected.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Are there any benchmarks for ESB on what update rates are possible? Is there any knowledge on what the fastest configuration should be? Any ideas on what tweaks could be made to increase update rates? It seems like I am running the fastest ESB configuration possible and am getting roughly half of what the theoretical max of Gazelle is.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any insights or ideas would be greatly appreciated.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ESB vs. Gazelle Max Polling Rate</title><link>https://devzone.nordicsemi.com/thread/490891?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 13:10:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9104aec1-14a8-4417-8807-dc9a3295683c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Gazell is ESB-based, and requires the use of ACKing, so I agree with your statement here:&lt;/p&gt;
[quote user=""]ESB seems attractive as you can turn off ACK packets from the client and turn off re-transmissions. It seems like you would get a decent gain in packets per second that you could send eliminating this overhead.[/quote]
&lt;p&gt;Gazell has a slot based setup, as you mention here:&lt;/p&gt;
[quote user=""]Gazelle seems like it does not give you some of that flexibility (maybe it does and I didnt find it) like turning off ACK responses. However I saw with 2 NRF52840 devices, the Gazelle time slot can be reduced to 600us. So maybe it can still hold its own against ESB.[/quote]
&lt;p&gt;However, it will use one slot for sending and one for receiving, so the maximum payload throughput will be 1 / (2 * timeslot) = 1 / 1.2 ms = 833.3 packets per second.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What you &amp;quot;get for free&amp;quot; with gazell is channel hopping in case of your environment being a bit noisy, but this is also something that you can implement in your own ESB-based application, as you have full control over the radio when using ESB. ESB is open source while gazell is delivered as a static compiled library.&lt;/p&gt;
&lt;p&gt;That being said, if you only want to stream data one way, it sounds like ESB (with noack) is something that you should look into.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With ESB, you can achieve close to 80-90% link utilization with larger payload sizes, as well as quite a low latency (&amp;lt;500 us) and can be used for sync&amp;#39;ing devices over-the-air, as shown in this blog post:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/bluetooth-low-energy/posts/wireless-timer-synchronization-among-nrf5-devices"&gt;Wireless timer synchronization among nRF5 devices&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>