Overview

I recently started working on a new project that involves BLE (Bluetooth Low Energy). I quickly realized I need a fast way of validating/testing connectivity between two BLE devices. Specifically, my application required a BLE connection between my PC and a test device – and like any modern 21st century human, I googled it.  Luckily I stumbled upon a solution that was definitely worth sharing, hence this blog.

Introducing.. the BleuIO Dongle from Smart Sensor Devices AB, a company based in Sweden specializing in smart sensors and devices. Check out their Youtube channel here.

This is a pretty sweet solution that could really help you speed up your BLE application development – suffice it to say that it was definitely made for developers. There is a nice library of scripts, tutorials and utilities to really help you hit the ground running. I definitely had a plug and play experience, which is something I truly appreciate as a developer.

They’ve made some pretty nice tutorials on their website, so I won’t waste precious time repeating information; however we’ll take a look at a specific application of  the Dongle.

Here is the setup used for this test:

Test setup for BleuIO dongle evaluation

To test connectivty with this setup, you need to

  • Upload example code from the NRF5SDK.
  • Use a terminal application, such as Putty, to send AT commands to the dongle.

We’ll go into details in a moment.

In this specific setup, it is critical to understand the GAP (Generic Access Profile) roles of the two devices:

  • The Dongle acts as a Central. As such, it is responsible for intiating the connection.
  • The NRF52840 DK acts as a Peripheral – it has data to expose and let’s the world know it’s there by advertising itself.

To get a concrete understanding of these roles, feel free to consult this article/video.

And of course you’re welcome to get in touch if you need to discuss the subject in detail.

Setup Dongle

To setup the dongle, simply plug it in one of the available USB ports on your PC.  Within a few seconds, it’s automatically installed and you can access it via a serial/COM port; you’d have to open up Device Manager (if you’re using Windows) to see what port the dongle is using.

Now you can open up a terminal application like Putty or Tera Term and connect to the serial/COM port. Required settings:

  • Speed (Baud rate): 57600
  • Serial Port: 8N1 (8 data bits, No stop bits, No Parity, No Flow Control, 1 Stop Bit).

With the serial port open, you can send an AT command to verify the dongle works. You should see OK.

And then more importantly, the dongle needs to be configured to be a Central device (it is a Peripheral by default).

 

  •  Enter the ATI command to see its current config. Based on the response you’ll see it is configured as a Peripheral.
  • Enter the AT+CENTRAL command to configure the dongle as a Central device. Verify status with ATI command.

And that’s it! The dongle is good to go! It’s that simple.

Refer to the AT commands reference guide here.

Now we need to set up the example BLE code.

Setup Test Code

For our test, we’ll be using the Nordic NRF5 SDK.  This SDK contains a rich collection of examples to get you started. For this particular test, we’ll be using a slightly modified version of the BLE App Heart Rate Sensor Peripheral example (the ble_app_hrs project can be found in the examples/ble_peripheral folder in the SDK).

You need to download and install Segger Embedded Studio (SES) to try out the project.

To quickly get started, check out the example code repo on my GitHub page. To run the example project:

  1. Go to download location > bleuio_dongle_test > ses .
  2. Open bleuio_dongle_ble_test.emProject using Segger Embedded Studio.
  3. Start a debug session (this automatially compiles the code). On the menu bar go to Debug > Go.
  4. The NRF52840-DK should now be flashed with the example code.
  5. You will observe that LED 1 on the DK is flashing. This indicates it is advertising.

To verify the code is running, observe the Debug output in the Debug Terminal (in SES):

A BLE device in the peripheral role advertises itself. In this example, the device is advertising itself using the name KnightRider. We’ll be using this later.

Now that both the device and dongle are ready, let’s test out basic BLE functionality.

 

Basic BLE functionality Test

Finally we can perform basic BLE functionality tests. We will cover 2 very basic areas:

  • Advertising
  • Connecting (not pairing)

 

Advertising

From the Putty Terminal, send the AT command AT+GAPSCAN=X (where X is the scan duration in seconds). This returns a list of detected Bluetooth/BLE devices.
As you can see, KnightRider is alive and kicking:

 

Connecting

To connect to KnightRider, enter the command AT+GAPCONNECT, followed by the address type and device address. See AT command reference guide for details.

In a second or two, you’ll see something like this:

Conclusion

We’ve looked at how we can use the BleuIO dongle for doing basic BLE connectivity tests. It proves to be a very handy tool for developing BLE projects. With Python and Javascript libraries available at your disposal, there’s no limit to what you can do with this dongle.

I am developing a full course on the academy – where you can learn about kickstarting BLE development projects. Stay tuned.

This website uses cookies. By continuing to use this site, you accept our use of cookies.