# Is Bluetooth Communication Possible Without Pairing?

I'm working on a device which can wirelessly activate a system "instantly". The first thing which came to mind was to use RFID technology which has the advantage of instant and cheap communication. However, I am interested in using my phone's bluetooth capabilities to accomplish this task instead.

So my question is, to use Bluetooth communication, is there a way to communicate without pairing? In other words, at a very simplistic level, suppose my Bluetooth receiever is expecting a code "abc123". A Bluetooth device, like a phone, is programmed to constantly transmit this code. Upon receipt of the code, the system commences to do whatever its supposed to once access is granted. Such a system would remove the pairing barrier, of course, at the cost of security.

So is this concept a possibility? I have little understanding of Bluetooth link protocols at a very technical level, but if someone can give me a lead, I can start learning from that point. Do not consider my limited understanding a constraint.

-
There is a Bluetooth mode that does just that, but I don't know what it is called. It was used for sending local advertisments to passing mobile phones. –  jippie Nov 5 '12 at 20:00
There are various 433Mhz modules which will transmit an on/off signal "instantly"; often used in garage door openers. They're also cheap and easy to operate, although they don't provide inherent security. –  pjc50 Nov 6 '12 at 10:02

Yeah, it's entirely possible. I commented on this previously and have since looked into it further. You can have the triggering Bluetooth device send the activation signal through its friendly name.

The friendly name is the human-readable name that appears in the the list when you search for a Bluetooth device to pair with. The speed at which this activates depends on how quickly the receiving device polls for friendly names. You haven't mentioned what type of receiving device you're using but I found this PDF (Pg.35) detailing the process for updating the friendly names of in-range Bluetooth devices.

You can poll for friendly names as often as you require. If your triggering device changes its friendly name to the activation code, abc123, then the receiving device will be able to see that name without pairing and activate whatever task you're attempting to perform. This also allows you to have a multitude of activation codes, I think you can get up to 248 bytes for the friendly Bluetooth name.

You may also look into intentionally opening yourself up to Bluejacking. I'm not familiar with it, but if security isn't an issue it could work.

-
Perfect, this seems to be most promising. I like the simplicity of the friendly name method, and Bluejacking seems like a great candidate as well. –  capcom Nov 14 '12 at 22:49

This can be accomplished with a technology within the Bluetooth brand called Bluetooth Smart (or Bluetooth Low Energy / Bluetooth 4.0) And also depending on the phone you have.

The main benefit with Low Energy over regular Bluetooth is that it consumes a lot less power, and the expected lifetime of a device could be years depending on the connection interval, and how much it is advertising on a coin cell battery.

To solve this problem you can put the code in question inside the advertising data of the chip. (Bluetooth 4.0 Core Spec. Volume 3, Part C, Section 11.1.4 or 11.1.10)

There are 3 major chip manufacturer that produce Low Energy chips (TI, CSR and Nordic Semiconductor)

Nordic have a connectivity chip called nRF8001 (a connectivity chip, fully qualified device) and a SoC nRF51822. The benefit of using the nRF8001 is that you can use your processor of choice, and don't have to bother about the Bluetooth specification as this is handled by the chip. The benefit of nRF51822 is that it is a system on chip and reduces the BOM, it's running Cortex-M0 and should be fully qualified when released.

TI have the 8051 SoC chip cc2540 and CSR have the SoC chip CSR µEnergy

It all boils down to your need and and preference in processor and functionality/cost

-

The short answer is yes, it is possible to use Bluetooth without pairing. However, it is still going to always be a point-to-point link. There are also potential issues with not using pairing (mainly the lack of security and the lack of good support for this mode of operation). Whether it can be done depends on your receiver's Bluetooth hardware. I'm assuming you're using 'standard' Bluetooth instead of Bluetooth low-energy (which is completely different and not particularly well supported in mobile phones). If you're using low-energy then you're transmitter would be a low-energy device and you're receiver would be something that listens for the messages. I've not used this, so I can't give you any information on this so I'll stick with 'normal' Bluetooth.

As I see it, there are two issues to overcome:

1. Turning off pin pairing

2. Automatic connection initiation

I'll cover number 2 first as I get the impression that this is what you're really interested in (apologies if I'm reading this wrong). In order to do this from a phone or other 'master' device, it would have to continuously search for remote Bluetooth devices. When it recognised one that was applicable, it would automatically connect to it and send some data or other that would initiate whatever action was required. Others have mentioned the use of the Bluetooth friendly name for this process and that is certainly one way to do it. My experiences of Bluetooth friendly names (especially but not exclusively with the Microsoft Bluetooth stack) is that they are not that robust a method of scanning. You'd probably do far better to use the Bluetooth Device Class, which is broadcast at the same time as the unique device address. This device class has a large number of pre-specified entries for things like mobile phones, laptops, desktops etc etc. If you use one of the non-standard device classes (e.g. 00:00:00), you'll instantly be able to filter out the vast majority of Bluetooth devices. You can then connect to the remaining device and do some sort of request-acknowledge communication to initiate your action. If you make this suitably obscure (or check the friendly name as a second consideration), it should implicitly filter out any remaining incorrect devices.

Regarding number 1, pin pairing isn't particularly logical if you're creating transient connections, but it still may be the best way to achieve what you want to do. If you want to avoid pin pairing, it can be turned off and an un-paired connection can be made. How you do this depends on the Bluetooth receiver implementation, but here's a few examples:

1. Bluegiga WT12: use the command SET BT AUTH *
2. National Semiconductor LMX9838: use GAP_SET_SECURITY_MODE command with security mode 1 (no pairing)

etc.

Connecting to the device can then be done without pairing. If the device initiating the connection is the same as the receiver, this is very straightforward. If you're using a Windows PC, you can go through the laborious create a new connection process and choose "don't use a pin", although Windows will probably still ask you for a pin when you connect (0000 usually works, but it's very flaky). If you're using python with pybluez, it's very simple:

import bluetooth
sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((<insert MAC address>, <insert port number>))


If, however, you want to connect from a mobile phone, it gets much more complicated. The Android SDK doesn't seem to really support unpaired connections:

The current Android Bluetooth API's require devices to be paired before an RFCOMM connection can be established. (Pairing is automatically performed when you initiate an encrypted connection with the Bluetooth APIs.)

(from http://developer.android.com/guide/topics/connectivity/bluetooth.html). There are ways around this, but they're very complicated and not well supported. If you're using an iPhone, then Bluetooth connectivity is a whole different can of worms (licensing etc), so I'll leave that for now.

Having said all of that, pretty much every API I've ever looked at allows pairing and unpairing to be carried out (with the notable exception of python/pybluez, but that's just a wrapper around the Microsoft stack on Windows, so you can always call the low level function directly). So, when you've spotted a device with the right device class, why not just automatically pair (with a predefined pairing pin number), make the connection, send the data that's required, disconnect and then unpair. None of this would require any user intervention and as long as you're not doing it thousands of times (which could potentially cause issues with EEPROM wear), it shouldn't cause you any problems. It'll also save you a lot of hassle with trying to get different APIs to work well with what is perceived as a non-standard method of using Bluetooth.

-
Thanks for a superb response! A lot for me to look into now. –  capcom Nov 14 '12 at 22:48

Yes bluetooth communication is possible without pairing devices.Use insecureRfcom respect of secure rfcom.It does not require pairing for data transfer.

-