Can a master Bluetooth device use more than one antenna to connect to slaves? - bluetooth

I'm not sure how to correctly phrase this question, as I'm just starting to learn Bluetooth and its ways, but... imagine holding in an iPhone or Android phone in your hand in a large building with many rooms. You pair your device with a Bluetooth master device via an antenna in that room. Then once you move from room to room, your device communicates with other antennas throughout the building, but the device treats it as one pairing.
Is this at all possible? Was Bluetooth developed with this in mind at all?
Would this still work if the antennas were wireless? My idea is for devices to communicate with nodes via Bluetooth, and nodes interact with central base via wi-fi/local router.
Also, third random question: how does using BLE affect any of this?
Please tell me if I'm crazy! Thanks!

Bluetooth 4.0 BLE allows for a slave to connect to one master. 4.1 BLE allows for more than one connection, but I don't know if anything implements that yet.
Either way, there's no sort of "roaming" method pairing devices like with wifi access points with the same SSID. BLE however doesn't require pairing like regular Bluetooth, so you could just connect to a new access point each time you lose a connection.
You can also communicate via advertising packets from the "antenna" in each room. This would facilitate information being passed from those rooms to the phone, but not the other way around. This is basically how you communicate with BLE when you don't pair/connect devices and is how iBeacons work.

If you're writing the software yourself, and installing it in the building and on the phone, then I think it should be totally possible. Bluetooth devices can detect the distance and direction of other bluetooth devices. So if both devices are running software that is designed to, and grants permission to do so, it should be no-big-deal to programmatically auto-reconnect to the new nearest antenna whenever one becomes significantly closer than the one that your phone is currently connected to. As for software that already does this that you wouldn't have to develop from scratch yourself, no idea.

Related

Establish a connection between smartphone and PC via Bluetooth automatically

I'm trying to establish a connection between my PC running Ubuntu and my iPhone via Bluetooth automatically when it becomes available, after being manually paired beforehand. I've seen this to be possible with certain peripherals, mainly audio. For example, my phone will automatically connect to a Bluetooth speaker when it is turned on and Bluetooth is active on my phone; another example is my phone automatically connects to my car's radio system via Bluetooth when I turn the car on.
I'm not able to connect my phone to my PC without first initiating the connection from the smartphone's Bluetooth menu. I'm thinking that I could possibly write an application for the PC to attempt to connect to the device every few minutes or something, but it seems that the phone needs to be the device to initiate the connection.
The only information that I need for what I'm trying to do ultimately is that the devices can pair successfully. Essentially I'm trying to build a sort of proximity trigger between my phone and my PC without using Wi-Fi and GPS - I can't use these for some specific reasons.
Is there any way to make this happen?
Yes this should be doable as long as you use the Background Processing feature for iOS apps. In the example I'll give below, we'll have the PC be the peripheral and the phone be the central, but you can really have it working either way. You will need to do the following:-
First initial connection needs to be performed in the foreground (this is due to iOS's background limitations).
On the iOS side, you need an application that acts as a central that scans and connects to the remove device (check this example as a starting point).
Upon connection, you need to bond with the PC. Bonding is important as it will prevent you from having to do the pairing again in the future. However, pairing/bonding is managed by the iPhone's OS so you cannot write it in your application, so the workaround is to have an encrypted characteristic on the PC side that will force the iPhone to bond (this is covered later).
On the PC side, you need to have a BlueZ script that acts as a peripheral that is always advertising. You can do this using bluetoothctl (check the examples here and here).
Before you start advertising, you need to have a GATT server on the PC side (to do this, check this example).
When registering characteristics, ensure that one of them has the encrypt-read property (you can find a full list of the properties here).
Now when you attempt to read this characteristic from the iOS side, the two devices should bond (make sure that your PC is bondable which you can do this via these commands).
Once the devices are paired, your iOS app needs to be working in the background constantly scanning and attempting to connect to the same peripheral (have a look at this and this example).
You can find more useful information at the links below:-
Getting started with Bluetooth Low Energy
The Ultimate Guide to CoreBluetooth Development
How to manage Bluetooth devices on Linux using bluetoothctl

Is it possible to scan a bluetooth device to find it's capabilities

I am looking for a way to scan a device I own and discover "what it can do".
In other words, I'd like to know if a device is able to describe the way you have to communicate with it in order to build some application around it.
In my case it is a simple Christmas light that I'd like to play with but this could be used in different situations.
For classic bluetooth (BR/EDR):
When scanning for bluetooth devices (Inquiry), the bluetooth device will send an inquiry response (if it wants to be discovered) and maybe also an extended inquiry response (EIR). This EIR may already contain a list of services, the devices supports. This is a very fast way to get a picture of a remote device.
Moreover, the service discovery protocol (SDP) gives more information on a device. This takes some more steps. In SDP two devices can exchange their capabilites in kind of ping pong process.
For BLE:
After connecting a BLE device usually a service discovery takes place. The BLE peripheral (e.g. headset or a light) reports its capabilities to the central (e.g. smart phone). Some of these services have predefines functionalities. Additionally, it is free to the manufacturer to add custom services.

Is there a way to connect to iBeacon while my Bluetooth device is invisible?

I'm researching iBeacons. Can I connect to iBeacons while my Bluetooth is invisible (to be protected from hacks)?
I don't have beacons to test myself and can't find any clear explanation online.
iBeacons connect to mobile phones using Bluetooth, so it is essential to have that turned on. You also need to have installed an app with iBeacon support in order to receive communication from them.
If you'd wish to use a solution that does not utilize Bluetooth, you could try out IndoorAtlas. It's an indoor navigation technology based on Earth's geomagnetic fields. It's also completely hardware-free solution, just requires you to collect fingerprints in the area you are going to use for your project.
Three points:
iBeacon technology does not rely on a bluetooth connection to your phone. Beacons are one way transmitters. They do not listen to or otherwise receive any info from your device. Beacon technology following this model is inherently privacy friendly.
Mobile devices cannot detect Bluetooth beacons with the Bluetooth radio turned off. Sorry, it is just not possible.
Properly built beacon apps will not expose your mobile device's Bluetooth info because they are receive only. Of course, other apps on your phone might use bluetooth for other purposes, so your best bet is to audit apps using bluetooth and remove any that are not doing what you want.
I just bought some beacons and tested that, The answer is YES. it is possible to read beacons mac addresses while using the phone's Bluetooth connection as invisible. Using this you will get access to your beacon in any open place without getting hacked through Bluetooth.
Thanks all for your answers.

Bluetooth programming, interface implementation

I am not much experienced in bluetooth programming yet, but for my bachelor thesis I was asked to implement an interface for an blood presure monitor. In general this device is able to connect to other devices in order to share the data via bluetooth. It is also common licenced.
Now the Problem:
I have written an java program using bluecove to search for bluetooth devices. It works, but I can't find the device I want to. This blood presure monitor also has an button for activating pairing, which does not help either. Every time the device is getting new data (I measure my blood presure) it says on screen "transmitting data" so it trys to connect to an bluetooth device it knows.
Is there any special way I need to address it in order to get paired with it? So I would need to create an server waiting for this device to connect to, or is the general task impossible to handle?

Bluetooth UUID discovery

Does anyone know how a bluetooth device could pick up the discoverable devices' device IDs in range?
I am ideally looking for the simplest solution that involves the smallest implimentation of the bluetooth protocols.
A starting point would be good, I just wish to create a device that can store all the device ids of nearby bluetooth devices with minimal power consumption, preferably just using radio frequencies and not SDP and whatever else.
If you can't help me with this, please can you help me find good reading material for low level bluetooth (step by step) communication. The reading online is so high level that I cant work out what is actually sent, when.
Laalto nailed the answer from the Bluetooth spec/stack POV, but your question implies your looking for a stand-alone Bluetooth device - not just a laptop app scanning surrounding devices.
I can only speak for the BT chips that the company I work for manufactures (Cambridge Silicon Radio - CSR) but our chips can do that pretty much out of the box. Our chips have an on-board Virtual Machine sandbox that allows access to the firmware functions and Bluetooth stack of the chip. You can easily write a C code app to run in the virtual machine sandbox, on chip, that periodically scans for discoverable devices around, grab their ids and then download them when connected via USB or Serial, or maybe over BT when a device connects to the listener directly.
www.csr.com and www.csrsupport.com for chips, dev-kits, design references, etc.. etc...
You probably want a module with the extra HW (UARTs, USB etc...) as well as just the chip but you could implement this with something the size of a BlueTooth USB or probably smaller.
It would really help to know more about what your trying to achieve, why you want something that just scans the surrounding bluetooth devices and how big the device needs to be.
Sorry if this sounds like advertising. For balance: Broadcom make BT chips too!
The Bluetooth specs from http://www.bluetooth.org are a good starting place for low-level information. You need an account to access the specs, but you can create one for free.
Basically what you need to do is to go into Inquiry mode periodically and grab the response packets as they arrive. The more time you spend in Inquiry mode, the more likely you will discover devices in range: discoverable devices enter the Inquiry Scan mode only relatively rarely; it takes some time (10.24s at least with older Bluetooth versions) to scan all the possible frequencies in the Inquiry/Inquiry Scan frequency hopping schemes. And even then you can have suboptimal radio conditions.
For implementation I suggest you at least start with existing Bluetooth libraries such as BlueZ and do not attempt to create your own from scratch.

Resources