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 Client is not able to see service uuid of BLE Uart when trying to form a connection #135
Comments
Looks like it's finding it, I'm not seeing anywhere that you're trying to connect though. Please post a log of the connection attempt for diagnosis. |
Logs of Client (BLE client) I (449) NimBLE: GAP procedure initiated: stop advertising. I (449) NimBLE: GAP procedure initiated: discovery; I (469) main_task: Returned from app_main() Logs of Server (BLE uart) I (450) NimBLE: GAP procedure initiated: stop advertising. I (450) NimBLE: GAP procedure initiated: advertise; Waiting a client connection to notify... "Looks like it's finding it, I'm not seeing anywhere that you're trying to connect though" |
I don't see anywhere in the logs where you've attempted to connect to the server device. You need to create a client instance and call the connect method with the server device you want to connect to. |
1 similar comment
I don't see anywhere in the logs where you've attempted to connect to the server device. You need to create a client instance and call the connect method with the server device you want to connect to. |
Changes made in the BLE Client code : In MyAdvertisedDeviceCallbacks -> BLEAdvertisedDevicecallbacks its printing the device name and service UUID of newly discovered devices. It will connect to the server if it finds server's UUID. Its not printing the service UUID and further not executing the if statement. I am not understanding why it is not showing the service UUID of the server to which the client wants to connect to. I have added a printf statement to print the name and UUID of the devices the client will scan and there I see the name of the device i want to connect to but not service UUID. I believe the client will only initiate connection when it will find a matching UUID. class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
/*** Only a reference to the advertised device is passed now
/********************************************************************************
/*******************************************************************
} // onResult Below is the logs on the client side : |
Yes, the code you are using is looking for specific advertisements and if found will set a flag to connect to that device. The log doesn't indicate it was found, so no connection attempt made. If I may suggest, using another esp32 make a server device with the example code and use the example client code as is and see how it connects. |
Im running BLE Client code on one esp32s3 chip and BLE uart(server) code on another esp32s3 chip. The ble client shows the devices it discovers but its not connecting to ble uart. Upon further investigation it was found that the ble client is not able to see the service uuid of ble uart, not sure whether its the ble client issue or ble uart issue. BLE Uart is getting connected to mobile app, no issues when connecting to mobile app.
The below is the output window (ESP-IDF 5.1 CMD)
I (469) main_task: Returned from app_main()
BLE Advertised Device found: UART Service Example -
BLE Advertised Device found: - 0xfef3
BLE Advertised Device found: - 3e1d50cd-7e3e-427d-8e1c-b78aa87fe624
The text was updated successfully, but these errors were encountered: