Support us and view this ad

可选:点击以支持我们的网站

免费文章

1. Introduction: The Scalability Challenge in BLE Mesh Provisioning for Smart Lighting The promise of Bluetooth Low Energy (BLE) Mesh for smart lighting is compelling: decentralized control, robustness, and interoperability. However, moving from a handful of bulbs in a demo to a thousand-node installation in a commercial building exposes a critical bottleneck—the provisioning process. Provisioning is the act of adding an unprovisioned device (a light node) to an existing mesh network, assigning it a unicast address, and distributing network and application keys. In a naive implementation, provisioning one node at a time over a single bearer (e.g., PB-ADV) can take 10-15 seconds per node. For 1000 nodes, that's over two hours of sequential provisioning, which is operationally unacceptable. This article presents a scalable platform architecture built around the nRF5340 dual-core SoC from Nordic Semiconductor. The nRF5340 is uniquely suited for this task due to its dedicated application core (Arm Cortex-M33) and a separate network core (also a Cortex-M33) that handles the BLE controller stack. This separation allows the application core to manage high-level provisioning logic, state machines, and a local database, while the network core handles raw BLE radio events without interference. We will dive into the packet format for provisioning PDUs, a state machine for concurrent batch provisioning, a code snippet for a key algorithm, and a performance analysis showing latency and memory footprint. 2. Core Technical Principle: Concurrent Provisioning via Multiple Bearers and Time-Slot Scheduling The fundamental innovation is to parallelize the provisioning process across multiple physical bearers and time-slots. The BLE Mesh specification defines two provisioning bearers: PB-ADV (using BLE advertising channels) and PB-GATT (using a GATT connection). A single nRF5340 can act as a provisioning node (Provisioner) and simultaneously listen on multiple advertising channels (37, 38, 39) while also maintaining several GATT connections. The key is to schedule provisioning PDUs across these bearers without collisions. The provisioning protocol uses a fixed packet format. Each provisioning PDU consists of a 1-byte PDU type, a 1-byte transaction number, and a variable-length payload (up to 255 bytes). The critical PDU for batch provisioning is the Provisioning Invite, which triggers an unprovisioned device to start advertising. The Provisioning Invite PDU format is: Byte 0: PDU Type = 0x01 (Provisioning Invite) Byte 1: Transaction Number (0x00 to 0xFF) Byte 2: Attention Duration (seconds, 0x00 = no attention) The Provisioner sends this PDU on a specific bearer. The unprovisioned device responds with a Provisioning Capabilities PDU, which includes its available OOB (Out-of-Band) methods and the number of elements it supports. The Provisioner then uses this information to assign a unicast address and distribute keys. To achieve concurrency, we implement a time-slot scheduler. The nRF5340's radio is capable of fast switching between advertising channels and GATT connections (within 150 microseconds). We divide time into 10 ms slots. In each slot, the Provisioner performs one of the following actions: Send a Provisioning Invite on a specific advertising channel (e.g., ch37). Listen for a Provisioning Capabilities response on the same channel. Send a Provisioning Start PDU on an active GATT connection. Process an incoming Provisioning Data PDU from a GATT connection. The scheduler maintains a pending queue of unprovisioned devices discovered via scanning. Each device is assigned a state (e.g., INVITE_SENT, CAPS_RECEIVED, START_SENT, CONFIRM_SENT, DATA_SENT, COMPLETE)....

继续阅读完整内容

支持我们的网站,请点击查看下方广告

正在加载广告...

Login