Esp32-snippets: service advertising not working

Created on 3 Nov 2017  路  4Comments  路  Source: nkolban/esp32-snippets

Just modified the BLE_notify example to add a line to advertise the service:

  // Start advertising
  pServer->getAdvertising()->addServiceUUID(SERVICE_UUID);  // <- added this
  pServer->getAdvertising()->start();

In your video demo of this example sketch with web bluetooth you had to filter by name and specify optionalServices with the service uuid.

When a BLE peripheral advertises a service, you can just filter by services without a name or the optionalServices property.

I have a sketch for the Arduino 101/ TinyTile that has a working service advertisement: https://github.com/monteslu/ble-io/blob/master/arduino/curie_plus/curie_plus.ino#L127
(This sketch exposes a generic GPIO service I've been connecting to for johnny-five/nodebots)

Here's the two peripherals (curie chip device and esp32) viewed using the android NRF Connect app from android:
screenshot_20171102-164924
As you can see, the curie device is advertising a service uuid, and the esp32 isn't. Is this a bug, or perhaps am I missing a step?

btw, thanks for creating ESP32_BLE_Arduino !

question waiting

Most helpful comment

@monteslu see this https://github.com/nkolban/esp32-snippets/issues/144#issuecomment-340185708 and few next comments

Short story, your device name is too long. You have to make it max 5 characters long. If it wont help please get back and we will work on it.

All 4 comments

@monteslu see this https://github.com/nkolban/esp32-snippets/issues/144#issuecomment-340185708 and few next comments

Short story, your device name is too long. You have to make it max 5 characters long. If it wont help please get back and we will work on it.

fast response :)
thanks, @chegewara I'll give that a shot

that was it. thanks!

Try adding pAdvertising->addServiceUUID(pService->getUUID()); before pAdvertising->start();

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jim-ber picture jim-ber  路  8Comments

frankipl picture frankipl  路  8Comments

rickAllDev picture rickAllDev  路  7Comments

minwinmin picture minwinmin  路  9Comments

JasXSL picture JasXSL  路  3Comments