Message Boards Message Boards

Accessing data from Bluetooth Low Energy devices in Mathematica

Posted 12 years ago
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
4 Replies

Any body else working on this? I watched the virtual conference and the section of interconnected devices. I used to have a couple of BLE peripherals bringing data into a Mathematica, but after the conference I uncovered they do not work any more.

Would like to have input as to where to find documentation regarding BLE implementations in Mathematica. Some examples and tutorial would be great.

POSTED BY: Salvador Romo
Posted 11 years 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: Joe Fusion
Posted 11 years 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
github currently down for me... WIll try later!
POSTED BY: C ormullion
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract