ThoughtWorks
  • Contact
  • Español
  • Português
  • Deutsch
  • 中文
Go to overview
  • Engineering Culture, Delivery Mindset

    Embrace a modern approach to software development and deliver value faster

    Intelligence-Driven Decision Making

    Leverage your data assets to unlock new sources of value

  • Frictionless Operating Model

    Improve your organization's ability to respond to change

    Platform Strategy

    Create adaptable technology platforms that move with your business strategy

  • Experience Design and Product Capability

    Rapidly design, deliver and evolve exceptional products and experiences

    Partnerships

    Leveraging our network of trusted partners to amplify the outcomes we deliver for our clients

Go to overview
  • Automotive
  • Cleantech, Energy and Utilities
  • Financial Services and Insurance
  • Healthcare
  • Media and Publishing
  • Not-for-profit
  • Public Sector
  • Retail and E-commerce
  • Travel and Transport
Go to overview

Featured

  • Technology

    An in-depth exploration of enterprise technology and engineering excellence

  • Business

    Keep up to date with the latest business and industry insights for digital leaders

  • Culture

    The place for career-building content and tips, and our view on social justice and inclusivity

Digital Publications and Tools

  • Technology Radar

    An opinionated guide to technology frontiers

  • Perspectives

    A publication for digital leaders

  • Digital Fluency Model

    A model for prioritizing the digital capabilities needed to navigate uncertainty

  • Decoder

    The business execs' A-Z guide to technology

All Insights

  • Articles

    Expert insights to help your business grow

  • Blogs

    Personal perspectives from ThoughtWorkers around the globe

  • Books

    Explore our extensive library

  • Podcasts

    Captivating conversations on the latest in business and tech

Go to overview
  • Application process

    What to expect as you interview with us

  • Grads and career changers

    Start your tech career on the right foot

  • Search jobs

    Find open positions in your region

  • Stay connected

    Sign up for our monthly newsletter

Go to overview
  • Conferences and Events
  • Diversity and Inclusion
  • News
  • Open Source
  • Our Leaders
  • Social Change
  • Español
  • Português
  • Deutsch
  • 中文
ThoughtWorksMenu
  • Close   ✕
  • What we do
  • Who we work with
  • Insights
  • Careers
  • About
  • Contact
  • Back
  • Close   ✕
  • Go to overview
  • Engineering Culture, Delivery Mindset

    Embrace a modern approach to software development and deliver value faster

  • Experience Design and Product Capability

    Rapidly design, deliver and evolve exceptional products and experiences

  • Frictionless Operating Model

    Improve your organization's ability to respond to change

  • Intelligence-Driven Decision Making

    Leverage your data assets to unlock new sources of value

  • Partnerships

    Leveraging our network of trusted partners to amplify the outcomes we deliver for our clients

  • Platform Strategy

    Create adaptable technology platforms that move with your business strategy

  • Back
  • Close   ✕
  • Go to overview
  • Automotive
  • Cleantech, Energy and Utilities
  • Financial Services and Insurance
  • Healthcare
  • Media and Publishing
  • Not-for-profit
  • Public Sector
  • Retail and E-commerce
  • Travel and Transport
  • Back
  • Close   ✕
  • Go to overview
  • Featured

  • Technology

    An in-depth exploration of enterprise technology and engineering excellence

  • Business

    Keep up to date with the latest business and industry insights for digital leaders

  • Culture

    The place for career-building content and tips, and our view on social justice and inclusivity

  • Digital Publications and Tools

  • Technology Radar

    An opinionated guide to technology frontiers

  • Perspectives

    A publication for digital leaders

  • Digital Fluency Model

    A model for prioritizing the digital capabilities needed to navigate uncertainty

  • Decoder

    The business execs' A-Z guide to technology

  • All Insights

  • Articles

    Expert insights to help your business grow

  • Blogs

    Personal perspectives from ThoughtWorkers around the globe

  • Books

    Explore our extensive library

  • Podcasts

    Captivating conversations on the latest in business and tech

  • Back
  • Close   ✕
  • Go to overview
  • Application process

    What to expect as you interview with us

  • Grads and career changers

    Start your tech career on the right foot

  • Search jobs

    Find open positions in your region

  • Stay connected

    Sign up for our monthly newsletter

  • Back
  • Close   ✕
  • Go to overview
  • Conferences and Events
  • Diversity and Inclusion
  • News
  • Open Source
  • Our Leaders
  • Social Change
Blogs
Select a topic
View all topicsClose
Technology 
Agile Project Management Cloud Continuous Delivery  Data Science & Engineering Defending the Free Internet Evolutionary Architecture Experience Design IoT Languages, Tools & Frameworks Legacy Modernization Machine Learning & Artificial Intelligence Microservices Platforms Security Software Testing Technology Strategy 
Business 
Financial Services Global Health Innovation Retail  Transformation 
Careers 
Career Hacks Diversity & Inclusion Social Change 
Blogs

Topics

Choose a topic
  • Technology
    Technology
  • Technology Overview
  • Agile Project Management
  • Cloud
  • Continuous Delivery
  • Data Science & Engineering
  • Defending the Free Internet
  • Evolutionary Architecture
  • Experience Design
  • IoT
  • Languages, Tools & Frameworks
  • Legacy Modernization
  • Machine Learning & Artificial Intelligence
  • Microservices
  • Platforms
  • Security
  • Software Testing
  • Technology Strategy
  • Business
    Business
  • Business Overview
  • Financial Services
  • Global Health
  • Innovation
  • Retail
  • Transformation
  • Careers
    Careers
  • Careers Overview
  • Career Hacks
  • Diversity & Inclusion
  • Social Change
IoTTechnology

Introduction to Bluetooth Meshes

Holly Bowen Holly Bowen
Lauren Fitzgerald Lauren Fitzgerald

Published: Nov 8, 2016

As the producer behind software conference QCon, C4Media regularly collects feedback from attendees to improve the quality of conference content. They came to ThoughtWorks with an exciting challenge: How could they use custom hardware to collect more meaningful feedback in real-time?

Our solution: a large number of interactive wearable devices, connected via a self-healing Bluetooth mesh network. Using Bluetooth gave us fast, flexible, and reliable collection of data in a complex conference environment.

Since the typical use case of Bluetooth involves one-to-one device pairing—such as an external audio speaker paired with your phone—the groundwork for building a stable mesh containing multiple devices has not been standardized across the industry. This led our team to experiment with various mesh algorithms and Bluetooth connectivity protocols during this project.

This series of articles details what we learned while developing our mesh product for C4Media. This first article focuses on the basics of Bluetooth. How exactly does it work? What do we mean by a “mesh network”, and how can we use the built-in features and connection protocols of Bluetooth to create a mesh?

The basics of Bluetooth connections

One key component of the Bluetooth protocol stack is GAP, or the Generic Access Profile. GAP governs how Bluetooth devices scan, advertise, and connect to their peers. It also defines specific roles that devices perform during this process. A single GAP connection is comprised of a central device and a peripheral device. The role of the central device is to scan for compatible peripherals and to initiate a connection with a chosen target; the role of the peripheral device is to advertise itself to any nearby centrals and to accept incoming connection requests.

This dynamic resembles a “parent-child” relationship; the central device acts as the parent, determining which child (peripheral) to connect to. This extra responsibility means that central devices typically require slightly more processing power than peripherals, which is why you will usually encounter smartphones and laptops playing the central role in a connection, and simple sensors or beacons playing the peripheral role. Every device must play one of these two roles when connecting to a peer, and every peer-to-peer connection must include one central and one peripheral. In other words, there is no such thing as a central-to-central or peripheral-to-peripheral connection.


 

The GAP protocol also defines some additional roles (“broadcaster” and “observer”), which are utilized when no direct connection is desired between devices. Due to various requirements of our application—data security and privacy, real-time tracking of device states, etc.—we chose to use the connectable “central” and “peripheral” roles, and will be concentrating on their features and usage for the rest of this article series.

The first release of Bluetooth Low Energy (also known as BLE, or Bluetooth 4.0) imposed the restriction that an individual device could perform only one GAP role at any given time. A device may act as either a central or a peripheral, but not both. Despite this restriction, multiple connections are still possible because a central device may connect to as many as 7 peripherals at once.

The peripherals can communicate with each other through the central if desired, forming a small network of responsive devices. Still, this cluster of devices is isolated. Aside from adding more peripherals until the maximum is reached, no additional connection branches are possible and clusters are unable to connect to one another. This severely limits the possible complexity of connection topographies.

What is a mesh?

Starting with Bluetooth 4.1, however, devices gained the ability to act as both a central and a peripheral simultaneously. For example, a single device could perform the central GAP role and connect to a wireless speaker, while also performing the peripheral GAP role and accepting an incoming connection from a smartphone. A side benefit of the above example is that the wireless speaker and smartphone can now communicate with each other through the intermediary device, despite not sharing a direct connection with each other.

The ability to directly or indirectly connect any number of Bluetooth-capable devices enables the construction of much more elaborate networks, such as mesh networks. A mesh network, for our purposes, consists of two or more Bluetooth-connected devices such that there exists a connection pathway between any two devices in the network. A specific device in the network may or may not have a direct connection to another networked device, but is able to successfully send targeted data via the other members of the network.


 

One primary benefit of mesh networks, particularly for Bluetooth, is that they significantly extend the physical range over which devices can communicate with one another. The normal range of a Bluetooth connection (using Class 2 devices, which applies to the majority of consumer applications) is around 10 meters. A device must be at least this close to one of its peers in order to maintain a connection and share data.

Meshes, however, can easily bypass this range limitation and facilitate communication over potentially unlimited distances. As long as every device in the network is within physical range of one or more peers, machines that are miles apart can still exchange information via the mesh.

Another advantage of using Bluetooth mesh networks is the ability to share data among a much larger group of devices. We are no longer limited to the single-cluster configuration of one central and seven peripherals; every device in the cluster is able to create its own additional cluster(s) with other devices, bringing them into the mesh. Ultimately a potentially infinite number of Bluetooth devices connected via mesh topology could be monitored by a single central device, like your smartphone.

How to mesh

Now that we know what a mesh is, how do we create one? One of the simplest and most obvious ways to generate a mesh is to allow every device to simultaneously scan as a central and advertise as a peripheral.

We call the result of this particular algorithm a conforming mesh, because each member is interchangeable. This strategy is ideal if you are working with a collection of similar or identical devices, each with enough processing power to act as centrals.


 

When a device receives an advertisement and responds to it with a connection attempt, it will perform the central role for that connection. When it receives an incoming connection request from another device, it will perform the peripheral role for that connection. Any device that performs these two roles simultaneously can act as a bridge between clusters. When each device is capable of (a) joining a cluster of peers and (b) participating in multiple clusters at once, all devices within range are easily able to construct a mesh.

Conforming meshes have several benefits over other mesh algorithms: they are incredibly flexible, relatively easy to code, and can result in a variety of topologies. However, you can still construct a mesh that includes devices that are restricted to single GAP roles.

The next article will explore some of the pain points we discovered with the conforming mesh structure, and the various iterations and improvements we made to our mesh algorithm as a result. And if you've had enough theory and want to see the code, our mesh framework is now open source! Visit our repo here.

Ready to shape the future of tech?

Join our team of passionate and bright technologists.

Join us
  • What we do
  • Who we work with
  • Insights
  • Careers
  • About
  • Contact

WeChat

×
QR code to ThoughtWorks China WeChat subscription account

Media and analyst relations | Privacy policy | Modern Slavery statement ThoughtWorks| Accessibility | © 2021 ThoughtWorks, Inc.