Skip to main content

Configuration

Configuration is how an ArmorLink node describes its editable settings to the App and the Web Node Configurator.

In ArmorLink 0.4.0, configuration covers both user-facing project settings and built-in setup fields such as node name, Bluetooth, Gateway mode and ESP-NOW channel.

Ownership

Configuration belongs to the node that defines it.

  • A module stores its own settings locally.
  • A Gateway stores its own settings locally.
  • The Gateway routes App requests to paired modules, but it does not own their configuration.

Values are persisted in NVS and restored on boot.

Descriptor-Based UI

A node exposes a JSON descriptor. Tools read the descriptor and generate a UI from it.

The descriptor includes:

  • Module name and type
  • Module version and ArmorLink version
  • Optional profile target and active profile name
  • Sections
  • Fields
  • Actions
  • Metadata such as ranges, tooltips, reboot flags and visibility rules

This means firmware controls what the App and configurator show without requiring custom UI code.

System Configuration

ArmorLink 0.4.0 automatically exposes core setup fields in an ArmorLink section:

  • Node Name
  • Gateway Mode
  • Enable Bluetooth
  • Bluetooth Name
  • Enable Wireless Communication
  • ESP-NOW Channel

These fields make nodes configurable from setup tools without adding custom code to every sketch.

Settings that affect startup behavior are marked as reboot-required.

User Configuration

Firmware can add its own settings:

module.config()
.addInt("openingDurationMs", &config.faceplate.openingDurationMs, 700)
.label("Opening Duration")
.section("Faceplate")
.tooltip("How long the faceplate takes to open.")
.range(100, 5000)
.step(50);

The App can edit the value and the firmware receives the updated value immediately.

Servo Configuration

Servo-heavy builds should use addServoConfig(...) instead of manually creating unrelated fields.

module.config()
.addServoConfig("servo1", &config.servo1)
.section("Servo 1")
.gpio(16)
.openPosition(10)
.closedPosition(158)
.pulseRange(500, 2400);

The helper creates fields with consistent keys and servo semantics so setup tools can show servo-aware controls and test movement.

Profiles

A node can define a profile target and active profile name.

module.profileTarget("muehliindustries.armorlink.helmet.v1");
module.profileName("Iron Patriot Generic Helmet");

The profile target identifies which cloud/community profiles are compatible with the firmware. Profiles can then be imported through setup tools and applied as configuration values.

Immediate vs Reboot-Required Changes

Most configuration changes apply immediately.

Use .rebootRequired() for settings that need hardware or transport reinitialization, such as:

  • GPIO changes
  • Servo count changes
  • BLE name changes
  • Gateway mode changes
  • ESP-NOW channel changes

The new value is still saved immediately, but the node may need a reboot before the behavior changes.

Conditional Visibility

Use visibleWhen(...) to keep large setup UIs manageable.

.visibleWhen("innerLightsEnabled", true)

Tools can hide dependent fields until the controlling setting is enabled.

Summary

ArmorLink 0.4.0 configuration provides:

  • Persistent node settings
  • App and Web Configurator discovery
  • Built-in system setup fields
  • String, int, float, bool and readonly fields
  • Servo-aware configuration helpers
  • Profiles and profile targets
  • Reboot-required and conditional UI metadata