Page 1 of 1

Persistent BT recognition of a cellphone (or other device)

Posted: Tue Oct 21, 2014 12:29 am
by StaticDet5
I'm running Raspbian. I don't consider myself advanced (Though I've written a couple of I2C libraries...)
Still, this seems like a very basic problem.

I've paired and trusted my phone using bt-device and bt-adapter.
Once I do this, and my phone leaves discovery mode, the R-Pi can no longer see my phone. It is still paired and trusted (Verified).
I've set up and run "btminder" by Douglas6 (http://www.raspberrypi.org/forums/viewt ... er#p601421), which seems to be running without issue. However, it's not registering an event with the phone when I bring it in and out of range.

What I want is for my phone to automatically connect to my R-Pi whenever it is in range. Eventually I want to be able to measure the strength of the bluetooth connection with my R-Pi and log it, without any interaction on my part.
Am I deluded about how bluetooth works? (Here's the "Beginners" question!)

I pulled down Py-Bluez, but I wanted to get the basics working on their own, before I started mucking around. Am I doing it wrong? Should I just start getting into the muck?

Re: Persistent BT recognition of a cellphone (or other devic

Posted: Tue Oct 21, 2014 3:04 pm
by Douglas6
Btminder will only alert you if a connection is made (or lost), not just the presence of a device in range. So if you connect to the Pi from the phone, btminder should alert; if you turn off Bluetooth on the phone, and then turn it back on, the phone should try and reconnect, and btminder will alert. I assume that works for going in and out of range as well, but the device must be connected, and must automatically try to reconnect.

If you just want to find a device in range, you can use l2ping, but you'll need to know the BT address of the device(s). There's a good discussion on mikerr's topic here: http://www.raspberrypi.org/forums/viewt ... 37&t=47466. You can also get the RSSI (signal strength) of the device with

Code: Select all

hcitool rssi AA:BB:CC:DD:EE:FF
but you also need to be connected to do that. There's some Python code in that thread to automatically connect from the Pi, so that's an option.

Re: Persistent BT recognition of a cellphone (or other devic

Posted: Tue Oct 21, 2014 3:46 pm
by StaticDet5
So if the device is paired, it is not necessarily going to try to connect whenever it is within range? I thought that was one of the potential security liabilities of BT, that it was constantly checking to see if it could connect to devices when it comes within range of it?