Sunday, September 7, 2014

Accessing an RFduino using BLE GUI

I was asked how you would access the RFduino using the BLE GUI.  Below are step by step instructions that worked for me.

RFduino Setup

Open the Temperature example sketch in the Arduino IDE and compile and load the sketch.

Reading a Value from the RFduino

Run the BLE GUI software.  This can be done via the icon on the desktop or through the program menu.

When the software runs it will display a windows as shown below.


The software should have the COM port that was installed listed as shown in the first red circle.  As long as the right COM port is showing the next step is to select the Attach button as shown in the second red circle.  I was able to use the default baud rate.

When you are successfully connected the Attach button should change to a Detach button and next to the button should be a green Connected as shown below.


After you successfully connect to the BLED112 you should select the Start button to start scanning.  The GUI should update and list your RFduino device as shown below.  I only have one BLE device so I am not sure how it would look if you had multiple devices that were all broadcasting.


The log window will also show results of the scan.


Next you should select the Connect button to connect to the RFduino.


Once you are connected the Connect button will change to Disconnect and you should select the GATT button.


When the GATT button is selected it will update the GUI including additional commands and a window where the results will be shared.  You should select the Descriptors Discover.


The GUI will update and show all the descriptors it found on the RFduino.


You can scroll down and select Handle 14.  By selecting the Read button you will read data from the RFduino.  In this case it will be the core temperature.


The GUI will update with the Raw value stored at Handle 14 and will also print the result in the log window.


You have now successfully read the RFduino via your BLED112.

You will want to select the Disconnect button to disconnect from the RFduino and the Detach button to disconnect the GUI from the BLED112.

Thanks to Bluegiga and RFduino for their products and documentation.  If you find something that doesn’t work for you or you have questions please post them as comments and I will get back to you as soon as I can.

Saturday, September 6, 2014

My Take on the RFduino Temperature Example for Windows 7

One of the examples that comes with the RFduino is an example which reads the RFduino’s core temperature via BLE.  This is my take on that example running under Windows 7 using the BLED112 and BGLib.  The output is just text and not the nice graphics of the IOS RFduino example but it should get the idea across.

One change I made to the sketch running on the RFduino is to only update the temperature if it changes.  This allows the program running on the Windows PC to set the notify attribute and have the RFduino send a notification with the new temperature when it changes.

I found this program not a really good example of using notify because the core temperature doesn’t appear to change too often.  However, it shows all the steps necessary to utilize the notify BLE feature with the RFduino and BLED112.

The code for this example can be found on GitHub in the dhRFduino repository under digitalhack.

For a step by step example of getting this to run under windows see the post on RFduino and BLED112, Putting It All Together but substitute the TemperatureExample sketch and windows program for the ReadValueExample sketch and windows program.

This example uses a soft reset for the BLED112 and has timeouts implemented in a slightly different way than the ReadValueExample.

As always I hope you find this helpful and thanks to Bluegiga and RFduino because without their products none of this would be possible.

If you find something that doesn’t work for you or you have questions please post them as comments and I will get back to you as soon as I can.