Table of Contents
BLE Mesh
To understand the concept of Bluetooth Low Energy Mesh, I attached a video showing the main principles.
Overview
Initially, the idea was to use Bluetooth Low Energy for communication between the System Control and all other components. However, the project has evolved. With the implementation of day/night cycles for the LEDs, light-emitting devices (e.g., Mole Beacon) need to respond to the time of day. Consequently, if the cycle transitions to evening, the lights should turn on automatically.
This is not easily feasible with standard Bluetooth Low Energy, as it would require iterating through all known devices in sequence to connect, switch, and disconnect. This approach does not scale well. Connecting to all devices simultaneously would hit a hardware limit of approx. 5-7 devices (depending on the ESP32S3).
Therefore, the new approach, which appears to be compatible with both ESP32 and STM32, is Bluetooth Low Energy Mesh (BLE Mesh).
Planning
I ask some AI Agents to create a concept for this feature. This is the result of it.
Plan: BLE Mesh System with ESP32S3/H2 and Self-Discovery
A comprehensive BLE Mesh network with ESP32S3 as the control unit and ESP32H2 satellites, supporting global control, individual device control, control unit hot-swapping, and automatic device discovery. The system uses ESP-BLE-MESH based on the Zephyr stack with Vendor Models for extended functionality.
Steps
- Establish Basic BLE Mesh Architecture with ESP32S3 as Provisioner and ESP32H2 as Nodes using the esp_ble_mesh Framework
- Official Documentation: ESP-BLE-MESH Programming Guide
- API Reference: ESP-BLE-MESH API Reference
- Example Code: ESP-IDF BLE Mesh Examples
- Provisioner Walkthrough: BLE Mesh Provisioner Example
- Implement Vendor Models for Self-Description with Device Name, Capabilities, and Sensor Types in
device_capability_tstructure- Vendor Model Guide: ESP-IDF Vendor Model Example
- Custom Model Tutorial: BLE Mesh Model Development Guide
- Bluetooth SIG Mesh Specification: Bluetooth Mesh Profile Specification
- Create Group Address System for global commands (e.g., “Lights off”) and individual Unicast addresses for specific devices
- Addressing Guide: BLE Mesh Addressing Architecture
- OnOff Model Example: Generic OnOff Server/Client
- Configuration Client: Config Model Implementation
- Develop Network State Persistence with NVS Storage for NetKeys, AppKeys, and Node Database for Hot-Swapping support
- NVS Storage Guide: ESP-IDF Non-Volatile Storage
- BLE Mesh Storage: ESP-BLE-MESH Storage Documentation
- Key Management: BLE Mesh Security Guide
- Implement Dynamic Discovery Service with automatic Capability Detection and Self-Registration of new H2 Nodes
- Fast Provisioning: ESP-BLE-MESH Fast Provisioning
- Remote Provisioning: BLE Mesh v1.1 Remote Provisioning
- Sensor Models: Sensor Server/Client Examples
Further Considerations
- Backup Controller Strategy: Primary/Secondary S3 with Heartbeat Monitoring or Network State Backup/Restore mechanism?
- Health Model: BLE Mesh Health Server/Client
- Heartbeat Messages: BLE Mesh Heartbeat Guide
- Capability Advertisement Timing: Periodic Broadcasts vs. On-Demand Requests for Node Capabilities and Names?
- Publication/Subscription: BLE Mesh Publication Model
- Network Performance: BLE Mesh Performance Optimization
Additional Resources
Video Tutorials (YouTube Search)
- “ESP32 BLE Mesh tutorial”
- “ESP-IDF BLE Mesh implementation”
- “ESP32 mesh networking examples”
- “Espressif BLE Mesh provisioning”
Advanced Documentation
- WiFi Coexistence: BLE Mesh + WiFi Example
- Directed Forwarding: BLE Mesh v1.1 Features
- ESP32-H2 Specifications: ESP32-H2 Technical Reference Manual
- ESP32-S3 Features: ESP32-S3 Series Datasheet
