Skip to main content

ArmorLinkOptions

ArmorLinkOptions controls how the ArmorLink runtime is initialized.

Options are passed to ArmorLink.begin(...) and define which features should be enabled for a module.

Example:

ArmorLinkOptions options;
options.enableEspNow = true;
options.enableGateway = true;
options.enableBle = true;
options.enableSerialMenu = true;

ArmorLink.begin(module, options);

For more information about modules, see Modules.

Default Options

The default options are defined by the ArmorLinkOptions struct.

struct ArmorLinkOptions {
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 enableSerialMenu = false;
uint32_t modulePresenceCheckIntervalMs = 300000;
uint32_t moduleTimeoutMs = 900000;
};

Core Options

OptionDefaultDescription
bleName"ArmorLink"BLE device name used when BLE is enabled.
espNowChannel1Wi-Fi channel used for ESP-NOW communication.
enableBlefalseEnables BLE communication for the ArmorLink App.
enableEspNowtrueEnables ESP-NOW communication between modules.
enableGatewayfalseEnables Gateway mode for this module.
enableSerialLoggingtrueEnables local Serial log output.
enableSerialMenufalseEnables the Gateway serial menu. Only useful on Gateway modules.

Gateway Options

enableGateway

Enables Gateway mode.

options.enableGateway = true;

Every ArmorLink network has exactly one Gateway.

The Gateway is responsible for routing Commands, pairing modules and connecting the ArmorLink App to the network.

For more information, see Gateway.

enableSerialMenu

Enables the Gateway serial menu.

options.enableSerialMenu = true;

The serial menu can be used to start pairing and manage paired modules without the ArmorLink App.

This option is only useful when enableGateway is also enabled.

For more information, see Pairing.

Communication Options

enableEspNow

Enables ESP-NOW communication.

options.enableEspNow = true;

ESP-NOW is used for communication between the Gateway and modules.

Most ArmorLink modules should leave this enabled.

espNowChannel

Sets the Wi-Fi channel used for ESP-NOW.

options.espNowChannel = 1;

All modules in the same ArmorLink network should use the same ESP-NOW channel.

enableBle

Enables BLE communication for the ArmorLink App.

options.enableBle = true;

BLE is typically enabled on the Gateway module so the ArmorLink App can connect to the network.

The App communicates with the Gateway. It does not communicate directly with individual modules.

bleName

Sets the BLE device name.

options.bleName = "JARVIS";

This name is shown when scanning for the Gateway from the ArmorLink App.

Storage Options

nvsNamespace

Sets the NVS namespace used by ArmorLink.

options.nvsNamespace = "armorlink";

ArmorLink uses NVS for persistent data such as configuration and pairing information.

Most projects can keep the default value.

Logging Options

enableSerialLogging

Enables local Serial logging.

options.enableSerialLogging = true;

This is useful during development when the module is connected to a computer.

forceRemoteLogging

Forces Remote Logging to be enabled even when it was not requested by the ArmorLink App.

options.forceRemoteLogging = true;

This can be useful for debugging, but it may increase ESP-NOW traffic.

For normal operation, keep this disabled.

remoteLogMinIntervalMs

Sets the minimum interval between remote log messages.

options.remoteLogMinIntervalMs = 100;

This helps reduce excessive log traffic.

For more information, see Remote Logging.

defaultLogTarget

Defines a default target for remote logs.

options.defaultLogTarget = "Chest";

This is mainly useful for advanced setups and debugging.

State Synchronization Options

syncLoggingStateOnModuleOnline

Controls whether the Gateway synchronizes the current logging state when a module comes online.

options.syncLoggingStateOnModuleOnline = false;

requestStateSyncAfterBoot

Controls whether a module requests state synchronization after boot.

options.requestStateSyncAfterBoot = true;

This helps modules receive the current telemetry and logging state after startup.

startupStateSyncDelayMs

Delay before the first state synchronization request after boot.

options.startupStateSyncDelayMs = 5000;

startupStateSyncRetryMs

Retry interval for startup state synchronization.

options.startupStateSyncRetryMs = 10000;

Module Presence Options

moduleHeartbeatIntervalMs

Defines how often modules send heartbeat information.

options.moduleHeartbeatIntervalMs = 30000;

Default: 30 seconds.

modulePresenceCheckIntervalMs

Defines how often the Gateway checks module presence.

options.modulePresenceCheckIntervalMs = 300000;

Default: 5 minutes.

moduleTimeoutMs

Defines how long a module may remain silent before being considered timed out.

options.moduleTimeoutMs = 900000;

Default: 15 minutes.

Common Setups

Gateway with App Support

ArmorLinkOptions options;
options.enableGateway = true;
options.enableEspNow = true;
options.enableBle = true;
options.enableSerialMenu = true;

ArmorLink.begin(module, options);

Use this for a central Gateway that communicates with modules and the ArmorLink App.

Gateway without App Support

ArmorLinkOptions options;
options.enableGateway = true;
options.enableEspNow = true;
options.enableBle = false;
options.enableSerialMenu = true;

ArmorLink.begin(module, options);

Use this for a Gateway that manages an ArmorLink network without BLE App integration.

Regular Module

ArmorLinkOptions options;
options.enableGateway = false;
options.enableEspNow = true;
options.enableBle = false;

ArmorLink.begin(module, options);

Use this for normal modules that communicate through the Gateway.

Single Module Project

ArmorLinkOptions options;
options.enableGateway = true;
options.enableEspNow = false;
options.enableBle = true;

ArmorLink.begin(module, options);

In a single module project, the module itself acts as the Gateway.

ESP-NOW is not required because there are no additional modules to communicate with.

For more information, see Gateway.

Summary

ArmorLinkOptions defines which ArmorLink features are enabled for a module.

Most projects only need to configure:

  • enableGateway
  • enableEspNow
  • enableBle
  • enableSerialMenu
  • bleName

Advanced options are available for logging, state synchronization and module presence handling.