Single Module Gateway
This example shows a project with one ESP32 that controls hardware and acts as the App-facing Gateway.
No additional modules are required.
When to Use This Setup
Use this setup when your prop or wearable consists of one ESP32 but should still support:
- ArmorLink App connection
- Actions
- Configuration
- Profiles
- Telemetry
- Remote logs
- Web Node Configurator access
Examples:
- Standalone helmet
- Arc Reactor light
- Single prop controller
- Single lighting or sound module
Complete Example
#include <ArmorLink.h>
ArmorLinkModule module(
"Arc Reactor",
ArmorLinkModuleType::Generic
);
bool lightEnabled = false;
int brightness = 120;
void applyLightState()
{
ArmorLink.info(lightEnabled ? "Light enabled" : "Light disabled");
}
void setup()
{
Serial.begin(115200);
delay(500);
module.profileTarget("muehliindustries.armorlink.arc-reactor.v1");
module.profileName("Default Arc Reactor");
module.actions()
.add("toggleLight")
.label("Toggle Light")
.section("Light")
.command("Light", "toggle")
.stylePrimary()
.onExecute([] {
lightEnabled = !lightEnabled;
applyLightState();
});
module.config()
.addInt("brightness", &brightness, 120)
.label("Brightness")
.section("Light")
.tooltip("LED brightness.")
.range(0, 255)
.step(1)
.onIntChange([](int value) {
brightness = value;
ArmorLink.info("Brightness changed");
});
ArmorLinkOptions options;
options.nodeName = "Arc Reactor";
options.enableGateway = true;
options.enableEspNow = false;
options.enableBle = true;
options.enableSerialCommands = true;
options.enableSerialLogging = true;
options.bleName = "ArmorLink Arc Reactor";
ArmorLink.begin(module, options);
ArmorLink.info("Single-node Gateway started");
}
void loop()
{
ArmorLink.loop();
ArmorLink.sendTelemetry("light", "brightness", brightness, "%");
delay(500);
}
Important Difference from a Regular Module
This node is a Gateway:
options.enableGateway = true;
Because it has no child modules, ESP-NOW can be disabled:
options.enableEspNow = false;
The App connects directly over BLE:
options.enableBle = true;
Setup Tools
enableSerialCommands allows the Web Node Configurator to request descriptors, apply config values and test supported hardware helpers over Web Serial.
When Not to Use This Setup
Do not use this pattern for a multi-module suit. If other ESP32 nodes should pair with this Gateway, enable ESP-NOW and use Basic Gateway.