Zum Hauptinhalt springen

Erstes Gateway

In ArmorLink besitzt jedes Netzwerk genau ein Gateway.

Das Gateway fungiert als zentraler Koordinator des Netzwerks.

Es ist verantwortlich für:

  • Pairing
  • Command routing
  • BLE communication with the ArmorLink App
  • Maintaining the list of known modules

Weitere Informationen findest du unter Gateway.

Was du bauen wirst

In dieser Anleitung erstellst du ein minimales Gateway-Modul.

Das Gateway wird:

  • Run ArmorLink
  • Expose BLE for the ArmorLink App
  • Support module pairing
  • Support the serial pairing menu

Zusätzliche Hardware-Funktionalität ist nicht erforderlich.

Neuen Sketch erstellen

Beginne mit einem neuen 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();
}

Lade den Sketch auf deinen ESP32 hoch.

Konfiguration verstehen

Modulname

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

The module name identifies the Gateway within the ArmorLink network.

Module names should be unique.

Gateway-Modus

options.enableGateway = true;

This enables Gateway functionality.

Without this option, the module behaves as a normal ArmorLink module.

BLE-Unterstützung

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-Unterstützung

options.enableEspNow = true;

Enables communication with other ArmorLink modules.

If your project consists of multiple modules, ESP-NOW should be enabled.

Serial-Pairing-Menü

options.enableSerialMenu = true;

Enables the built-in serial pairing interface.

This allows pairing without the ArmorLink App.

Erster Start

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.

Module koppeln

The Gateway does not automatically accept modules.

Pairing must be started explicitly.

Open the ArmorLink App and connect to the Gateway.

From the pairing screen:

  1. Start pairing
  2. Wait for modules to appear
  3. Accept the desired module

The module becomes part of the ArmorLink network immediately.

Mit dem Serial-Menü

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

Module entkoppeln

List paired modules:

modules

Remove a module:

unpair 1

Or remove a module by MAC address:

unpair 34:85:18:12:34:56

Ein Gateway kann auch ein Modul sein

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.

Nächste Schritte

Your Gateway is now running.

Continue with: