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 (58)
View All 58 Projects →
DeskPet for M5Stack Cardputer
DeskPet is a pixel-art companion for the M5Stack Cardputer that synchronizes with Claude Code sessions via Bluetooth Low Energy (BLE). Built on the ESP32-S3 using the NimBLE stack and ArduinoJson, it provides real-time visual feedback and hardware-based command approval for AI agent workflows.
GhostBLE
GhostBLE is a portable BLE privacy scanner and wardriving application designed for the M5Stack ecosystem, including the Cardputer and StickC series. Leveraging the NimBLE-Arduino library on the ESP32 platform, it provides real-time analysis of Bluetooth Low Energy devices, privacy posture heuristics, and GPS-tagged logging for security research and education.
POSEIDON
A keyboard-focused pentesting firmware for the M5Stack Cardputer-Adv (ESP32-S3) offering over 90 features across WiFi, BLE, sub-GHz, and LoRa. It utilizes FreeRTOS and the NimBLE stack to coordinate complex wireless attacks, including 5 GHz deauthentication and Zigbee sniffing via a companion ESP32-C5 node.
ESP32 UART Bridge
A high-performance serial communication hub for ESP32 and ESP32-S3 microcontrollers that bridges UART data to USB, WiFi, and Bluetooth. It features protocol-aware optimizations for MAVLink, SBUS, and CRSF, and includes a comprehensive web-based configuration interface.
Zhilly AI Pentester Assistant
Zhilly is an AI-powered portable cybersecurity tool for ESP32-S3 devices, enabling voice-controlled pentesting, RF/IR signal manipulation, and HID emulation. Built on the ESP-IDF framework, it utilizes FreeRTOS, LVGL, and NimBLE to provide a sophisticated, hands-free interaction model for security researchers.
UniGeek Firmware
UniGeek is a comprehensive multi-tool firmware for ESP32-based handheld devices, offering a suite of tools for WiFi security, Bluetooth analysis, and hardware module interfacing. Built on the Arduino framework and FreeRTOS, it supports a wide variety of hardware including M5Stack, LilyGO, and custom DIY builds.
ESP-HACK FW
ESP-HACK is a versatile wireless research and pentesting firmware for the ESP32 platform, targeting Sub-GHz, Bluetooth, and Infrared protocols. It utilizes the Arduino framework and NimBLE stack to provide tools for signal analysis, protocol exploration, and GPIO integrations. The project is designed for use with custom hardware including CC1101 transceivers and OLED displays.
TNY-360 Quadruped Robot
TNY-360 is an open-source, 12-DOF quadruped robot designed for research and interaction, powered by the ESP32-S3 microcontroller. It utilizes the ESP-IDF framework and FreeRTOS to manage complex tasks like inverse kinematics, computer vision via an OV2640 camera, and human-robot interaction. The project features a fully 3D-printable chassis and integrated sensors including Lidar, IMU, and I2S audio.