Can I auto pairing and connect 2 BLE devices? - bluetooth-lowenergy

If I develop 2 BLE devices(not phone, not android), can I program them to auto pairing and connect?
Let's say, BLE A advertise BLE B, B authenticate A, B request connect to A, A and B connected, B is a master of A, A and B exchange data, A and B disconnect. The whole process without any human touch, is it possible?
If yes, how fast can it be from advertise to connected?

Yes you can, but for BLE there is no need for pairing, just connect or even send and read advertising data without connecting.
Set one device up as beacon or server.
The other device as scanner or client.
Finding a server or advertising device can be up to a few seconds, depending upon how many devices are in reach,
and the signal strength.
A connection can be established on average by 500 ms.
Advertising intervals depend on the devices used and how much data is send, but can be as short as 40 ms.
These numbers are based on my experience only, using a few android phones, my laptop, some esp32 boards and some HM10 devices.

Related

BLE/NRF52 - Connect two BLE-Centrals (Smartphone) with one Peripheral but receive the same notify signal?

I am planning to develop a small project with a NRF52 (or other BLE chip if that'd matter). Preliminary, I would like to know, if I can broadcast data without "abusing" the advertising bytes?
Scenario: Two smartphones connect with my device and they enable some notify-characteristic over which i would like to receive data with a potentially high frequency (up to 100Hz maybe) on both devices. (I know 100Hz is already close to the minimum 7,5ms or so that ble supports... just to say i wanna reach that limit basically and be as fast as possible with receiving)
So: if I connect two central devices, will they receive the same notify signal or will I have to send one for each central device, essentially lowering the max frequency at which i can receive data?
In the latter case, is the best way to broadcast ble data to multiple devices via the advertising bytes?
Kind regards, have a good one
When you use GATT notifications over BLE, the notifications are individual per connection. So if you want to send the same notification to two connected clients, the data is duplicated over the air. In general, all GATT traffic is individual per connection.
If you send one packet per 10 ms to two devices, that should be fine. Note though if one packet is lost, it will be resent during the next connection event and hence then two packes will be sent to that device (assuming you produce an additional packet after 10 ms as usual).
You can use advertising instead to broadcast data. Every device that scans can see your data. Data you send in ADV_IND can be seen by an unlimited amount of scanners.
If it's better to use advertisements or GATT to send data to multiple devices depends on a lot of factors. You should experiment what works best for you.

In BLE is there any limitation of Number of BLE devices interacting on Advertise / scan topology or what are the possible limitations?

Recently i have started working on BLE for a upcoming project. i will describe the overall system first.
We have a approx 100 BLE device placed in small compartment (all are within the radio range of each other), and have one central device / gateway which will also has BLE and wifi (within the range of all 100 BLE device). we want to update some small amount of data from all 100 BLE devices to cloud through central device / gateway and vice versa. So the question is :-
which BLE network topology would be best suitable for such application?
If i am going for ADVERTISE / SCAN topology, is it possible to collect the data of all the 100 BLE
device ?
For such number of device is over the air firmware update possible through single gateway ?
IS it possible that gateway can request each BLE device one by on and collect data ?
Basically is it possible to collect data of applox. 100 BLE devicesin connection less mode ?
As we are new to BLE development, correct me if my understating is wrong.
Thanks In Advance !!

Bluetooth Low Energy Profile/Service Selection

My requirement is as follows:
I need to send Proximity Sensor (Reed Switches/Magnetic Sensor) reading (On/Off) from two Input Pins to a central PC.
I need to use coin cell. So basically the app should be in sleep mode and once there is any interrupt on any of these two pins it should wake up to send its state to the central PC.
I have DA18450 chip and development board (murata ZY type) with me.
Dialog Semiconductor 18450
Murata Bluetooth Smart Development Board
I am a beginner to bluetooth technology and started reading about it just a week back.
Could someone guide me about the most apt Profile/Service suitable for my application?
If you want the device to actually sleep then it'd probably be best for it to just transmit data via advertising packets when the device awakens. Otherwise you have to maintain a connection which requires staying awake at some level. However, advertising packets are broadcast and the device can't know if anything received those packets (you could have it broadcast several times for a fixed period of time or have it constantly broadcast while the proximity alert is valid). Also, on the receiving end, with no connection there's no way of knowing the transmitting device is even there when nothing is being transmitted.
The advertising packets have a section for limited information and that's where you'd transmit data if you don't want to establish a connection.

Can a peripheral can be connected to multiple centrals?

From this book it says
A peripheral can be connected to multiple centrals.
can any BLE module do this? More specifically can bluegiga 112 do it? If not what are the BLE modules that can work as a peripheral connected to multiple devices?
The same book also states
Once the connection is established, the peripheral stops advertising and the two devices can begin exchanging data in both directions
so if the peripheral stops advertising how will it accept more connections as mentioned above? How will other scanners detect this peripheral?
Tim Tisdall is correct. That solution works for specification 4.1, but not for 4.0. As you mentioned above, you cannot establish a connection with a device that is not discoverable, and since it stops advertising upon connection establishment, it is impossible to have a peripheral connected to multiple centrals.
Any peripheral BLE device can "broadcast" it's attributes/characteristic values in GATT profile. So, any central device interested in the value can potentially "connect" to the BLE peripheral to get that broadcast message. So, that's what i believe is a use case for "A peripheral can be connected to multiple centrals."
I don't think the peripheral stops advertising it's presence just because it's connected to a certain central device. Any device can still see it's presence when it does a scan.

GATT service/characteristic structure for BLE application

I’m building an application in which a smartphone needs to communicate with a peripheral over Bluetooth Low Energy but I’m having a hard time coming up with the right GATT service/characteristic structure for this communication. The phone and peripheral need to communicate with each other over a “custom protocol” containing multiple send/receive messages. What I mean with this is that he phone will send something to the peripheral (step 1 of the protocol), which will respond to this by sending a message to the phone (step 2 of the protocol), which will respond to this by sending the next message to the peripheral (step 3 of the protocol), etc. until the protocol completes (after let’s say 10 steps).
Should I make a new attribute for every step of the protocol I want to execute, i.e. have the phone write to an attribute “protocol1” and have the peripheral notify the phone with an attribute “protocol2” after which the phone writes “protocol3”, etc. Or should I use only 2 attributes for this: one for the phone to write to (TX), and another one for the phone to read (RX) through notifications? It seems that BLE (instead of Bluetooth 3.0) wasn’t really made for this kind of RX/TX communication, or am I wrong?
Two Characteristics, one for TX and one for RX should be enough.
Use Characteristic Write for TX and Characteristic Indication for RX.

Resources