NimBLE
nimble_1_9_0_tagFeatures
-
Full Bluetooth 5.4 specification compliance for both Host and Controller layers.
-
Support for Data Length Extension (DLE) enabling up to 251-byte packet sizes.
-
Concurrent operation of Broadcaster, Observer, Peripheral, and Central roles.
-
Scalable connection management supporting up to 32 simultaneous connections.
-
Security Manager Protocol (SMP) with support for Legacy and Secure Connections (SC).
-
Support for Advertising Extensions (AE) for increased data capacity in advertisements.
-
Support for Periodic Advertising for synchronized data broadcasting.
-
Physical layer support for 2M PHY and Coded PHY (Long Range) communications.
-
Integrated Bluetooth Mesh subsystem for many-to-many device networking.
-
NimBLE Porting Layer (NPL) for integration with various RTOS environments like FreeRTOS and RIOT.
-
Flexible Host-Controller Interface (HCI) implementation for standard interfacing.
-
Multiple transport options including UART, emSPI, and shared RAM for combined builds.
-
Comprehensive implementation of L2CAP, ATT, GAP, and GATT protocols.
-
Low-level radio drivers for Nordic nRF51, nRF52, nRF5340, and Renesas DA1469x.
-
Support for Nordic UART / Serial Port Emulation service (bleuart).
-
Privacy features including support for Resolvable Private Addresses (RPA).
Architecture
Apache NimBLE is architected as a modular Bluetooth Low Energy stack, strictly separating the Controller (Link Layer) from the Host layer. This separation allows for flexible deployments where the Host and Controller can run on the same MCU (using shared RAM transport) or on separate processors (using UART or SPI via HCI). The Controller manages real-time radio timing, hardware-specific transceiver drivers, and the Link Layer state machine, while the Host implements high-level protocols including L2CAP, the Attribute Protocol (ATT), and the Security Manager (SM).
A critical architectural component is the NimBLE Porting Layer (NPL). The NPL provides a set of OS-agnostic primitives for tasks, mutexes, semaphores, and callouts. This abstraction layer is what enables NimBLE to be highly portable, allowing it to function as the default BLE stack for Apache Mynewt while also being integrated into external ecosystems like the Espressif ESP-IDF, RIOT OS, and the Open IOT SDK.
Core Components
- Controller: Includes the Link Layer (LL) and hardware-specific drivers for Nordic and Renesas radios.
- Host: Implements GAP, GATT, ATT, L2CAP, and the Security Manager.
- Mesh: A complete Bluetooth Mesh implementation integrated into the Host subsystem.
- Transport: Provides HCI implementations over various physical and virtual interfaces.
- NPL: The abstraction layer facilitating portability across different operating systems.
Use Cases
This library is ideal for:
- Industrial Mesh Networking: Deploying large-scale, many-to-many device networks for industrial automation or smart lighting using the integrated Mesh subsystem.
- High-Density Sensor Hubs: Creating central devices that must maintain up to 32 simultaneous connections with peripheral sensors.
- Long-Range IoT: Utilizing Coded PHY support to extend the range of BLE communications in outdoor or obstructed environments.
- Secure Wearables: Implementing secure bonding and encrypted communications for consumer electronics using LE Secure Connections.
- Cross-Platform Development: Projects that require a consistent BLE API across different hardware architectures and RTOS environments.
- HCI Controller Emulation: Turning a supported SoC into a dedicated BLE controller for use with a Linux-based host running BlueZ.
Getting Started
To get started with NimBLE, it is recommended to use the Newt build tool provided by the Apache Mynewt project. Developers can begin by exploring the apps/ directory within the repository, which contains several reference applications. For example, bleprph provides a template for a basic peripheral, while btshell offers a command-line interface to exercise the stack’s full functionality.
For integration into non-Mynewt projects, developers should refer to the porting/ directory, which contains NPL implementations for various environments. Detailed documentation, including API references for GAP, GATT, and Mesh, is available through the Apache Mynewt documentation portal. Community support is primarily handled via the Apache Mynewt developer mailing list and Slack channel.
Related Projects (49)
View All 49 Projects →
ESPHome Tesla BLE
This project enables ESP32 microcontrollers to manage Tesla vehicle charging and monitor telemetry over Bluetooth Low Energy using the ESPHome framework. It supports key pairing, charging current adjustment, and vehicle wake management while utilizing FreeRTOS for task handling on the ESP32 platform.
M5Stack AtomS3 / NanoC6 BTProxy
This project provides an ESPHome configuration to transform M5Stack AtomS3 Lite or NanoC6 devices into Bluetooth proxies for Home Assistant. It enables centralized management and extended range for Bluetooth Low Energy devices by leveraging ESP32-based hardware as network gateways.
LumiFur Controller
A real-time firmware for ESP32-S3 based HUB75 LED matrix displays, specifically designed for Protogen masks. It features sensor-driven interactions using proximity, accelerometer, and microphone inputs, alongside Bluetooth LE control and OTA updates via the NimBLE stack.
Arduino Serial BLE
A library for ESP32 Arduino that implements the Nordic UART Service (NUS) to provide a HardwareSerial-compatible BLE interface. It supports both the standard ESP32 BLE stack and the memory-efficient NimBLE-Arduino library, while offering optional integration with the Embedded Template Library (ETL) for deterministic memory management.
Seeed Studio XIAO ESP32 Project Collection
A comprehensive development resource for the Seeed Studio XIAO ESP32 family, including the C3, S3, and C6 modules. It provides over thirty modular projects demonstrating hardware-specific features like LiPo battery monitoring, deep sleep optimization, and advanced wireless implementations such as BLE HID keyboards and WebSocket camera servers.
VMflow — Open-Source Vending Machine IoT Platform
An ESP32-S3 based platform that enables MDB protocol communication for vending machine cashless payments and remote telemetry. It features support for EVA DTS DEX/DDCMP standards, Bluetooth connectivity via NimBLE, and integrated foot traffic analysis using a PAX counter.
AntiHunter
AntiHunter is an open-source distributed perimeter defense system designed for wireless network security and operational awareness. Built on the ESP32-S3 platform using the Arduino framework and FreeRTOS, it creates a scalable mesh network of sensors for real-time WiFi/BLE threat detection, device mapping, and signal triangulation. The system integrates GPS, SD logging, and tamper-responsive data destruction to provide a robust digital tripwire for security professionals.
ESP32-C6 Matter Over Thread Roof Window Controller
A smart home controller for roof windows that utilizes Matter over Thread on the Espressif ESP32-C6 platform. It combines environmental sensing via an AM2301 sensor with hardware control for window automation, integrating directly into ecosystems like Home Assistant through a Thread border router.