This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

measuring throughput on S130 V2

Hello, I'm using the SDK 11.0.0 and S130 on both sides, and the projects ble_app_uart_c and ble_app_uart to connect a central and a peripheral through BLE. I was doing some measures to see how much data I could send defining different minimum and maximum intervals.

I got a throughput of 160kbps when using 7.5ms in the maximum and minimum connection intervals. But I don't think this number should be correct (not complaining because the more data I could send better). Just wanted to know if this is a normal number or maybe I'm measuring the throughput wrongly. I count the number of packets sent during one second and during 2 seconds and then calculated the throughput.

this is my code:

uint32_t timer2_number = 2000;		//timer in ms			
			while(timer2_number != 0)
{
			ble_nus_string_send(&m_nus, sender, 11); 		
            timer2_number--;
			counter_t++;
            nrf_delay_us(999);
}
			ble_nus_string_send(&m_nus, end_packet, 16); 		
			printf("%f\n",counter_t);
			nrf_delay_ms(10000);

the max should be 7packets20B8*(1/7.5ms)=149.33kbps. And I'm getting 160kbps. can I use delays to measure this, or should I use timers to be more precise?

Parents
  • You are calling ble_nus_string_send() 1000 times in a second. And you assume that you send 20 bytes each time. 20 * 8 *1000 = 160 kbps. Calling ble_nus_string_send() doesn't mean that the packet is actually sent. You need to check the returned error code. I believe most of your calls return NRF_SUCCESS (0x00000000), but some return BLE_ERROR_NO_TX_PACKETS (0x00003004). I would remove the delay and count the number of calls of ble_nus_string_send() that actually returns NRF_SUCCESS.

  • I'm already counting the number of packets that I receive in the central part and those are the ones considered. I try to send every ms a packet to the central but with different times I get different number of packets. I receive 1000 packets in one second, with 7.5 for min and max interval connection, but I think this is not a real number, because it shouldn't let me receive all the packets I send in one second.

    EDIT I measured only the when I get NRF_SUCCESS and still got a throughput of 153.27kbps. I think is still a misleading number, but I'll work with it and be cautious!

Reply
  • I'm already counting the number of packets that I receive in the central part and those are the ones considered. I try to send every ms a packet to the central but with different times I get different number of packets. I receive 1000 packets in one second, with 7.5 for min and max interval connection, but I think this is not a real number, because it shouldn't let me receive all the packets I send in one second.

    EDIT I measured only the when I get NRF_SUCCESS and still got a throughput of 153.27kbps. I think is still a misleading number, but I'll work with it and be cautious!

Children
No Data
Related