How to make BLE client connect to only specific server

listout
Posts: 31
Joined: Wed Mar 16, 2022 10:54 am

How to make BLE client connect to only specific server

Postby listout » Thu Jun 09, 2022 11:24 am

I've a BLE application (NimBLE stack), it works as expected. But now I want the client to connect to a specific server and don't connect to anything else. How can I do this? How can I tell the client to connect to a specific server?

listout
Posts: 31
Joined: Wed Mar 16, 2022 10:54 am

Re: How to make BLE client connect to only specific server

Postby listout » Fri Jun 10, 2022 5:30 am

Please can anyone help ?

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

Re: How to make BLE client connect to only specific server

Postby abansal22 » Fri Jun 10, 2022 6:21 am

listout wrote:
Fri Jun 10, 2022 5:30 am
Please can anyone help ?
What is mean by specific server. if the server expose the specific uuid, you can filter out. you can use the OOB method to filter out the desired server, you can use the mac of the device to filter it out. how do you want it?

listout
Posts: 31
Joined: Wed Mar 16, 2022 10:54 am

Re: How to make BLE client connect to only specific server

Postby listout » Fri Jun 10, 2022 6:45 am

abansal22 wrote:
Fri Jun 10, 2022 6:21 am
listout wrote:
Fri Jun 10, 2022 5:30 am
Please can anyone help ?
What is mean by specific server. if the server expose the specific uuid, you can filter out. you can use the OOB method to filter out the desired server, you can use the mac of the device to filter it out. how do you want it?
I meant, the server and client boots up and connects for first time. The client then stores some info about the server so that it connects to this particular server only (if there are other servers in the vicinity) next time it connects and not to some other server with same services and uuid.

May be store the mac address or something
Last edited by listout on Fri Jun 10, 2022 6:57 am, edited 1 time in total.

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

Re: How to make BLE client connect to only specific server

Postby abansal22 » Fri Jun 10, 2022 6:52 am

listout wrote:
Fri Jun 10, 2022 6:45 am
abansal22 wrote:
Fri Jun 10, 2022 6:21 am
listout wrote:
Fri Jun 10, 2022 5:30 am
Please can anyone help ?
What is mean by specific server. if the server expose the specific uuid, you can filter out. you can use the OOB method to filter out the desired server, you can use the mac of the device to filter it out. how do you want it?
I meant, the server and client boots up and connects for first time. The client then stores some info about the server so that it connects to this particular server only (if there are other servers in the vicinity) next time it connects and not to some other server with save service and uuid.

May be store the mac address or something
The specific term is called bonding.. i thing there is the example in the esp-idf folder

listout
Posts: 31
Joined: Wed Mar 16, 2022 10:54 am

Re: How to make BLE client connect to only specific server

Postby listout » Fri Jun 10, 2022 6:55 am

abansal22 wrote:
Fri Jun 10, 2022 6:52 am
listout wrote:
Fri Jun 10, 2022 6:45 am
abansal22 wrote:
Fri Jun 10, 2022 6:21 am


What is mean by specific server. if the server expose the specific uuid, you can filter out. you can use the OOB method to filter out the desired server, you can use the mac of the device to filter it out. how do you want it?
I meant, the server and client boots up and connects for first time. The client then stores some info about the server so that it connects to this particular server only (if there are other servers in the vicinity) next time it connects and not to some other server with save service and uuid.

May be store the mac address or something
The specific term is called bonding.. i thing there is the example in the esp-idf folder
Wouldn't bonding require some I/O capability. My device doesn't have any I/O. I've tried the bleprph and blecent example from master branch. After each connect when it shows the connection information in bleprph example the bonding and encryption was shown as 0. I've tried changing various things through menuconfig, nothing helped (mainly the options in example config and there was another option in nimble to store info in nvs, however I haven't found the later in v4.4.1)

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

Re: How to make BLE client connect to only specific server

Postby abansal22 » Fri Jun 10, 2022 6:57 am

listout wrote:
Fri Jun 10, 2022 6:55 am
abansal22 wrote:
Fri Jun 10, 2022 6:52 am
listout wrote:
Fri Jun 10, 2022 6:45 am


I meant, the server and client boots up and connects for first time. The client then stores some info about the server so that it connects to this particular server only (if there are other servers in the vicinity) next time it connects and not to some other server with save service and uuid.

May be store the mac address or something
The specific term is called bonding.. i thing there is the example in the esp-idf folder
Wouldn't bonding require some I/O capability. My device doesn't have any I/O. I've tried the bleprph and blecent example from master branch. After each connect when it shows the connection information in bleprph example the bonding and encryption was shown as 0. I've tried changing various things through menuconfig, nothing helped (mainly the options in example config and there was another option in nimble to store info in nvs, however I haven't found the later in v4.4.1)
I have done long time ago, you can use just works security, if no i/o capabilities..

listout
Posts: 31
Joined: Wed Mar 16, 2022 10:54 am

Re: How to make BLE client connect to only specific server

Postby listout » Fri Jun 10, 2022 6:58 am

abansal22 wrote:
Fri Jun 10, 2022 6:57 am
listout wrote:
Fri Jun 10, 2022 6:55 am
abansal22 wrote:
Fri Jun 10, 2022 6:52 am


The specific term is called bonding.. i thing there is the example in the esp-idf folder
Wouldn't bonding require some I/O capability. My device doesn't have any I/O. I've tried the bleprph and blecent example from master branch. After each connect when it shows the connection information in bleprph example the bonding and encryption was shown as 0. I've tried changing various things through menuconfig, nothing helped (mainly the options in example config and there was another option in nimble to store info in nvs, however I haven't found the later in v4.4.1)
I have done long time ago, you can use just works security, if no i/o capabilities..
Tried that the bonding flags still remains 0. Both on master and 4.4.1 tag

I was looking at this thread https://github.com/espressif/esp-nimble/issues/14, doesn't look like I can use bonding in my scenario

listout
Posts: 31
Joined: Wed Mar 16, 2022 10:54 am

Re: How to make BLE client connect to only specific server

Postby listout » Fri Jun 10, 2022 7:29 am

@abansal22 I was finally able to form a bond, do you know how to connect to only bonded device. I the thread I mentions said something about a PR but I couldn't find any such PR

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

Re: How to make BLE client connect to only specific server

Postby abansal22 » Fri Jun 10, 2022 7:32 am

listout wrote:
Fri Jun 10, 2022 7:29 am
@abansal22 I was finally able to form a bond, do you know how to connect to only bonded device. I the thread I mentions said something about a PR but I couldn't find any such PR
Good to hear that!
I think bonding itself means to connect with the specific device. In the bonding process, they exchange the cypto keys. So next time it is available, then it is able to find and connect it.
Thanks

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 57 guests