Skip to main content

Basic Gateway

This example shows a minimal ArmorLink 0.4.0 Gateway.

The Gateway coordinates an ArmorLink network and provides the App-facing BLE connection.

It handles:

  • Command routing
  • Module pairing and repairing
  • Module presence snapshots
  • Config routing for paired modules
  • BLE communication with the ArmorLink App
  • Optional Serial Monitor pairing menu
  • Optional Web Node Configurator serial commands

For the conceptual overview, see Gateway.

Sketch

#include <ArmorLink.h>

ArmorLinkModule module(
"Chest",
ArmorLinkModuleType::Chest
);

void setup()
{
Serial.begin(115200);
delay(500);

ArmorLinkOptions options;
options.nodeName = "Chest";
options.enableGateway = true;
options.enableEspNow = true;
options.enableBle = true;
options.enableSerialCommands = true;
options.enableSerialMenu = true;
options.enableSerialLogging = true;
options.bleName = "ArmorLink Chest";
options.modulePresenceCheckIntervalMs = 5000;

ArmorLink.begin(module, options);

ArmorLink.info("Chest Gateway started");
}

void loop()
{
ArmorLink.loop();
}

What This Example Does

nodeName sets the runtime ArmorLink name used for routing and setup tools.

options.nodeName = "Chest";

Gateway mode allows the node to route commands, manage pairing and report module presence.

options.enableGateway = true;

BLE lets the ArmorLink App connect to the Gateway.

options.enableBle = true;
options.bleName = "ArmorLink Chest";

enableSerialCommands keeps the structured Web Node Configurator command path enabled. enableSerialMenu adds the human-friendly Serial Monitor pairing menu.

Pairing Modules

Open the Serial Monitor and start pairing:

start

List candidates and pair one:

candidates
pair 1

List paired modules:

modules

The App can also start pairing through BLE. During pairing, the Gateway emits pairing pings so the App can show progress.

App Connection

After connecting to the Gateway, the App receives:

  • gateway_descriptor
  • module_presence_snapshot
  • module_presence updates
  • Pairing events
  • Config transfer events
  • Telemetry and remote logs when enabled

When to Use This Example

Use this for a dedicated central Gateway in a multi-module project, for example a chest controller that manages helmet, hand and back modules.

Next Steps