Skip to content
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

Cannot get ezBLE.connected() == TRUE #31

Open
Marce68 opened this issue Mar 10, 2024 · 3 comments
Open

Cannot get ezBLE.connected() == TRUE #31

Marce68 opened this issue Mar 10, 2024 · 3 comments
Assignees

Comments

@Marce68
Copy link

Marce68 commented Mar 10, 2024

I'm running ezBLE examples on a BGM220 Explorer kit.
The sketch gets stuck in the loop
while (!ezBLE.connected()) ;
I'm connecting to the BGM explorer kit using a smartphone running Apps for Bluetooth debugging like EFR Connect and nRF Connect.
Tested with bonding and without bonding, nothing changes, it looks like the board/sketch does not detect the connection.
Should I install a specific stack using Simplicity Studio?

@silabs-bozont silabs-bozont self-assigned this Mar 12, 2024
@silabs-bozont
Copy link
Collaborator

silabs-bozont commented Mar 12, 2024

Hey Marce68!

Glad you're checking out ezBLE! It was initially designed for communicating between two Arduino boards over BLE, but you can make it work with your BGM220 Explorer Kit and your phone with EFR Connect as well.
The library expects the other side to have an ezBLE service and characteristic - otherwise it won't go into the connected state as it's not recognizing the other device as an ezBLE peer. You can set up your local GATT to have this characteristic - and once you do this you'll be able to send/receive data from your phone.

I'll walk you through the steps. First of course you'll need the EFR connect app. Go to the Configure tab on the bottom, then select GATT Configurator on the top.

You'll most likely have an empty list here, but go ahead and press the Create New button, then click the edit (pencil) icon on the newly created GATT server. Change the name to your preference, I named it ezBLE.

Add a Service with the name ezBLE and with the 128-bit UUID de8a5aac-a99b-c315-0c80-60d4cbb5beef. This is the service your Arduino device will look for after connecting.

Once you've added the service, go ahead and press the Add Characteristic button on the service you just created. Name it ezBLE data with the 128-bit UUID of 5b026510-4088-c297-46d8-be6c7367beef - allow read and write - then save it.
It should look like this:

Go back once, and make sure your newly created GATT database is enabled (toggle is blue).

Now you can go to the Scan tab, look for your device and connect to it. Your Arduino device should be acting as an ezBLE server. Now when you connect to the device it should get past the initial state. You'll be able to send messages by writing to the ezBLE characteristic, or read messages by reading your own local ezBLE characteristic.

Let me know if this worked for you!

@Marce68
Copy link
Author

Marce68 commented Mar 15, 2024

Thanks a lot for the detailed reply, it worked perfectly!
I didn't catch the required "simmetry", in this way it's really easy to use.
One more question.
In the past I used Bluetooth Xpress as an SPP over BLE and I have several projects still using it. Is it on the Arduino roadmap?

Thank you!

@silabs-bozont
Copy link
Collaborator

You're most welcome! :)
Porting BGX functionality is not planned - ezBLE is meant to serve as the SPP for Arduino.
Do you have any specific application in mind? Maybe it's possible to achieve the same thing with ezBLE.

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

No branches or pull requests

2 participants