nkolban / esp32-snippets

Sample ESP32 snippets and code fragments
https://leanpub.com/kolban-ESP32
Apache License 2.0
2.37k stars 710 forks source link

No advertising on multiple services? #1058

Closed notanios closed 3 years ago

notanios commented 3 years ago

Just tried to follow example from BLE_server.ino. Added one more service by pAdvertising->addServiceUUID(MY_SERVICE);.

As I can see only first service is advertised and I'm not sure how to dig into the problem as I can't see latest code (idk why, the master is 2 years old).

I use lib directly from Arduino, 1.0.1 version.

What I did wrong?

chegewara commented 3 years ago
  1. i think you ar using arduino 1.0.4, since in 1.0.1 there is no ble integrated yet
  2. what UUIDs you are trying to advertise, there is length limit, 31 bytes, in advertising packet and some bytes are used to advertise TX power for example
  3. https://github.com/nkolban/esp32-snippets/issues/813
notanios commented 3 years ago

First of all BIG THANK YOU for the quick response and the response fact at all! 👍 I understand now that this repo has no clear future and code is shared across multiple vendors' libs.

Now to the question (if I may use some more of you attention :) ):

  1. I was talking about ESP32ble-arduino lib, not Arduino IDE. The version of the lib is 1.0.1 which seems to be the latest on Arduino from libs manager.
  2. Yes, I was unaware of this adv package size limit. I quickly read this issue and got wrong impression that there is no such limit.

Now, with your help, I figured it out. Thank you!

BTW, on #3. I'm learning how BLE stack works and would like to help if there is anything on table now. I mean related to this project/repo. Would be great though to have all code in one place considering majority of issue/request/questions coming here. Is there plan to update this repo (I see some closed pull requests but code apparently is not in master. Am I wrong?).

chegewara commented 3 years ago
  1. Latest arduino lib, arduino-esp32, is v1.0.5, soon v1.0.6
  2. you may want to use NimBLE instead, which has lower ram and flash requirements and is also available in arduino as library https://github.com/h2zero/NimBLE-Arduino

Both libraries are almost 100% compatible in API meaning.