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

  1. Establish Basic BLE Mesh Architecture with ESP32S3 as Provisioner and ESP32H2 as Nodes using the esp_ble_mesh Framework
  1. Implement Vendor Models for Self-Description with Device Name, Capabilities, and Sensor Types in device_capability_t structure
  1. Create Group Address System for global commands (e.g., “Lights off”) and individual Unicast addresses for specific devices
  1. Develop Network State Persistence with NVS Storage for NetKeys, AppKeys, and Node Database for Hot-Swapping support
  1. Implement Dynamic Discovery Service with automatic Capability Detection and Self-Registration of new H2 Nodes

Further Considerations

  1. Backup Controller Strategy: Primary/Secondary S3 with Heartbeat Monitoring or Network State Backup/Restore mechanism?
  1. Capability Advertisement Timing: Periodic Broadcasts vs. On-Demand Requests for Node Capabilities and Names?

Additional Resources

Advanced Documentation