Bluetooth Scanning Script
Here’s a brief description of my situation.
I have a scavenger hunt for class. I’m looking for these electronic units scattered all over the campus. Each unit has a Bluetooth device attached to it. I’m going to walk around on foot and will need my phone (Nokia N900) to scan for all Bluetooth devices and to alert me with a beep when this “specific” Bluetooth device comes into range. Once I know this unit is within range I have to try to figure out where it is and retrieve the information on it. Then repeat.
This is what I’m working with:
- Nokia N900, Linux Based Smartphone
- Roving Network’s Bluetooth SMD module RN-41 [url removed, login to view]
The RN-41 module is attached to each of the electronic unit I’m looking for. It has a mac address and a device name “firefly-abcd”; where “FireFly” is the type of Roving Networks device and “ABCD” is the last four nibbles of the Bluetooth MAC address. This is the “specific” Bluetooth device I’m looking for.
I got my Bluetooth scanning idea from this video: [url removed, login to view]
I need the script to:
1. Scan for Bluetooth Device
2. Loop and scan for “x” second intervals
X being adjustable from 15 seconds to 5 minute intervals
3. Be able to alert me (with a beep or noise) when a “firefly-abcd” Bluetooth device is in range
4. Write to a [url removed, login to view] file (similar to the youtube video)
This should give me a list of all the Bluetooth Devices that my phone picked up and List it with time,
date, mac address and device name. Ideally, it would only list "unique" device names so the
[url removed, login to view] file doesn’t get too big with repeat device entries. I would also use this file to see if
the “firefly-abcd” device did come up but didn’t alert me
5. Be efficient with the battery life.
Because i’ll be scanning every 10-15 second intervals while I walk around campus. I don’t want to
go home too often to recharge the phone.
6. If Possible, have the Bluetooth sensitivity adjustable so i can better the range of finding the units. Instead of
being within 10 meters before my phone beeps to alert me. I can narrow it down to being within 3 meters... etc.
Think that's about it... And be done before December 30, 2011