Detecting Bluetooth Devices and Notifying Them via SMS
March 11, 2009 – 12:27 pmSay you’re having a party and want to send guests a welcome message when they arrive, or you want to notify your employees as soon as they walk into the office about a last minute meeting. It is quite easy to detect Bluetooth devices in your area and send text messages to them using Processing, Textmarks, PHP and MySQL. The hard part is associating a Bluetooth ID with a phone number and making sure devices have Bluetooth enabled.
The easiest way to do this would be to use OBEX to push the device’s Bluetooth ID to itself in the form of a message and instruct the user to forward that message to 41411 + keyword (of course, the device’s Bluetooth still must be turned on). That way the user has to do no signing up or digging around for their Bluetooth ID. You can parse the ID and store it along with the corresponding phone number. Then the device will receive subsequent messages when it is detected by the app.
Here are a couple files to get you started. The Processing file is modified from the bluetoothDesktop library to include a HTTP request to the script that checks the database for devices and sends messages. You will also need Textmarks class files.
