Group Abstract Group Abstract

Message Boards Message Boards

Accessing data from Bluetooth Low Energy devices in Mathematica

GROUPS:
I'm developing a package for connecting Bluetooth LE/Smart/4.0 devices into Mathematica and thought I would post a link to it. Right now it wraps the Mac OS X Core Bluetooth Library (sorry, Windows users) and makes many of its functions available from within Mathematica. On top of those functions, I've written a system for auto-detecting and parsing the raw data from recogized services that the device advertises. The notebook in the repository explains how to use the package in more detail, but here's a preview:

This command discovers all BLE devices in the vicinity and returns a List of their names:
devices = BLEDiscover[];

This connects to the first device in that List:
BLEConnect[First[devices]];

This dynamically updates a List of parsed data from the device as it's detected and received:
Dynamic[BLEDeviceData[First[devices]]]

One of the reasons I'm posting this is for feedback. I'd love for people to try out the package and share their successes and failures. Contributors welcome!
POSTED BY: Phil Ngo
Answer
1 year ago
github currently down for me... WIll try later!
POSTED BY: C ormullion
Answer
1 year ago
Is there any chance of an update to this, Phil?

I'm trying to use this code, on OSX 10.8 with Mathematica 9. I had a couple brief successes yesterday, but mostly the notebook wouldn't execute, and that's all I can get today. I load the library and do BLEDiscover[], and it silently crashes the kernel, so that I have to reload the library. Any suggestions on what the problem could be?

Thank you!
POSTED BY: Joe Fusion
Answer
8 months ago
A follow-up:

I'm able to load the library and connect to a device again, though I don't believe I changed anything. My current guess is that I need to pause between loading the library and calling any other functions.

I can run BLEDiscover, then BLEConnect. Both BLEDeviceData[] and BLEDeviceRawData[] return lists of rules. Beyond that, I can't get anything to work. BLEDeviceInformation[] returns "BLEAutoConnect`Private`$serviceData". I can't figure out how to get any of the "BLEdiscover..." methods to work, using any of the ID values from BLEDeviceRawData.
POSTED BY: Updating Name
Answer
8 months ago