<?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>Connecting 50 BLE slaves to an RPi</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61237/connecting-50-ble-slaves-to-an-rpi</link><description>The system requirements: 50 identical nRF53-based devices (each with a sensor and an actuator), positioned within a 3x3 meter square should be connected to a single computer (most probably an RPi 4) with BLE. 
 Latency up to 1 sec is tolerable. 
 Afaik</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 May 2020 12:04:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61237/connecting-50-ble-slaves-to-an-rpi" /><item><title>RE: Connecting 50 BLE slaves to an RPi</title><link>https://devzone.nordicsemi.com/thread/249710?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 12:04:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aafa300d-e064-4ea1-a572-2fed46dba887</guid><dc:creator>Alexander Menakhin</dc:creator><description>&lt;p&gt;Ok, I&amp;#39;ll try opening an ANT ticket.&lt;/p&gt;
&lt;p&gt;No, there&amp;#39;s no specific reason for the nRF53, honestly, I just took the most advance device example from the website.&lt;/p&gt;
&lt;p&gt;Yeah, proprietary radio is always an option, but it makes R&amp;amp;D much more expensive and I&amp;#39;d like to stick to some well-known robust tech if possible.&lt;/p&gt;
&lt;p&gt;Each module will have 2 AA&amp;#39;s, if it&amp;#39;s Energizer Ultimate, then it&amp;#39;ll be around 7000 mAh and I want it to last at least 6 months. But the modules will&amp;nbsp;also have LED&amp;#39;s, so connectivity is not the only major power consumption factor.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[quote userid="26071" url="~/f/nordic-q-a/61237/connecting-50-ble-slaves-to-an-rpi/249641"][/quote]&lt;/p&gt;
&lt;p&gt;You can have a receiver that is always in RX mode. Then your sensor devices will broadcast a packet whenever the sensor is triggered. In order to receive the ACK, they would have to open the radio for RX in a short window after the TX, so the scanner would have to generate an ACK (given that the CRC was correct in the scanned message). If the remote device receives the ACK, it can go back to sleep, but if it doesn&amp;#39;t receive the ACK, you would need to keep broadcasting this message every Xms, until the ACK is received.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now, as I said, this looks quite like the BLE communication (ACKs and retransmission on missed ACKs). But the issue is that advertisements don&amp;#39;t have ACKs, only BLE connections, and the nRF doesn&amp;#39;t support 50 connections).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another approach is that the scanner could broadcast a BLE advertisement containing the known state of the devices. If the remote devices knows what bits that represent their own advertisement it can scan and check whether their last advertisement was picked up by the scanner. I am not sure if this one was clear or not. Let me know if it wasn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ok, I&amp;#39;ll need some time to research and process that information :)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&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: Connecting 50 BLE slaves to an RPi</title><link>https://devzone.nordicsemi.com/thread/249641?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 09:37:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12b08a34-efe0-4550-9280-85fbf8ca2962</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I am not sure how ANT would suit to this. If you want to know, I suggest you create another ticket, similar to this one but asking whether ANT can be used for this, and it will be assigned to an engineer who has more experience with ANT.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think this is the first question on this issue, but I guess there are tiny differences between the different use cases.&lt;/p&gt;
&lt;p&gt;Is there a specific reason why you want to use the nRF53? I am just asking because at this point in time, the SDK for the nRF53 (the nRF Connect SDK) is not production ready. I am not familiar with this new SDK, so I can&amp;#39;t guarantee that the implementations will be nRF53 compatible. But it seems possible to use the nRF52 series for this as well.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, the issue is that you want up to 50 devices to one gateway, you want low power consumption and relatively low latency. As you say, it is a compromise. How long do you expect the device to last on a battery? And how large is the battery? For the nRF52840, the constant RX current that is required for Mesh operations would be 4.6mA, as you can &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/radio.html?cp=4_0_0_5_19_14_2#unique_1031718496" rel="noopener noreferrer" target="_blank"&gt;see here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It is of course an option to use a proprietary radio protocol. Using this I would imagine you would need to imitate the BLE advertisements.&lt;/p&gt;
&lt;p&gt;You can have a receiver that is always in RX mode. Then your sensor devices will broadcast a packet whenever the sensor is triggered. In order to receive the ACK, they would have to open the radio for RX in a short window after the TX, so the scanner would have to generate an ACK (given that the CRC was correct in the scanned message). If the remote device receives the ACK, it can go back to sleep, but if it doesn&amp;#39;t receive the ACK, you would need to keep broadcasting this message every Xms, until the ACK is received.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now, as I said, this looks quite like the BLE communication (ACKs and retransmission on missed ACKs). But the issue is that advertisements don&amp;#39;t have ACKs, only BLE connections, and the nRF doesn&amp;#39;t support 50 connections).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another approach is that the scanner could broadcast a BLE advertisement containing the known state of the devices. If the remote devices knows what bits that represent their own advertisement it can scan and check whether their last advertisement was picked up by the scanner. I am not sure if this one was clear or not. Let me know if it wasn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting 50 BLE slaves to an RPi</title><link>https://devzone.nordicsemi.com/thread/249519?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 14:25:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09c122bd-9a7b-4650-9edb-e279add01031</guid><dc:creator>Alexander Menakhin</dc:creator><description>&lt;p&gt;Yeah, you pretty much got the problem &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Broadcasting is something I&amp;#39;d like to avoid for many reasons, including the absence of ACK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, if I get you right, the situation as is seems not solvable without compromising.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there maybe anything else you would suggest? Like using ANT(+) or other technology instead of BLE?&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been researching for many days, I couldn&amp;#39;t find any similar case to reference, except for using different kinds of meshes. I can&amp;#39;t believe there is no standard approach for connecting a big swarm of sensors/actuators to a single &amp;quot;server&amp;quot; locally.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll appreciate any advice, also regarding which Nordic products could fit the requirements.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting 50 BLE slaves to an RPi</title><link>https://devzone.nordicsemi.com/thread/249197?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 12:38:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddccd78e-1873-4723-915f-191e60da4f89</guid><dc:creator>Edvin</dc:creator><description>[quote user="Edvin Holmseth"]but it is not possible with the nRF52NNN because of a limit of 20 connected devices in the softdevice.[/quote]
&lt;p&gt;&amp;nbsp;Sorry. I missed the part where you said nRF53. I don&amp;#39;t know the exact limit, but it is (far) below 50.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user="Alexander Menakhin"][/quote]&lt;/p&gt;
&lt;p&gt;All the modules should be able to send a &amp;quot;sensor-triggered&amp;quot; event to the server immediately after it was triggered. Each module should also periodically (once in several minutes) send a sort of keepalive message with their battery and signal strength status.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;All the modules are fully battery-operated, the server has a normal AC/DC connection.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;As far as the latency use case, this looks like a typical Bluetooth Mesh scenario, but the current consumption in the&amp;nbsp;Mesh technologies (Bluetooth Mesh, OpenThread, and Zigbee)&amp;nbsp;are not really battery friendly.&lt;/p&gt;
&lt;p&gt;Bluetooth Mesh are great for low latency as long as you are not streaming data. But this use case is quite similar to a light switch. Whenever it is switched, the signal will very rapidly flow through the network. Meshes, however, has a low throughput, so streaming a lot of data from all the nodes every second is not ideal. This is why I asked about it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But as I said, the Mesh technologies aren&amp;#39;t that battery friendly.&lt;/p&gt;
&lt;p&gt;The reason for this is that a mesh node needs to have the radio in RX mode ~100% percent of the time. This will lead to a base power consumption of the Radio in RX mode.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The advantage of BLE is that the radio is only used in short bursts, so that it is able to turn off the radio and the chip itself most of the time.&amp;nbsp; So in this case, neither BLE or Mesh is really ideal for your case.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Perhaps you want to look into using just advertisements for this? Advertisements on the sensor devices makes the currentconsumption low, and it has a low current consumption. You can either change the advertisements when the proximity sensor is triggered, or in fact only advertise when the sensor is triggered. The disadvantage with advertisements is that you will not get any ACKs on the advertisements, meaning you are not sure if the scanner has picked up your advertisement or not. But if you have the devices advertise all the time (e.g. every 1s) the you will also get the heartbeat signal/keepalive message every time the scanner picks it up. But some advertisement packets may disappear if it is hitting the exact same timeslot as one of the other nodes, or if there is a lot of noise. In this case, the broadcaster/advertiser does not know that the sensor didn&amp;#39;t pick up the trigger signal.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting 50 BLE slaves to an RPi</title><link>https://devzone.nordicsemi.com/thread/249188?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 12:12:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65297408-545e-44ca-9a5a-04096d450ade</guid><dc:creator>Alexander Menakhin</dc:creator><description>&lt;p&gt;Afaik, meshes can be different and there are some alternative mesh implementations to choose from. Maybe you could recommend a partner or two of yours.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting 50 BLE slaves to an RPi</title><link>https://devzone.nordicsemi.com/thread/249186?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 12:05:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8d41897-4e14-4bef-b60e-c6d89ea301e7</guid><dc:creator>Alexander Menakhin</dc:creator><description>&lt;p&gt;Thanks for the answer!&lt;/p&gt;
&lt;p&gt;Each module has a sensor (proximity sensor) and an actuator (LED). When a sensor is triggered on one module, it should provoke a reaction on another module and notify the central &amp;quot;server&amp;quot; (e.g. RPi4). This time between the sensor triggered and the LED turned on on another module should be around a second, definitely not more than 2.&lt;/p&gt;
&lt;p&gt;All the modules should be able to send a &amp;quot;sensor-triggered&amp;quot; event to the server immediately after it was triggered. Each module should also periodically (once in several minutes) send a sort of keepalive message with their battery and signal strength status.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;All the modules are fully battery operated, the server has a normal AC/DC conenction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting 50 BLE slaves to an RPi</title><link>https://devzone.nordicsemi.com/thread/249182?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 11:57:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9642fa6-432b-46d8-8971-95a90ac9bc7c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think you will be able to connect 50 BLE devices to any single BLE chip. I don&amp;#39;t think it is possible with the RPi (but not 100% sure), but it is not possible with the nRF52NNN because of a limit of 20 connected devices in the softdevice.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can of course use 3 devices to achieve 50 (60) connections, but it may not be the way to go.&lt;/p&gt;
&lt;p&gt;Mesh is a possible solution, but it heavily depends on what your application is going to do. You say that you are OK with 1s latency. What are you doing every 1s? Do you intend to send a lot of data? Or will you only send data every 1s if some conditions are fulfilled?&lt;/p&gt;
&lt;p&gt;Depending on this, there are some different approaches that you can try out, but I believe that the easiest right now is that you describe your planned application first, then we can look into details.&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>