Pairing
Pairing connects a module to an ArmorLink Gateway.
A module must be paired with a Gateway before it can participate in a multi-node ArmorLink network.
Pairing Ownership
Pairing information is stored persistently on both sides:
- The Gateway stores paired module records.
- The module stores its Gateway relationship.
After reboot, the Gateway can report paired modules to the App through a presence snapshot.
Pairing Flow
Gateway enters pairing mode
|
v
Gateway broadcasts pairing pings
|
v
Unpaired modules respond as candidates
|
v
User accepts a candidate
|
v
Gateway and module store pairing information
|
v
Pairing complete
Repairing After Factory Reset
If a module still remembers a Gateway but the Gateway no longer knows the module, the Gateway reports module_pairing_required to the App.
The App should ask the user before starting pairing:
One or more modules need repairing. Start pairing now?
This keeps repairing explicit and avoids surprising pairing mode changes.
Presence Snapshots
When the App connects, the Gateway emits a module_presence_snapshot containing the modules currently paired with that Gateway.
The App should reconcile its local module list with this snapshot and remove stale modules that are no longer known by the Gateway.
Serial Menu Commands
When enableSerialMenu is enabled on a Gateway, these commands are available in the Serial Monitor:
| Command | Description |
|---|---|
help or ? | Show help. |
start or startpairing | Start pairing. |
stop or stoppairing | Stop pairing. |
candidates | List pairing candidates. |
pair <number> | Pair candidate by list number. |
modules or list | List paired modules. |
unpair <number> | Unpair by list number. |
unpair <mac> | Unpair by MAC address. |
Important Notes
Every ArmorLink network should have exactly one Gateway.
A single ESP32 can also be both the product node and Gateway when enableGateway and enableBle are enabled.
Summary
Pairing is Gateway-led, persistent and repairable. ArmorLink 0.4.0 adds better App-facing events for pairing pings, repairing requirements and module presence snapshots.