Hi.
Using the gatts_table_creat_demo example esp-idf-v5.3.1.
The minimum number of changes. In the main loop, it should send packets every 19 ms.
while (1) {
esp_ble_gatts_send_indicate(ESP_GATTS_temp, param_write_conn_id_temp, heart_rate_handle_table[IDX_CHAR_VAL_A], size of(esp_ble_buffer), esp_ble_buffer, false);
vTaskDelay(19/ portTICK_PERIOD_MS);
}
But the data comes with different delays. This is the time between packets calculated on the receiving side (ms):
23, 31, 6, 22, 30, 5, 25, 33, 8, 22, 31, 7, 29, 21, 32, 10, 19, 5, 24, 30, 13, 50, 15, 14, 13, 20, 6, 18
As I understand it, esp_ble_gatts_send_indicated loads data into a buffer from which it is sent via semaphore. But I can't figure out how to make this data be sent immediately? Or with minimal delay.
Example bluedroid gatts_table_creat_demo Sends packets with different delays.
Re: Example bluedroid gatts_table_creat_demo Sends packets with different delays.
Hi. Maybe I asked the question incorrectly?
How to make the example send a packet as quickly as possible after executing the function:
esp_blue_cats_and_indicated(ESP_GETS_temp, param_write_conn_id_temp, heart_rate_handle_table[IDX_CHAR_VAL_A], size(esp_blu_buffer), esp_ble_buffer, false);
It turns out that there is a delay of about 30 ms, because of which some packets arrive together, and there is a longer pause between others.
How to make the example send a packet as quickly as possible after executing the function:
esp_blue_cats_and_indicated(ESP_GETS_temp, param_write_conn_id_temp, heart_rate_handle_table[IDX_CHAR_VAL_A], size(esp_blu_buffer), esp_ble_buffer, false);
It turns out that there is a delay of about 30 ms, because of which some packets arrive together, and there is a longer pause between others.
Re: Example bluedroid gatts_table_creat_demo Sends packets with different delays.
Changed the parameters:
conn_params.max_int = 0x06; // *1.25ms
conn_params.min_int = 0x06; // *1.25ms
When sending at a rate of 50 frames per second, I get the following result (On the receiving side, the delay between packets (ms):
25 16 16 17 22 23 23 15 19 22 28 17 14 20 21 25 21 12 22 13 20 47 4 17 22 24 17 16 17 16 23 29 17 15 19 22 29 17
As soon as I change the frequency of the esp_ble_gatts_send_indicate call to 60 times per second.(17ms between packets) I get this result:
6 4 4 4 4 12 10 8 11 15 20 9 14 24 16 16 17 19 16 16 17 16 17 16 18 18 16 16 17 17 17 18 16 16 17 16 16 21 12 23 28 16 8 48 9 4 14 19 9 24 9 15 25 17 10 27 7 12 12 22 26 21 9 21 16 17 16 18 17 16 17 25 10 22 6 20 17 17 16 18 17 17 14 18 18 21 7 22 16 17 17 23 5 22
And this is with a frequency of 100 packets per second (10ms):
5 5 5 4 4 5 5 5 4 4 4 4 9 4 20 8 4 4 4 4 4 9 4 9 5 0 4 6 4 8 14 6 9 18 8 14 31 5 4 8 4 6 10 5 7 16 16 4 4 8 17 8 3 14 5 7 14 17 4 7 15 4 20 8 5 12 4 21 4 11 9 10 16 5 4 32 4 9 4 17 5 8 4 16 9 16 7 11 4 11 8 3 14 4 22 17 4 7 15 10 5 9 8 10 7 15 4 24 5 4 23 4 7 13 8 17 7 12 3 4 26 9 4 13 8 15 9 4 15
200 packets per second(5ms):
4 5 4 4 4 7 4 9 4 15 4 3 4 4 4 3 4 4 7 4 5 3 4 3 9 4 3 5 4 9 4 4 10 4 13 5 4 4 4 4 3 4 3 8 4 4 3 8 6 4 4 4 13 6 7 8 4 4 4 4 3 4 4 3 4 13 3 4 4 3 4 3 5 4 5 4 20 4 4 3 4 4 4 4 3 7 5 3 4 7 6 4 4 4 3 9 4 5 3 6 7 4 14 4 3 3 4 3 4 4 3 4 4 4 4 4 3 12 4 4 4 4 5 3 4 4 4 15 4 4 4 4 3 4 4 4 5 4 11 6 3 4 4 4 6 4 4 4 4 9 4 4 4 3 4 5 5
120 packets per second(8333ms)(required frequency):
4 4 4 4 4 8 16 4 5 4 4 8 6 4 4 9 5 7 8 4 4 13 9 8 4 4 11 6 4 12 9 4 7 11 7 4 9 4 21 4 11 8 8 4 10 13 9 4 15 4 3 4 22 8 4 4 10 4 5 14 18 5 7 4 12 12 4 8 14 9 4 4 17 9 12 4 9 4 11 4 7 6 11 4 20 11 10 5 11 4 5 9 29 4 8 9 6 4 18 3 4
It looks like there is a time interval of a multiple of 20 ms that interrupts sending, or an empty sending buffer is checked every 20 ms...
conn_params.max_int = 0x06; // *1.25ms
conn_params.min_int = 0x06; // *1.25ms
When sending at a rate of 50 frames per second, I get the following result (On the receiving side, the delay between packets (ms):
25 16 16 17 22 23 23 15 19 22 28 17 14 20 21 25 21 12 22 13 20 47 4 17 22 24 17 16 17 16 23 29 17 15 19 22 29 17
As soon as I change the frequency of the esp_ble_gatts_send_indicate call to 60 times per second.(17ms between packets) I get this result:
6 4 4 4 4 12 10 8 11 15 20 9 14 24 16 16 17 19 16 16 17 16 17 16 18 18 16 16 17 17 17 18 16 16 17 16 16 21 12 23 28 16 8 48 9 4 14 19 9 24 9 15 25 17 10 27 7 12 12 22 26 21 9 21 16 17 16 18 17 16 17 25 10 22 6 20 17 17 16 18 17 17 14 18 18 21 7 22 16 17 17 23 5 22
And this is with a frequency of 100 packets per second (10ms):
5 5 5 4 4 5 5 5 4 4 4 4 9 4 20 8 4 4 4 4 4 9 4 9 5 0 4 6 4 8 14 6 9 18 8 14 31 5 4 8 4 6 10 5 7 16 16 4 4 8 17 8 3 14 5 7 14 17 4 7 15 4 20 8 5 12 4 21 4 11 9 10 16 5 4 32 4 9 4 17 5 8 4 16 9 16 7 11 4 11 8 3 14 4 22 17 4 7 15 10 5 9 8 10 7 15 4 24 5 4 23 4 7 13 8 17 7 12 3 4 26 9 4 13 8 15 9 4 15
200 packets per second(5ms):
4 5 4 4 4 7 4 9 4 15 4 3 4 4 4 3 4 4 7 4 5 3 4 3 9 4 3 5 4 9 4 4 10 4 13 5 4 4 4 4 3 4 3 8 4 4 3 8 6 4 4 4 13 6 7 8 4 4 4 4 3 4 4 3 4 13 3 4 4 3 4 3 5 4 5 4 20 4 4 3 4 4 4 4 3 7 5 3 4 7 6 4 4 4 3 9 4 5 3 6 7 4 14 4 3 3 4 3 4 4 3 4 4 4 4 4 3 12 4 4 4 4 5 3 4 4 4 15 4 4 4 4 3 4 4 4 5 4 11 6 3 4 4 4 6 4 4 4 4 9 4 4 4 3 4 5 5
120 packets per second(8333ms)(required frequency):
4 4 4 4 4 8 16 4 5 4 4 8 6 4 4 9 5 7 8 4 4 13 9 8 4 4 11 6 4 12 9 4 7 11 7 4 9 4 21 4 11 8 8 4 10 13 9 4 15 4 3 4 22 8 4 4 10 4 5 14 18 5 7 4 12 12 4 8 14 9 4 4 17 9 12 4 9 4 11 4 7 6 11 4 20 11 10 5 11 4 5 9 29 4 8 9 6 4 18 3 4
It looks like there is a time interval of a multiple of 20 ms that interrupts sending, or an empty sending buffer is checked every 20 ms...
Re: Example bluedroid gatts_table_creat_demo Sends packets with different delays.
I tried NimBLE. I changed the settings and got the best result at 60 packets per second.:
2 1 6 2 2 1 2 9 2 1 2 7 2 2 1 20 3 6 15 2 23 6 2 19 17 3 2 1 7 77 9 29 3 3 4 1 2 2 8 16 2 17 2 2 2 2 37 3 3 8 3 2 36 3 2 3 25 3 1 2 30 44 7 9 3 9 2 1 2 1 58 6 11 7 2 1 8 1 7 16 2 1 1 27 2 16 2 25 8 15 1 2 20 8 11 6 20 3 6 1 77 15 2 2 1 2 2 1 65 2 22 2 1 30 3 1 4 2 2 2 7 3 3 1 11 3 2 6 28 7 14 2 23 11 1 2 2 32 2 6 2 35 17 2 2 2 18 29 2 6 13 2
worse than bluedroid...
2 1 6 2 2 1 2 9 2 1 2 7 2 2 1 20 3 6 15 2 23 6 2 19 17 3 2 1 7 77 9 29 3 3 4 1 2 2 8 16 2 17 2 2 2 2 37 3 3 8 3 2 36 3 2 3 25 3 1 2 30 44 7 9 3 9 2 1 2 1 58 6 11 7 2 1 8 1 7 16 2 1 1 27 2 16 2 25 8 15 1 2 20 8 11 6 20 3 6 1 77 15 2 2 1 2 2 1 65 2 22 2 1 30 3 1 4 2 2 2 7 3 3 1 11 3 2 6 28 7 14 2 23 11 1 2 2 32 2 6 2 35 17 2 2 2 18 29 2 6 13 2
worse than bluedroid...
Who is online
Users browsing this forum: floitsch_toit, Google [Bot] and 180 guests