DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Scaling Salesforce Apps Using Heroku Microservices - Part 2
  • Connecting the Dots: Unraveling IoT Standards and Protocols
  • What Is IoT Gateway? Is It Important
  • How to Get Started With the Smart Parking

Trending

  • Scaling InfluxDB for High-Volume Reporting With Continuous Queries (CQs)
  • Analyzing “java.lang.OutOfMemoryError: Failed to create a thread” Error
  • How to Convert Between PDF and TIFF in Java
  • The Role of Functional Programming in Modern Software Development
  1. DZone
  2. Data Engineering
  3. Data
  4. IoT Testing for the BLE Protocol

IoT Testing for the BLE Protocol

Bluetooth Low Energy is a great protocol for IoT devices that rely on limited power supplies. However, testing devices at scale is a problem, but one we'll try to solve.

By 
Uzi Eilon user avatar
Uzi Eilon
·
May. 03, 17 · Tutorial
Likes (0)
Comment
Save
Tweet
Share
10.8K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, I would like to focus on BLE (Bluetooth Low Energy) devices. The BLE protocol is based on Bluetooth v.4.0. With low power consumption, devices can run on a small battery for five years.

The healthcare and lifestyle market is very advanced in regard to IoT apps. BLE sensors can measure any parameters from any person, showing the data directly on a mobile device, which also analyzes the data and suggests the different actions that need to be taken based on said data.

The application types vary from heartbeat data during sporting activities to the glucose level in diabetes patients. This IoT solution certainly encourages people to play more sports, but it can also improve the quality of life of diabetes patients. 

The following figure shows the data flows between an IoT device connected to a person via a mobile app to the backend server.

IoT Testing for BLE Protocol

The medical data is collected by the IoT device and sent via BLE to the mobile app. The app aggregates the data and sends it to the server — and also can control the BLE device by sending BLE requests. The doctors can query their patients’ data remotely – almost in real time – and get notifications of critical situations.

BLE Protocol

The BLE protocol is based on GATT (Generic Attributes) and defines the way that two Bluetooth Low Energy devices transfer data using the concepts of Services and Characteristics.

The data is stored in a simple lookup table with an id for each entry. The protocol defines the READ, WRITE, and NOTIFY actions for these entries.

The protocol defines generic characteristics but also allows us to define private characteristics, which require specific code in the BLE device and the monitor app.

BLE Pairing

Like standard Bluetooth protocol, BLE requires pairing. But in this case, it is done automatically.

The BLE device broadcasts its service, and the device that receives the broadcast can ask to connect.

Generic devices accept the connection, whereas other devices will not accept the connection without an authentication handshake mechanism, based on setting predefined private characteristics with a unique key.

After pairing, the devices can exchange data based on the characteristics and the allowed actions using the UUID of the table entries.

Data Flows Over BLE Protocol

The data flow is based on the actions and the characteristics values. For example, here are the heartbeat devices and mobile device data flow (after pairing):

BLE Protocol

IoT Testing BLE Challenges

There are a large number of challenges to developing and testing IoT mobile applications:

  • Most of the tests have to be done manually and require some form of connection between the IoT device and a real person.
  • The IoT and mobile devices should be in the same location, with a manual interaction to connect between them.
  • It takes more time to develop the IoT HW device, and you cannot parallel the application (SW) and the IoT device’s development and testing.
  • The testers cannot control the data sent from the IoT device to the mobile app and set any predefined validation.
  • Health devices and applications require FDA approval. That means large numbers of proven tests on a large number of devices.
  • In the case of offshore testing, it is always a challenge to send and manage the devices at remote sites.

Let’s take an example of a heartbeat device connected to a finger and send the heartbeat to a mobile app.

The app/device tests required:

  • Person/tester  (With heartbeat and finger, preferably) 
  • Mobile devices
  • IoT device

IoT Testing For a Heartbeat Device

This process cannot be automated – it cannot be scaled.

IoT Testing for BLE

Our solution goals are to:

  • Automate the test process.
  • Access all the mobile devices in the cloud.

The solution is a SW visualization of BLE devices in the cloud.

It allows the user to define and update the characteristics and the services. The services support APIs and are controlled by automation scripts.

At Perfecto, we selected this solution for the following reasons:

  • It is fully controlled by SW – key for automation.
  • It is located in the cloud near the devices.
  • It acknowledges generic characteristics and can be virtually any device
  • Multiple threads
  • Works on real RF channels
  • Allows data to be set by the tester
  • Connects to any automation framework.

How Does It Work?

A new BLE server is added to the lab. This machine contains up to 20 BLE dongles. For each dongle, the machine can set a virtual BLE device. The automation server controls both the IoT and mobile devices and allows us to develop a full scenario in an automation script.

IoT Testing for BLE Protocol

Each BLE service is configured by an external JSON file. The file defines the services. Based on the JSON file, a new visual BLE service started and exposes BLE data.

IoT Testing for BLE Protocol

The mobile device receives the data over the RF channel (standard BLE HW on a phone), and it works like it arrived from real BLE devices.

The last part of the solution is the commands, which are added to the automation system and allow us to start, stop, and change BLE servers and data from the script.

This solution allows the execution of unattended automation from the CI and to test BLE mobile apps.

Summary

BLE devices are one part of the wide topic named IoT. In this article, I described the BLE protocol and the communication layer of the BLE.

I showed how Perfecto virtualization tools overcome the development and testing challenges. In the next article, I will focus on Amazon Alexa and Google Home. I will describe the Alexa skills development and automation processes.

IoT Protocol (object-oriented programming) mobile app Data (computing) Database

Published at DZone with permission of Uzi Eilon, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Scaling Salesforce Apps Using Heroku Microservices - Part 2
  • Connecting the Dots: Unraveling IoT Standards and Protocols
  • What Is IoT Gateway? Is It Important
  • How to Get Started With the Smart Parking

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!