<?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>BLE NUS data not sending &amp;gt; 20bytes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78342/ble-nus-data-not-sending-20bytes</link><description>Hi, 
 I have tested the ble_nus code in NCS v1.4.2 
 where i can&amp;#39;t send 250 bytes 
 I want to send 250 bytes to ble nus data send for 100 ms once 
 How to enable data send of 250 bytes 100ms once</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Aug 2021 10:13:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78342/ble-nus-data-not-sending-20bytes" /><item><title>RE: BLE NUS data not sending &gt; 20bytes</title><link>https://devzone.nordicsemi.com/thread/324632?ContentTypeID=1</link><pubDate>Thu, 12 Aug 2021 10:13:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9ee3484-2eba-40f7-ad5a-d13bde7bf3a2</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One way to do this is to create a union, similar to this:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define NUM_SENSORS 10
#define NUM_AXIS    3

typedef union
{
	int16_t mlx_reading[NUM_SENSORS][NUM_AXIS];
	uint8_t raw_buffer[NUM_SENSORS * NUM_AXIS * sizeof(int16_t)];
} my_compound_type_t;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then you can simply refer to the mlx_reading array when you assign the values from the sensor, and then refer to the raw_buffer when sending the data to the NUS service.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Because it is a union the mlx_reading array and the raw_buffer array will use&amp;nbsp;the same area in RAM.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE NUS data not sending &gt; 20bytes</title><link>https://devzone.nordicsemi.com/thread/324523?ContentTypeID=1</link><pubDate>Wed, 11 Aug 2021 14:28:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8ff909f-9d5b-49b8-a261-e41d50802d83</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;HI ,&lt;/p&gt;
&lt;p&gt;following code line shows my data sending through NUS&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; length = sprintf(data, &amp;quot;\nx,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\ny,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\nz,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d&amp;quot;, (int16_t)mlx90393_config[0].reading[MLX90393_x],
      (int16_t)mlx90393_config[1].reading[MLX90393_x],
      (int16_t)mlx90393_config[2].reading[MLX90393_x],
      (int16_t)mlx90393_config[3].reading[MLX90393_x],
      (int16_t)mlx90393_config[4].reading[MLX90393_x],
      (int16_t)mlx90393_config[5].reading[MLX90393_x],
      (int16_t)mlx90393_config[6].reading[MLX90393_x],
      (int16_t)mlx90393_config[7].reading[MLX90393_x],
      (int16_t)mlx90393_config[8].reading[MLX90393_x],
      (int16_t)mlx90393_config[9].reading[MLX90393_x],
      (int16_t)mlx90393_config[0].reading[MLX90393_y],
      (int16_t)mlx90393_config[1].reading[MLX90393_y],
      (int16_t)mlx90393_config[2].reading[MLX90393_y],
      (int16_t)mlx90393_config[3].reading[MLX90393_y],
      (int16_t)mlx90393_config[4].reading[MLX90393_y],
      (int16_t)mlx90393_config[5].reading[MLX90393_y],
      (int16_t)mlx90393_config[6].reading[MLX90393_y],
      (int16_t)mlx90393_config[7].reading[MLX90393_y],
      (int16_t)mlx90393_config[8].reading[MLX90393_y],
      (int16_t)mlx90393_config[9].reading[MLX90393_y],
      (int16_t)mlx90393_config[0].reading[MLX90393_z],
      (int16_t)mlx90393_config[1].reading[MLX90393_z],
      (int16_t)mlx90393_config[2].reading[MLX90393_z],
      (int16_t)mlx90393_config[3].reading[MLX90393_z],
      (int16_t)mlx90393_config[4].reading[MLX90393_z],
      (int16_t)mlx90393_config[5].reading[MLX90393_z],
      (int16_t)mlx90393_config[6].reading[MLX90393_z],
      (int16_t)mlx90393_config[7].reading[MLX90393_z],
      (int16_t)mlx90393_config[8].reading[MLX90393_z],
      (int16_t)mlx90393_config[9].reading[MLX90393_z]);

  if (bt_nus_send(NULL, data, length)) {
    LOG_WRN(&amp;quot;Failed to send data over BLE connection&amp;quot;);
  }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How to send the raw data in NUS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE NUS data not sending &gt; 20bytes</title><link>https://devzone.nordicsemi.com/thread/324519?ContentTypeID=1</link><pubDate>Wed, 11 Aug 2021 14:13:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d44130f-e52f-40dc-a7a0-83c795095465</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First off, I wouldn&amp;#39;t recommend sending sensor data in ASCII format like this. It is much more efficient to send the raw data directly, and do the ASCII conversion on the phone side.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you get less data to send over BLE, and you get a consistent data length for each update.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Using 2M&amp;nbsp;PHY and longer ATT MTU should speed up the throughput definitely. Have you had a look at the throughput example in the SDK for an idea of how to increase throughput?&lt;/p&gt;
[quote user="Sunil vignesh"]&lt;p&gt;CONFIG_BT_NUS_UART_BUFFER_SIZE = 500 &lt;/p&gt;
&lt;p&gt;is it possible&lt;/p&gt;[/quote]
&lt;p&gt;This should be possible, yes. In general characteristics can be up to 512 bytes in length, but using long characteristics like this is not always the most efficient since the packet might have to be split up into several smaller packets over the air (depending on the max data length setting).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you added any error handling to the function you use to send data, in order to check if it ever returns an error?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE NUS data not sending &gt; 20bytes</title><link>https://devzone.nordicsemi.com/thread/324255?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 12:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51bc5f60-a3d8-4a25-b231-7ff983ce1544</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi ovrebekk,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Have you check this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE NUS data not sending &gt; 20bytes</title><link>https://devzone.nordicsemi.com/thread/323968?ContentTypeID=1</link><pubDate>Mon, 09 Aug 2021 10:43:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a99e616-beb7-4865-96a5-ddbf581d4f70</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;CONFIG_BT_NUS_UART_BUFFER_SIZE = 500 &lt;/p&gt;
&lt;p&gt;is it possible&lt;/p&gt;
&lt;p&gt;does it need to set phy = 2M and ATT-MTU ?&lt;/p&gt;
&lt;p&gt;and here i attach my prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;


#CONFIG_NCS_SAMPLES_DEFAULTS=y

#BT config
CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_MAX_CONN=2
CONFIG_BT_MAX_PAIRED=1
CONFIG_BT_SMP=y
CONFIG_BT_L2CAP_TX_BUF_COUNT=5
CONFIG_BT_PERIPHERAL=y

#Devie Name config
CONFIG_BT_DEVICE_NAME=&amp;quot;Headset&amp;quot;
CONFIG_BT_DEVICE_APPEARANCE=961

#Device Info service config
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=y
CONFIG_BT_DIS_MANUF=&amp;quot;NordicSemiconductor&amp;quot;
CONFIG_BT_DIS_PNP_VID_SRC=2
CONFIG_BT_DIS_PNP_VID=0x1915
CONFIG_BT_DIS_PNP_PID=0xEEEF
CONFIG_BT_DIS_PNP_VER=0x0100

#Battery Service Config
CONFIG_BT_BAS=y

#HID config
CONFIG_BT_HIDS=y
CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1
CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y
CONFIG_BT_GATT_UUID16_POOL_SIZE=40
CONFIG_BT_GATT_CHRC_POOL_SIZE=20

CONFIG_BT_LL_SOFTDEVICE_DEFAULT=y
CONFIG_BT_CONN_CTX=y

# Enable the NUS service
CONFIG_BT_NUS=y

# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more workqueue stack
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE1=y
CONFIG_SERIAL=y		

CONFIG_GPIO=y

# Make sure printk is not printing to the UART console
CONFIG_CONSOLE=y
CONFIG_RTT_CONSOLE=n
CONFIG_UART_CONSOLE=y
CONFIG_PRINTK=y

CONFIG_HEAP_MEM_POOL_SIZE=2048


# Config logger
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_LOG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n

CONFIG_ASSERT=y

# Clock configuration
CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y

# I2C Enable
CONFIG_I2C=y
CONFIG_SENSOR=y

#MLX90393 Enable
CONFIG_MLX90393=y
CONFIG_MLX90393_TRIGGER_GLOBAL_THREAD=y

# NFC configuration
CONFIG_NFC_OOB_PAIRING=n

# Optimize for debug
CONFIG_DEBUG_OPTIMIZATIONS=y

# Added
CONFIG_BT_GATT_CLIENT=y

CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_RX_BUF_LEN=260
CONFIG_BT_ATT_TX_MAX=10
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_CONN_TX_MAX=10
CONFIG_BT_L2CAP_TX_BUF_COUNT=10
CONFIG_BT_L2CAP_TX_MTU=252
CONFIG_BT_L2CAP_RX_MTU=252
CONFIG_BT_CTLR_TX_BUFFER_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i am reading 13 sensors through TWI and send the calculated value at every 100ms&lt;/p&gt;
&lt;p&gt;data sample be&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;x,-3018,5826,-1944,-4055,6151,1699,-5840,-2676,7394,-6113&lt;br /&gt;y,-5767,5830,-7638,5952,-6185,5262,-5650,5682,-6004,7257&lt;br /&gt;z,-10541,10810,-16294,10959,11348,12433,-13132,10381,-11102,-11281&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1628505555106v1.png" alt=" " /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;character will be 150 - 250 it varies &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;after connected to iphone and uart notify enabled&lt;/p&gt;
&lt;p&gt;after 4 to 7 mins the device get restart and during debug found&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/att_5F00_1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/att_5F00_2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/att_5F00_3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/att_5F00_4.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE NUS data not sending &gt; 20bytes</title><link>https://devzone.nordicsemi.com/thread/323943?ContentTypeID=1</link><pubDate>Mon, 09 Aug 2021 09:15:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:047a4507-9411-4a5d-af1d-e1fbef4605b7</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you&amp;nbsp;add the&amp;nbsp;CONFIG_BT_NUS_UART_BUFFER_SIZE parameter to your prj.cnf file you should be able to change the UART data size from the default 20 bytes to something larger.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>