-
Notifications
You must be signed in to change notification settings - Fork 710
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
BLE_Uart serviceUUID not visible in client scans #643
Comments
Can you check the URL of the BLE_uart.ino ?
Those 2 examples are currently not in sync. Can you check if the problem occurs in both versions? |
Federico, I tinkered with Neil's BLU_uart along with some of my own test code and I specifically thought that the line of code you mentioned above was the key but I got the same results with or without passing the UUID to the addServiceUUID method. I was busy with other things at the time and couldn't chase it any further but I can check it out now. I'll post my finding here in just a few. |
@ThingEngineer Change esp32 name to something shorter (5 or less chars) ans of course add this line too: |
You can search this repo issues to see why you have to use short name. In this case you have to setup serviceUUID in advertising packet and name in scan response packet. |
Thank you for that extra info Che, this makes more sense now. I'm fairly new to BLE and to this library so I can't make any assumptions yet but gut instinct tells me something seems off with the advert coming from the BLE_uart compared to other BLE devices I'm scanning. Like, why is the serviceUUID showing up twice causing the LightBlue app to register 2 services for "test" and nRF connect app to show two serviceUUID's in the advert when "test" has only one service. I've got to focus on something else at the moment but I'll dive into the library and this anomaly more later if no one else does. Maybe other devices are only setting regular advertisement date and/or scan response data versus setting both, no idea at this moment, just a first guess. More research is needed... For anyone else stumbling here this is a good place to start with questions pertaining to BLE advert data, size, etc. The official BLE docs can be a bit daunting. Since this is starting to getting off topic and the original issue here has been covered I'll go ahead close this. Thanks for all your work on this great library guys! I look forward to seeing it mature further. |
You are close. This library is configurable and by default advertising and scan response advertising both are the same, thats why you see 2 serviceUUIDs. To advertise long name with 128 bit serviceUUID there is some kind of trick used, regular advertising is not sending device name, but it is send with scan response. To do this in this library you have to use functions and class i pasted links in other post. There is at least few topics in this repo with the same issue you asked, just search for short name or serviceUUID. Every answer is wide described why it is happen. |
Chegewara, id love to see an example using those 2 functions thanks |
Running this sketch: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLETests/Arduino/BLE_uart/BLE_uart.ino
Edit: Or this one: https://github.com/nkolban/ESP32_BLE_Arduino/blob/master/examples/BLE_uart/BLE_uart.ino
The "UART Service" device that shows up in a scan performed by a central mode (client) does not show the serviceUUID in the scan. There for following condition is never met by a client:
There are testing photos, screen shots, and a further explanation here:
https://github.com/ThingEngineer/ESP32_BLE_client_uart
The text was updated successfully, but these errors were encountered: