- The firmware includes it (
extension_modulesin thenerves_hub_linkconfig). - The product has it turned on in NervesHub.
- The device has it turned on in NervesHub.
A product created in the web UI starts with every extension on. A product created through the API or
nh starts with every extension off, and sends nothing until you turn one on in its settings. The device setting is on by default, so a device follows its product unless you turn the extension off for that one device.The extensions
NervesHub 2.3.0 introduced extensions. NervesHub 2.5.0 added Metrics, Alarms, Error reports, Network identity, batched logging and version negotiation.
An instance without ClickHouse does not advertise Logging, Error reports or Metrics to devices, so they never attach. See Feature prerequisites.
Enable an extension
1
Include it in your firmware
Health, Geo and Network identity are in the default list. Local shell joins the default list when your project depends on
ExPTY. Logging and Error reports are not in the default list, so you name them:2
Turn it on for the product
Open Product settings and find the Device extensions card on the General tab. Switch on the extension. This needs a role that can update the product.Each row shows how many of the product’s devices have the extension on in their own setting.
3
Check the device setting
Open a device, go to its Settings tab, and find the Extensions card. Each extension is on by default. An extension the product has off is shown as Off for this product and its switch is disabled.If some devices have an extension turned off in their own setting, the product’s Device extensions card says how many and offers Turn it back on for them. That link needs NervesHub 2.5.1 or later.
4
Reconnect devices that were already connected
NervesHub works out which extensions a device may use when the device connects. A device that was connected before you turned the extension on picks it up the next time it connects.
Check that it works
On the device, check which extensions NervesHub has attached:attached?: true once NervesHub has attached it.
In NervesHub, the device’s Data History tab records extension messages, and you can filter it to the Extensions channel. Data History needs ClickHouse on the instance.
When a device cannot start an extension, it tells NervesHub and NervesHub raises a product notification (NervesHub 2.5.0 and later). See Notifications.
Turn an extension off
Turning an extension off for a product turns it off on every device in the product. NervesHub asks you to confirm, then tells connected devices to detach it. Turning it off on one device’s Settings tab detaches it on that device only.How negotiation works
The server decides what runs. A device never starts an extension on its own.- After the device joins its device channel, NervesHub sends
extensions:getwith every extension the instance offers and the versions it implements. - The device joins the
extensionschannel, offering one version of each extension it has inextension_modulesthat NervesHub also named. - NervesHub replies with the extensions this device may attach, after applying the product and device settings.
- The device starts each one and confirms with
<name>:attached.
nerves_hub_link 2.13.0 and NervesHub 2.5.0 negotiate versions this way. Against an older NervesHub that names no versions, nerves_hub_link offers every extension it is configured with, as it did before 2.13.0.
The wire format is in the extensions protocol reference.
Extensions on other clients
The table above describesnerves_hub_link. Other clients implement their own subset:

