[Resolved] BLE GATT server example: Service UUID not advertised

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

[Resolved] BLE GATT server example: Service UUID not advertised

Postby michaelwgnr » Wed Dec 21, 2016 5:54 pm

I've been playing with the GATT server example lately and noticed that it looks like the service UUID is not advertised, even though it should.

Even though there are two service UUIDs defined in the test_service_uuid128 array, none of them is advertised. When looking at the advertising data in e.g. LightBlue on iOS, there are no services mentioned in the advertising data. Am I missing something or does this need fixing?

Furthermore, I wonder if it there is a possibility that in the future, there is no need to specify the whole UUID128 for the advertisement data if a service with UUID16 or UUID32 is advertised (or if at least, a macro could be provided in the API so you don't have to re-type the BLE base UUID all the time...)

Thank you for any responses!
-mike
Last edited by michaelwgnr on Fri Jan 06, 2017 12:16 pm, edited 1 time in total.

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Re: BLE GATT server example: Service UUID not advertised

Postby michaelwgnr » Fri Dec 23, 2016 2:05 pm

for some reason, I'm not able to connect to the device using the Android app "BLE Scanner", while on iOS with "LightBlue", connection seems to work without any problems.

EDIT:
I moved two non-related questions to their own thread and also created a new thread concerning the Android connection problem.
Last edited by michaelwgnr on Fri Jan 06, 2017 12:13 pm, edited 2 times in total.

mephistod2
Posts: 6
Joined: Mon Dec 26, 2016 8:43 am

Re: BLE GATT server example: Service UUID not advertised

Postby mephistod2 » Thu Dec 29, 2016 12:46 pm

"Furthermore, for some reason, I'm not able to connect to the device using the Android app "BLE Scanner", while on iOS with "LightBlue", connection seems to work without any problems."
I met the same problem, Is there any solution yet?

mephistod2
Posts: 6
Joined: Mon Dec 26, 2016 8:43 am

Re: BLE GATT server example: Service UUID not advertised

Postby mephistod2 » Fri Dec 30, 2016 6:23 am

michaelwgnr wrote:Hi there,

Unfortunately no one seemed to answer so far and I didn't find out the cause of this yet, but I looked some more into the BLE stack and API and I got a fewmore questions and problems:

What is the esp_ble_gatts_app_register call exactly for? I tried digging deeper into the stack, but don't really understand what exactly happens after I call the function. It seems to register a "GATT server Interface" and eventually the call back defined via esp_ble_gatts_register_callback is called with a GATT Server Interface identifier as a result. What is this GATT Server interface identifier exactly for? It seems to me that it allows to define multiple GATT servers on one device with different services?

What UUID do I have to submit to esp_ble_gatts_app_register? What relevance does it have? Is it the service UUID? If so, why is it an uint16_t?

Furthermore, for some reason, I'm not able to connect to the device using the Android app "BLE Scanner", while on iOS with "LightBlue", connection seems to work without any problems.

Thank you for any support.
I found that Android 4.4 able to connect esp32 , but android 5.0 and above not able to connect.

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Re: BLE GATT server example: Service UUID not advertised

Postby michaelwgnr » Tue Jan 03, 2017 1:41 pm

Last edited by michaelwgnr on Fri Jan 06, 2017 12:15 pm, edited 3 times in total.

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Re: BLE GATT server example: Service UUID not advertised

Postby michaelwgnr » Wed Jan 04, 2017 12:51 pm

michaelwgnr wrote:... looks like the service UUID is not advertised, even though it should.
I did some further testing / analysis (read: "trial and error"...) on my original issue and noticed that my initial problem description was not accurate. The original GATT server demo does correctly advertise the service UUID.

I changed the service to have an 128 bit UUID, which turned out to be discarded from the advertising package because the payload then surpassed the 37 byte limit.

It would be really helpful if when that happens, either the input to esp_ble_gap_config_adv_data would be immediately verified to be correct or if there would at least be an appropriate status value set in the GAP callback function.

I also noticed, that currently it is only possible to advertise one single UUID128 service. (As seen in the function btc_to_bta_adv_data in btc_gap_ble.c, beginning on line 231). Will this change in the future?

Concerning the Android connection issue: is there anything being done about this?

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Android connection problem

Postby michaelwgnr » Wed Jan 04, 2017 3:55 pm

Last edited by michaelwgnr on Fri Jan 06, 2017 12:15 pm, edited 2 times in total.

ESP_Tianhao
Posts: 28
Joined: Thu Jan 05, 2017 10:46 am

Re: BLE GATT server example: Service UUID not advertised

Postby ESP_Tianhao » Fri Jan 06, 2017 6:17 am

Hi, thanks for your concerned.

iPhone cannot realize service UUID of ADV_data. Because the ADV_DATA is only 31bytes. So you need to decrease the ADV_DATA size.
In the demo, we do many settings of ADV_DATA for demo. So you can delete some settings of ADV_DATA.

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Re: BLE GATT server example: Service UUID not advertised

Postby michaelwgnr » Fri Jan 06, 2017 8:31 am

ESP_Tianhao wrote:iPhone cannot realize service UUID of ADV_data. Because the ADV_DATA is only 31bytes. So you need to decrease the ADV_DATA size.
In the demo, we do many settings of ADV_DATA for demo. So you can delete some settings of ADV_DATA.
Thank you for chiming in. Sorry, this thread got a bit long, so it is not obvious that I resolved the initial issue (Service UUID not advertised). As I said above, it would be really helpful if the Espressif API would do some form of input verification and somehow return (either directly of through the GAP callbacks) a status indicating truncation of the advertisement data.

The other issues, that I tackled in here are the ones that still bother me, though. Most importantly the Android connection problem. It's probably better to open new threads for this in the Bug Reports forum...

ESP_Tianhao
Posts: 28
Joined: Thu Jan 05, 2017 10:46 am

Re: BLE GATT server example: Service UUID not advertised

Postby ESP_Tianhao » Mon Jan 09, 2017 5:57 am

michaelwgnr wrote:
ESP_Tianhao wrote:iPhone cannot realize service UUID of ADV_data. Because the ADV_DATA is only 31bytes. So you need to decrease the ADV_DATA size.
In the demo, we do many settings of ADV_DATA for demo. So you can delete some settings of ADV_DATA.
Thank you for chiming in. Sorry, this thread got a bit long, so it is not obvious that I resolved the initial issue (Service UUID not advertised). As I said above, it would be really helpful if the Espressif API would do some form of input verification and somehow return (either directly of through the GAP callbacks) a status indicating truncation of the advertisement data.

The other issues, that I tackled in here are the ones that still bother me, though. Most importantly the Android connection problem. It's probably better to open new threads for this in the Bug Reports forum...
Maybe later, we will provide an API to make up raw adv data by users.

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 220 guests