<?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>How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102289/how-many-characteristics-is-possible-to-add-to-one-service</link><description>Hi, working with nrf 52840 dk and trying to create 100 characteristics but the code is failing, which I am guessing due to RAM issue. 
 
 how many characteristics is possible to add in one service? 
 how many services is possible to add to one peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Jul 2023 09:16:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102289/how-many-characteristics-is-possible-to-add-to-one-service" /><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438706?ContentTypeID=1</link><pubDate>Fri, 28 Jul 2023 09:16:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14c8141c-39f5-495c-afa6-9f1cd62e953b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, it works. Note that Bluetooth is basically a star network , one node will only talk to one central.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438662?ContentTypeID=1</link><pubDate>Fri, 28 Jul 2023 05:50:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d133d5a1-c193-429e-8f50-f4d2f0d626e6</guid><dc:creator>Ayu7</dc:creator><description>&lt;p&gt;Thanks &lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;&amp;nbsp;,&amp;nbsp;NRF_LOG_WARNING worked. Now I am able to see RAM size.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will try with one characteristics, but have one doub&amp;#39;t, if I want to send 100byte of data from one node then will one characteristics with 100 node work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438560?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 14:13:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e97ec9b-d98a-447f-bdcc-886971dd9f99</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi ,&lt;br /&gt;Please check the UART log, it will tell you how much ram needed.&amp;nbsp;&lt;br /&gt;Or you can put a break inside&amp;nbsp;nrf_sdh_ble_enable() where you can see the&amp;nbsp;NRF_LOG_WARNING() printed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I don&amp;#39;t see why you have a characteristic for each node ?? Why can&amp;#39;t one single characteristic can handle multiple node ? Each node can have an ID, the same as I explained earlier.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438522?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 12:52:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03bc66c3-995e-4202-9db7-566318072bb1</guid><dc:creator>Ayu7</dc:creator><description>&lt;p&gt;So I need to elaborate more that why I am looking for 100 characteristics.&amp;nbsp; So right now we are having 20 nodes, so 20 characteristics and but in future we might increase number of nodes which will increase number of characteristics(let say 40 or 60 or 100). So the solution which you metioned above I guess not applicable.&lt;/p&gt;
&lt;p&gt;Yeah I have tried increasing&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE to 2100 but after that if I am increasing more its ble stack_init is showing memory error. How to estimate the requirement of RAM. Itried but then also its not working.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438512?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 12:18:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b89cec1a-85ef-407d-a626-98c5aa792d54</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ayu,&amp;nbsp;&lt;br /&gt;For example if you have 3 different characteristics with their value (just some dummy value that I made up)as follow:&amp;nbsp;&lt;br /&gt;&lt;span&gt;- fault status, 0xAA (no fault)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- door lock, 0x05 (door is lock)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- time 0x12345678 (time is 12:22:29 for example)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;When you send a notification to the peer device, you can use one extra byte at the beginning of the notification as the ID of the data:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- fault status,0x01&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- door lock,&amp;nbsp;0x02&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- time, 0x3&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So if you want to say the door lock is now open you can send the notification 0x02, 0x04 (door is open).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you want to set the door to lock, you can send a write command 0x02, 0x05 to set the door to look.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you want to send a notification that there is no fault, you can send the notification 0x01, 0xAA.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What you can see is that you and use the same single characteristic to send different type of data.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Another option is to combine them into one single array of byte for example, the fault byte will be the first byte, the door lock is the second bytes and the time will be from the third byte.&amp;nbsp;&lt;br /&gt;0xAA, 0x05, 0x12, 0x34, 0x56, 0x78.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Have you tried to increase&amp;nbsp;NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE&amp;nbsp; &amp;nbsp;?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Note that when you increase that you need to follow the instruction in the log to increase the RAM reserved for the softdevice in project setting.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438504?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 11:43:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1324c7d-6d58-4572-ab2a-a85e9cd5203f</guid><dc:creator>Ayu7</dc:creator><description>&lt;p&gt;So I tried but when ever I am defining&amp;nbsp;NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 2100 then 29 characteristics are possible but after that the code is resetting after&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;memset(&amp;amp;cccd_md, 0, sizeof(cccd_md));
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cccd_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cccd_md.write_perm);
cccd_md.vloc = BLE_GATTS_VLOC_STACK;
char_md.p_cccd_md = &amp;amp;cccd_md;
char_md.char_props.notify = 1;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and can you elobrate this littel more I didn&amp;#39;t understand: &lt;strong&gt;&amp;quot;As I mentioned, you don&amp;#39;t need too many characteristic/service. You can always solve it using one extra byte as the ID for them&amp;quot;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438502?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 11:38:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d61c2156-bd7a-4ffb-a1ec-429a029207c7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have a clear answer on exactly how many you can create. It depends on the type of characteristic, how many attribute it has (CCCD, user define etc).&amp;nbsp;&lt;br /&gt;Could you show the exact error you have ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Have you increased what the other user has mentioned ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;As I mentioned, you don&amp;#39;t need too many characteristic/service. You can always solve it using one extra byte as the ID for them. Having large attribute table causing trouble for the peer device to do service discovery.&amp;nbsp;&lt;br /&gt;I would say having 20 characteristics is large enough.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438500?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 11:30:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b06fff0a-f0de-4f26-8cb9-177adacf0958</guid><dc:creator>Ayu7</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;&amp;nbsp;, this is the link:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/91505/nrf-sdk-how-many-characteristics-is-possible-to-add-to-one-service"&gt;nRF SDK. How many characteristics is possible to add to one service? - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;. If you see this guy is saying that:&lt;/p&gt;
&lt;p&gt;Solved.&lt;/p&gt;
&lt;p&gt;You should change:&lt;/p&gt;
&lt;p&gt;1. BLE_GATT_DB_MAX_CHARS in ble_gatt_db,h&lt;/p&gt;
&lt;p&gt;2. NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;38160&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/em&gt;in sdk_config (value as an example. With this value I was able to add about 600 characteristics to one service).&lt;/p&gt;
&lt;p&gt;This value is close to limit for simple applications, because you have to keep RAM for application itself.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If so many characteristics are not possible then how many characteristics we can include in every service?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438496?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 11:17:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11d766c1-e027-4f88-8da3-bb7eb084f6a5</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ayu,&amp;nbsp;&lt;br /&gt;As it already stated, you don&amp;#39;t have enough RAM to do that, and I don&amp;#39;t see the reason to do that. Bluetooth GATT doesn&amp;#39;t created to have such many characteristic.&amp;nbsp;&lt;br /&gt;Could you point me to where you find someone created 600 characteristics ? And the reason behind that ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438494?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 11:14:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19cde72d-bd78-4470-9d2a-7e4cc4014d29</guid><dc:creator>Ayu7</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/hungbui"&gt;Hung Bui&lt;/a&gt;&amp;nbsp;, my device is having 6 services and in every services I have different characteristics like fault status, door lock, time, result and many. Yeaj I know that their will be ram issue but in so many discussion I read that we can add multiple characteristics(morw then 600). Can you help me how to do.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How many characteristics is possible to add to one service?</title><link>https://devzone.nordicsemi.com/thread/438486?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 10:57:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e495f157-38ae-4f45-8cb3-3684dbe2479d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ayu,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you already find out, when you create too many characteristic you will run into RAM issue. Each characteristic requires memory to store data and to handle operation.&amp;nbsp;&lt;br /&gt;Could you explain why you want to create 100 characteristics&amp;nbsp; ? Can that be solved by using one byte to determine which characteristic is being send&amp;nbsp; ? And use one single characteristic instead ?&amp;nbsp;&lt;br /&gt;By having too many characteristic, it&amp;#39;s not only more memory needed, but also it will make service discovery takes more time and energy.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>