|
| 1 | +| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S3 | |
| 2 | +| ----------------- | -------- | -------- | -------- | -------- | -------- | |
| 3 | + |
| 4 | +# ESP-IDF BLE 50 throughput GATT CLIENT Test |
| 5 | + |
| 6 | +This is the demo used to test the BLE 5.0 throughput, this demo should used with throughput server demo together. |
| 7 | + |
| 8 | +## How to Use Example |
| 9 | + |
| 10 | +Before project configuration and build, be sure to set the correct chip target using: |
| 11 | + |
| 12 | +```bash |
| 13 | +idf.py set-target <chip_name> |
| 14 | +``` |
| 15 | + |
| 16 | +To configure the project, you can follow these steps: |
| 17 | + |
| 18 | +1. We can only test notify or write throughput at the same time, this demo default to test the notify throughput, if want to test the write throughput, |
| 19 | +please set: `idf.py menuconfig --> Component config --> Example 'GATT CLIENT THROUGHPUT' Config --->` then select the `test the gattc write throughput` option. |
| 20 | +2. This demo only test unidirectional throughput, if you want to test the bidirectional throughput please change the demo by yourself. |
| 21 | +3. Should change the CPU frequency to 160 MHZ in the `idf.py menuconfig` and `Component config ---> ESP System Settings ---> CPU frequency (160 MHz)`. |
| 22 | +4. In order to maximize throughput, please test in a clean environment without many BLE devices working and esure both test devices are ESP32 series. |
| 23 | + |
| 24 | +### Hardware Required |
| 25 | + |
| 26 | +* A development board with supported SoC (e.g., ESP32-C3-DevKitM-1, ESP32-C6-DevKitC-1, etc.) |
| 27 | +* A USB cable for Power supply and programming |
| 28 | + |
| 29 | +See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it. |
| 30 | + |
| 31 | +### Build and Flash |
| 32 | + |
| 33 | +Run `idf.py -p PORT flash monitor` to build, flash and monitor the project. |
| 34 | + |
| 35 | +(To exit the serial monitor, type ``Ctrl-]``.) |
| 36 | + |
| 37 | +See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects. |
| 38 | + |
| 39 | +## Example Output |
| 40 | + |
| 41 | +### Throughput on 1M PHY |
| 42 | +``` |
| 43 | +I (458) GATTC_DEMO_PHY: Legacy adv, adv type 0x13 data len 31 |
| 44 | +I (458) GATTC_DEMO_PHY: Extend adv, adv type 0x1 data len 67 |
| 45 | +I (458) GATTC_DEMO_PHY: searched device THROUGHPUT_PHY_DEMO |
| 46 | +I (458) GATTC_DEMO_PHY: Device found ec:da:3b:0f:2d:b6 |
| 47 | +I (468) Adv name: THROUGHPUT_PHY_D |
| 48 | +I (468) Adv name: EMO |
| 49 | +I (468) GATTC_DEMO_PHY: Stop extend scan and create aux open, primary_phy 1 secondary phy 1 |
| 50 | +I (488) GATTC_DEMO_PHY: Scanning stop successfully |
| 51 | +I (768) GATTC_DEMO_PHY: Connected, conn_id 0, remote ec:da:3b:0f:2d:b6 |
| 52 | +I (768) GATTC_DEMO_PHY: Open successfully, MTU 23 |
| 53 | +I (778) GATTC_DEMO_PHY: Read PHY, status 0, TX_PHY 1, RX_PHY 1 |
| 54 | +I (4928) GATTC_DEMO_PHY: MTU exchange, status 0, MTU 517 |
| 55 | +I (4928) GATTC_DEMO_PHY: Service search result |
| 56 | +I (4928) GATTC_DEMO_PHY: Service found |
| 57 | +I (4928) GATTC_DEMO_PHY: UUID16: ff |
| 58 | +I (4938) GATTC_DEMO_PHY: Service search complete |
| 59 | +I (4938) GATTC_DEMO_PHY: Notification register successfully |
| 60 | +I (5448) GATTC_DEMO_PHY: Descriptor write successfully |
| 61 | +I (6438) GATTC_DEMO_PHY: Notify Bit rate = 97642 Byte/s, = 781136 bit/s, time = 0s |
| 62 | +I (8438) GATTC_DEMO_PHY: Notify Bit rate = 97390 Byte/s, = 779120 bit/s, time = 2s |
| 63 | +I (10438) GATTC_DEMO_PHY: Notify Bit rate = 97233 Byte/s, = 777864 bit/s, time = 4s |
| 64 | +I (12438) GATTC_DEMO_PHY: Notify Bit rate = 97178 Byte/s, = 777424 bit/s, time = 6s |
| 65 | +I (14438) GATTC_DEMO_PHY: Notify Bit rate = 97142 Byte/s, = 777136 bit/s, time = 8s |
| 66 | +``` |
| 67 | + |
| 68 | +### Throughput on 2M PHY |
| 69 | +``` |
| 70 | +I (648) GATTC_DEMO_PHY: Read PHY, status 0, TX_PHY 2, RX_PHY 2 |
| 71 | +I (4798) GATTC_DEMO_PHY: MTU exchange, status 0, MTU 517 |
| 72 | +I (4798) GATTC_DEMO_PHY: Service search result |
| 73 | +I (4798) GATTC_DEMO_PHY: Service found |
| 74 | +I (4798) GATTC_DEMO_PHY: UUID16: ff |
| 75 | +I (4808) GATTC_DEMO_PHY: Service search complete |
| 76 | +I (4808) GATTC_DEMO_PHY: Notification register successfully |
| 77 | +I (5318) GATTC_DEMO_PHY: Descriptor write successfully |
| 78 | +I (6448) GATTC_DEMO_PHY: Notify Bit rate = 175369 Byte/s, = 1402952 bit/s, time = 1s |
| 79 | +I (8448) GATTC_DEMO_PHY: Notify Bit rate = 175270 Byte/s, = 1402160 bit/s, time = 3s |
| 80 | +I (10448) GATTC_DEMO_PHY: Notify Bit rate = 175251 Byte/s, = 1402008 bit/s, time = 5s |
| 81 | +I (12448) GATTC_DEMO_PHY: Notify Bit rate = 175242 Byte/s, = 1401936 bit/s, time = 7s |
| 82 | +I (14448) GATTC_DEMO_PHY: Notify Bit rate = 175192 Byte/s, = 1401536 bit/s, time = 9s |
| 83 | +``` |
| 84 | + |
| 85 | +### Throughput on 500K PHY (Coded S2) |
| 86 | +``` |
| 87 | +I (908) GATTC_DEMO_PHY: Read PHY, status 0, TX_PHY 3, RX_PHY 3 |
| 88 | +I (5058) GATTC_DEMO_PHY: MTU exchange, status 0, MTU 517 |
| 89 | +I (5058) GATTC_DEMO_PHY: Service search result |
| 90 | +I (5058) GATTC_DEMO_PHY: Service found |
| 91 | +I (5068) GATTC_DEMO_PHY: UUID16: ff |
| 92 | +I (5068) GATTC_DEMO_PHY: Service search complete |
| 93 | +I (5068) GATTC_DEMO_PHY: Notification register successfully |
| 94 | +I (5578) GATTC_DEMO_PHY: Descriptor write successfully |
| 95 | +I (6468) GATTC_DEMO_PHY: Notify Bit rate = 44292 Byte/s, = 354336 bit/s, time = 0s |
| 96 | +I (8468) GATTC_DEMO_PHY: Notify Bit rate = 43961 Byte/s, = 351688 bit/s, time = 2s |
| 97 | +I (10468) GATTC_DEMO_PHY: Notify Bit rate = 43898 Byte/s, = 351184 bit/s, time = 4s |
| 98 | +I (12468) GATTC_DEMO_PHY: Notify Bit rate = 43871 Byte/s, = 350968 bit/s, time = 6s |
| 99 | +I (14468) GATTC_DEMO_PHY: Notify Bit rate = 43857 Byte/s, = 350856 bit/s, time = 8s |
| 100 | +``` |
| 101 | + |
| 102 | +### Throughput on 125K PHY (Coded S8) |
| 103 | +``` |
| 104 | +I (778) GATTC_DEMO_PHY: Read PHY, status 0, TX_PHY 3, RX_PHY 3 |
| 105 | +I (4928) GATTC_DEMO_PHY: MTU exchange, status 0, MTU 517 |
| 106 | +I (4938) GATTC_DEMO_PHY: Service search result |
| 107 | +I (4938) GATTC_DEMO_PHY: Service found |
| 108 | +I (4938) GATTC_DEMO_PHY: UUID16: ff |
| 109 | +I (4938) GATTC_DEMO_PHY: Service search complete |
| 110 | +I (4938) GATTC_DEMO_PHY: Notification register successfully |
| 111 | +I (5448) GATTC_DEMO_PHY: Descriptor write successfully |
| 112 | +I (6448) GATTC_DEMO_PHY: Notify Bit rate = 13459 Byte/s, = 107672 bit/s, time = 0s |
| 113 | +I (8448) GATTC_DEMO_PHY: Notify Bit rate = 13395 Byte/s, = 107160 bit/s, time = 2s |
| 114 | +I (10448) GATTC_DEMO_PHY: Notify Bit rate = 13383 Byte/s, = 107064 bit/s, time = 4s |
| 115 | +I (12448) GATTC_DEMO_PHY: Notify Bit rate = 13378 Byte/s, = 107024 bit/s, time = 6s |
| 116 | +I (14448) GATTC_DEMO_PHY: Notify Bit rate = 13375 Byte/s, = 107000 bit/s, time = 8s |
| 117 | +``` |
| 118 | + |
| 119 | +## Troubleshooting |
| 120 | + |
| 121 | +For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon. |
0 commit comments