Skip to content

service advertising not working #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
monteslu opened this issue Nov 3, 2017 · 4 comments
Closed

service advertising not working #163

monteslu opened this issue Nov 3, 2017 · 4 comments

Comments

@monteslu
Copy link

monteslu commented Nov 3, 2017

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 !

@chegewara
Copy link
Collaborator

chegewara commented Nov 3, 2017

@monteslu see this #144 (comment) 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.

@monteslu
Copy link
Author

monteslu commented Nov 3, 2017

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

@monteslu
Copy link
Author

monteslu commented Nov 6, 2017

that was it. thanks!

@devinsewell
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants