ESP-IDF Gatt Server Demo Not Functional

shebbys
Posts: 4
Joined: Sun Oct 23, 2022 7:37 pm

ESP-IDF Gatt Server Demo Not Functional

Postby shebbys » Sun Oct 23, 2022 7:43 pm

Hello,
Im using the ESP32-C3 dev kit and running the example (without any changes) ESP-IDF Gatt Server Demo located here:
https://github.com/espressif/esp-idf/bl ... tts_demo.c

The result is that the advertised services are duplicated and there are no characteristics to read. Is there something wrong with this example project? Does anyone know how to fix this and get the correct number of services reported and ability to read characteristics?
IMG_2763.PNG
IMG_2763.PNG (352.59 KiB) Viewed 1066 times
IMG_2764.PNG
IMG_2764.PNG (264.36 KiB) Viewed 1066 times

shebbys
Posts: 4
Joined: Sun Oct 23, 2022 7:37 pm

Re: ESP-IDF Gatt Server Demo Not Functional

Postby shebbys » Mon Oct 24, 2022 6:10 pm

Update:
The example code works on ESP32-WROOM-32D chip, however the advertised services is still incorrect.

Summary of issues:

1) Advertised services are duplicated on ESP32-WROOM-32D and ESP32-C3 Dev kit board
2) Reading characteristics does not work when running on the ESP32-C3 Dev kit

Thank you

shebbys
Posts: 4
Joined: Sun Oct 23, 2022 7:37 pm

Re: ESP-IDF Gatt Server Demo Not Functional

Postby shebbys » Tue Oct 25, 2022 4:57 pm

Update 2:

Apparently PlatformIO is using an older version of the esp-idf sdk. The latest version works however the advertised services count is doubled.

I dont know why, but changing line 71 second value from 0x03 to 0x01 fixes the count issue. If anyone knows where to find the format of the advertising data please let me know.

static uint8_t raw_adv_data[] = {
66 /* flags */
67 0x02, 0x01, 0x06,
68 /* tx power*/
69 0x02, 0x0a, 0xeb,
70 /* service uuid */
71 0x03, 0x01, 0xFF, 0x00,
72 /* device name */
73 0x0f, 0x09, 'E', 'S', 'P', '_', 'G', 'A', 'T', 'T', 'S', '_', 'D','E', 'M', 'O'
74 };
75 static uint8_t raw_scan_rsp_data[] = {
76 /* flags */
77 0x02, 0x01, 0x06,
78 /* tx power */
79 0x02, 0x0a, 0xeb,
80 /* service uuid */
81 0x03, 0x03, 0xFF,0x00
82 };

Who is online

Users browsing this forum: Baidu [Spider], ESP_adokitkat, Gaston1980, Majestic-12 [Bot] and 111 guests