Code,  Embedded

Pairing Bluetooth with no pin on Intel Edison

It may seems strange for an IoT enabled device, but there's no obvious way to pair an Intel Edison through Bluetooth without accessing the shell.

I spent different hours to do something that with Bluez4 took at most 4 minutes, including the research on Google.

Here's what I did.

Edison provides Bluez5 that reworks most of the tools using DBUS, so to make two quite frequent actions, like pairing a device without providing user intervention on the device, and registering a new bluetooth RFCOMM service, you need to interface with it, that isn't so obvious from C or C++.

The second action can be done if bluetoothd is started with legacy support and using the usual sdp service.

Regarding pairing, you must add an agent that responds with a set of fixed responses, like fixed / predictable pin, authorization confirmation and so on.

Bluez5-testtools package provides a simple-agent python script that can be easily modified. It also provides the support script bluezutils.

You can find both on this link to GIST. Hope that helps.

%d bloggers like this: