First Gateway
In ArmorLink, every network has exactly one Gateway.
The Gateway acts as the central coordinator of the network.
It is responsible for:
- Pairing
- Command routing
- BLE communication with the ArmorLink App
- Maintaining the list of known modules
For more information, see Gateway.
What You Will Build
In this guide, you will create a minimal Gateway module.
The Gateway will:
- Run ArmorLink
- Expose BLE for the ArmorLink App
- Support module pairing
- Support the serial pairing menu
No additional hardware functionality is required.
Create a New Sketch
Start with a new Arduino sketch.
#include <ArmorLink.h>
ArmorLinkModule module(
"Chest",
ArmorLinkModuleType::Chest
);
void setup()
{
Serial.begin(115200);
ArmorLinkOptions options;
options.enableGateway = true;
options.enableBle = true;
options.enableEspNow = true;
options.enableSerialMenu = true;
ArmorLink.begin(module, options);
ArmorLink.info("Gateway started");
}
void loop()
{
ArmorLink.loop();
}
Upload the sketch to your ESP32.
Understanding the Configuration
Module Name
ArmorLinkModule module(
"Chest",
ArmorLinkModuleType::Chest
);
The module name identifies the Gateway within the ArmorLink network.
Module names should be unique.
Gateway Mode
options.enableGateway = true;
This enables Gateway functionality.
Without this option, the module behaves as a normal ArmorLink module.
BLE Support
options.enableBle = true;
Enables BLE communication with the ArmorLink App.
This allows the App to:
- Discover modules
- Start pairing
- Execute Actions
- Edit Configuration
- View Telemetry
- View Logs
ESP-NOW Support
options.enableEspNow = true;
Enables communication with other ArmorLink modules.
If your project consists of multiple modules, ESP-NOW should be enabled.
Serial Pairing Menu
options.enableSerialMenu = true;
Enables the built-in serial pairing interface.
This allows pairing without the ArmorLink App.
First Startup
After uploading the sketch, open the Serial Monitor.
You should see ArmorLink startup messages.
The Gateway is now ready to accept connections from the ArmorLink App.
Pairing Modules
The Gateway does not automatically accept modules.
Pairing must be started explicitly.
Using the ArmorLink App
Open the ArmorLink App and connect to the Gateway.
From the pairing screen:
- Start pairing
- Wait for modules to appear
- Accept the desired module
The module becomes part of the ArmorLink network immediately.
Using the Serial Menu
Open the Serial Monitor.
Start pairing:
start
List discovered modules:
candidates
Example:
1) Helmet | Helmet | 34:85:18:12:34:56
Accept a module:
pair 1
Display paired modules:
modules
Example:
1) Helmet | Helmet | 34:85:18:12:34:56
Unpairing Modules
List paired modules:
modules
Remove a module:
unpair 1
Or remove a module by MAC address:
unpair 34:85:18:12:34:56
A Gateway Can Be a Module
A Gateway is not limited to communication tasks.
The same device can:
- Control LEDs
- Control Servos
- Play Audio
- Expose Actions
- Expose Configuration
- Publish Telemetry
Example:
Back Module
|- LEDs
|- Smoke System
|- Servos
`- Gateway
This is a common ArmorLink deployment model.
Next Steps
Your Gateway is now running.
Continue with: