Tuesday, August 19, 2014

RFduino and Bluegiga’s BLED112


Last December I found that my local MicroCenter had the RFduino in stock and as I am interested in low energy wireless I purchased one.  Using a Sparkfun FTDI 3.3V and a customer cable I built I was able to download sketches to it.  This work is documented in my Worked For Me – RFduino post.

After setting up the Arduino IDE as described on the RFduino website I was able to successfully compile and download the AdvertisementContinous example and scan for the results on my Nexus 7 table using the BLE Explorer Scan application.

After this success the next step was to develop a simple program to receive data from the RFduino via BLA.  As I am much more comfortable with C rather than Java I decided to get a simple C program up and running before I tackled Android.

This started me down what turned into a multi-month side trip.  As Windows 7 doesn’t support bluetooth low energy with the regular bluetooth driver I decided to use Linux.  Unfortunately while Linux does support BLE getting it to work was rather involved.  After several false starts I was able to make some progress with gatttool which maybe some day I will post.

I had come across Bluegiga’s BLED112 Bluetooth USB dongle which at a high-level conceptual level is a BLE device that connects via USB with a COM port interface.  Bluegiga supplies a simple SDK, BGLIB, in C that allows you to interface via the COM port to the BLE device.  Given the progress I wasn’t making I decided to purchase one from Mouser to see if I could make faster progress.

After two weeks I can say I am very happy with what I have been able to achieve.  I have successfully been able to send information from the RFduino to my Windows 7 PC using BGLIB via BLE from a C program compiled with MINGW32 included in Code::Blocks 12.11.  I am using the 1.2.2-100 version of the SDK with some minor changes due to the way MINGW32 handles packed data on Windows.

I plan to post some detailed examples in the next couple of weeks.

No comments: