Skip to main content

ArmorLinkOptions

ArmorLinkOptions controls how the ArmorLink runtime starts a node.

ArmorLink 0.4.0 also mirrors the core options into the generated configuration descriptor, so setup tools can change node identity, Gateway mode, Bluetooth and ESP-NOW settings.

Current Options

struct ArmorLinkOptions {
String nodeName = "";
String bleName = "ArmorLink";
uint8_t espNowChannel = 1;
bool enableBle = false;
bool enableEspNow = true;
bool enableGateway = false;
bool enableSerialLogging = true;
bool syncLoggingStateOnModuleOnline = false;
bool requestStateSyncAfterBoot = true;
uint32_t startupStateSyncDelayMs = 5000;
uint32_t startupStateSyncRetryMs = 10000;
String nvsNamespace = "armorlink";
uint32_t moduleHeartbeatIntervalMs = 30000;
bool forceRemoteLogging = false;
uint32_t remoteLogMinIntervalMs = 100;
String defaultLogTarget = "";
bool enableSerialCommands = true;
bool enableSerialMenu = false;
uint32_t modulePresenceCheckIntervalMs = 300000;
uint32_t moduleTimeoutMs = 900000;
};

Core Options

OptionDefaultDescription
nodeName""Overrides the ArmorLink node name. If empty, the module constructor name is used.
bleName"ArmorLink"BLE device name shown during discovery.
espNowChannel1ESP-NOW/Wi-Fi channel. All nodes in one network must use the same channel.
enableBlefalseEnables BLE for the App and setup tools. Usually enabled on Gateways or single-node projects.
enableEspNowtrueEnables wireless ArmorLink node-to-node communication.
enableGatewayfalseMakes this node the Gateway/bridge for the network.
enableSerialLoggingtruePrints local logs to Serial.
enableSerialCommandstrueEnables structured serial commands used by the Web Node Configurator.
enableSerialMenufalseEnables the human-friendly Gateway serial menu.

System Config Mirror

At startup ArmorLink registers these config fields automatically:

OptionConfig keyReboot required
nodeNamenodeNameYes
enableGatewaybridgeModeYes
enableBlebluetoothSetupYes
bleNamebluetoothNameYes
enableEspNownodeLinkYes
espNowChannelnodeLinkChannelYes

If your firmware already defines one of these keys, ArmorLink does not add a duplicate.

Gateway Setup

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

ArmorLinkOptions options;
options.nodeName = "Chest";
options.enableGateway = true;
options.enableEspNow = true;
options.enableBle = true;
options.enableSerialMenu = true;
options.bleName = "ArmorLink Chest";

ArmorLink.begin(module, options);

Regular Module Setup

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

ArmorLinkOptions options;
options.nodeName = "Helmet";
options.enableGateway = false;
options.enableEspNow = true;
options.enableBle = false;

ArmorLink.begin(module, options);

Single-Node App-Controlled Setup

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

ArmorLinkOptions options;
options.nodeName = "Helmet";
options.enableGateway = true;
options.enableEspNow = false;
options.enableBle = true;
options.bleName = "ArmorLink Helmet";

ArmorLink.begin(module, options);

Use this when the same ESP32 is both the product module and the App-facing Gateway.

Storage Options

nvsNamespace

options.nvsNamespace = "armorlink";

ArmorLink uses NVS for configuration, pairing and profile-related values.

If left as "armorlink", ArmorLink derives a namespace from the module name. Override it only when you need stable storage across node renames or multiple ArmorLink instances.

Logging Options

OptionDescription
forceRemoteLoggingSends remote logs even when the App did not request them. Useful for debugging.
remoteLogMinIntervalMsMinimum interval between remote log messages.
defaultLogTargetOptional fallback target for module logs before pairing/routing is fully established.
syncLoggingStateOnModuleOnlineGateway syncs current log state when a paired module comes online.

Startup State Sync

OptionDefaultDescription
requestStateSyncAfterBoottrueModule asks the Gateway for current logging/telemetry state after boot.
startupStateSyncDelayMs5000Delay before the first startup sync request.
startupStateSyncRetryMs10000Retry interval while the module is waiting for sync.

Presence Options

OptionDefaultDescription
moduleHeartbeatIntervalMs30000Reserved heartbeat interval. Presence is primarily activity based.
modulePresenceCheckIntervalMs300000Gateway interval for checking paired module presence.
moduleTimeoutMs900000Time without traffic before a module is considered offline.

For live App updates, the Gateway emits module presence events and snapshots.