Skip to main content
A device connects to NervesHub over a Phoenix Channels WebSocket and speaks the device protocol. A client is the software on the device that speaks it. It reports the firmware the device is running, receives updates, and hands the download to whatever writes firmware on that platform.

The clients

meta-nerveshub is not a client. It is a Yocto layer that packages the Linux agent into an image.
fwup is the only format an instance accepts by default. RAUC, AtomVM and ESP-IDF support are experimental. Each must be enabled for the instance and then for the product. See feature prerequisites and the page for each format.

State of each client

These states come from each project’s own README. Check the repository for the current picture before you commit to one.

Choosing

Running Nerves? Use NervesHubLink. Running Linux without Nerves? Use the Linux agent. It is one Rust binary that runs beside your application and shells out to fwup or rauc to write firmware. If you build the image with Yocto, add meta-nerveshub. Running Erlang or Elixir on an ESP32 with AtomVM? Use the AtomVM agent. It needs AtomVM built from source, because the WebSocket transport is an ESP-IDF component. Running a Rust application on ESP-IDF? Use nerves-hub-link-esp32. This site has no page for the crate itself. Its README is the reference, and ESP-IDF application images covers the NervesHub side.

What differs between clients

Features described elsewhere on this site are written for NervesHubLink unless the page says otherwise. The other clients differ:
  • Console. NervesHubLink serves an IEx session. The AtomVM agent and nerves-hub-link-esp32 serve a fixed set of commands. The Linux agent offers a shell through the local shell extension.
  • Support scripts. On Nerves a script is Elixir. On the Linux agent it is a shell script. On the AtomVM agent it is a list of console commands. nerves-hub-link-esp32 does not run scripts. Scripts belong to the product, so a product with more than one kind of device needs scripts written for each.
  • Extensions. Each client implements its own subset. See its page or README.
  • Delta updates. Only fwup and ESP-IDF firmware are delta updated. See Delta updates and ESP-IDF application images.

How NervesHub identifies a client

NervesHub 2.5.2 and later record which client library and version each device connected with. It reads them from the User-Agent header of the WebSocket upgrade request. NervesHubLink sends the header from 2.14.0. A connection without a recognised header is recorded with an unknown library. A client that is not in this list can name itself with a custom# prefix, for example User-Agent: custom#acme-link/1.4.0. See Connection lifecycle.

Writing your own

The server has no notion of an official client. Anything that speaks the device protocol is a device. If none of these clients covers your runtime, the Device WebSocket protocol and WebSocket channel events references describe the connection, the join, and the messages in both directions. The existing clients are reference implementations.