Geekblok

B10m, BOK, Joffie - old geeks on a blog

Entries Comments



Fun with bluetooth

31 January, 2008 (22:23) | fun, security, technical | By: Joffie

blueproximity logo

Last week I finally got a telephone with bluetooth. As my laptop also as a bluetooth dongle in it, I thought I should be able to do some geeky things with it.
My thoughts were correct: my screensaver is now working, based on the proximity of my telephone. As soon as my phone leaves the desk, the screensaver kicks in and locks the screen. When it is back in the proximity of the laptop, the screen magically unlocks.

Though I am very aware that this really is no good from a security point of view, it is just cool.

I’ll describe what I have done to get this to work. My phone is a Nokia 6151 and the laptop is running Ubuntu desktop.

The first things I apt-got where:
  • bluez-gnome
  • bluez-utils
  • gnome-bluetooth
From the website of blueproximity, I downloaded the 1.2.1 version.

First thing that needs to work on the laptop is hcitool, that is coming from bluez-utils:

$ hcitool scanning Scanning …
00:68:C2:B6:3A:05 Nokia 6151

If that works you are ready to go. If it does not work, you’ll need to get your bluetooth device in the computer working. Most likely it is just starting the bluetooth service.

After starting the bluetooth daemon service I started up (in X) bluetooth-applet. From the phone it is now easiest to create the connection to the computer. On the screen you’ll get a request window to pair to the telephone with a certain pin. This pin needs to be the same as on your phone and you should be connected now.

That is basically most of it. Now you can startup blueproximity and configure it to lock and unlock the screen at will of the distance of your phone from the computer.

As the normal xscreensaver does not have a command for unlocking your screen (though a kill will probably work) it is best to use gnome-screensaver-command. That one has the -d option to stop the screensaver.

There is still room for improvements of the current setup: I’d like to monitor multiple bluetooth devices. I know my boss also has phone that has bluetooth enabled all the time. It might not be too bad to receive a popup once he gets closer. At the moment blueproximity only works with one fixed configuration file. But, by the looks of it, it is already on the feature request site.

Another thing I was thinking of is to get the sonar screensaver to show the distance of the device. Sonar has the -ping host-or-subnet option. It should not be too hard to have it start another program that shows the distance of the bluetooth device.

Comments

Comment from Leon
Time: January 31, 2008, 10:38 pm

Cool, very curious about the results. As i have an proximity sensor at the office, which sends a message (or daily, or continous) to all the mobile phones which appear in its range.

Used as a marketingtool in the past… bluetooth is full of potential for all kind of things.

Comment from B10m
Time: January 31, 2008, 11:28 pm

Very impressive. Time for me to get a new phone … with bluetooth! :)

Comment from Lars Friedrichs
Time: February 10, 2008, 10:03 pm

Hi there,

I see you like my program. Nice to hear that. I have little time at the moment so the detection of more than one device will take some time (likely to be done after my exams that end mid of march) but sure the beast is not finished yet. Lots of people have great thoughts. If you can imagine another interesting use case please let me know. I am collecting these at the moment and put them in the sourceforge forum.

Bye
Lars

Write a comment





Preview: