ckampfe

ckampfe

Hey folks, my team at work is going to be deploying an increasing number of production Nerves devices over the coming weeks/months, and I’m hoping to start a conversation about the common issues many of us face or will face as we undertake production Nerves projects.

A little background

The main purpose of these devices will be to collect various environmental data from sensors and push it over network to a data lake for further use. Think temperature/humidity/pressure/vibration/light, etc.

For this data to be useful, it will be important to know which device/sensor it came from.
The Nerves devices will be at least Raspberry Pi Zero W’s, Pi 3 B+s, and possibly more.
The sensor hardware will be at least Si7021 temperature/humidity, TMP102 for temperature, and likely more soon.

Quantity wise, it will be something like 5-10 devices in the near term, likely with dozens following that as the team gets more capacity and we get approval for more applications.

We have investigated NervesHub and will likely be using it (and contributing) as we are able.

We control the network/environment the devices will be in, so we will have physical and network access.

We’ve had some good experience so far doing over-the-air updates to a small number of devices, but are starting to feel the growing pains of configuring these devices as their numbers grow.

Some initial questions/thoughts

  • Naming: Do you autogenerate names? Do you give devices “human” names?
  • What kind of hardware identifiers make sense to rely on? Which don’t?
  • What approaches have you been sucessful using to push configuration (env vars, etc) to hardware deployments? Pubsub? Erlang distribution?
  • Any general advice or experience reports regarding naming/provisioning fleet hardware like this? Any war stories that are good to know?
  • Automated monitoring/alerting/logging: general experience with these on Nerves hardware. We previously used a Cloudwatch/Logger integration and found it pretty unreliable. Anybody have good luck with any approaches in this area?

Thanks in advance :smiley_cat:

Showing Posts 1 to 1

fhunleth

fhunleth

Co-author of Nerves

You had lots of questions. Here are some thoughts on device naming or assigning serial numbers:

First off, it always seems like everyone involved with a product wants to offer some opinion on how serial numbers should be assigned. Mostly the concern is how much information is encoded into the serial number, ease of assignment in the factory, and ease of typing the serial numbers in.

The only surprises I’ve run into are mishaps in manufacturing that caused serial numbers to be repeated and assumed unique IDs not being unique. The latter one happened on a product where the serial number incorporated the CPU ID and then after enough devices were made, a device failed to register due to repeated serial number. (You can imagine how much engineering time was lost verifying that yes, indeed, that a unique CPU ID really did repeat)

Since you mentioned NervesHub, NervesHub has two restrictions: 1. IDs need to be unique to your organization and 2. if you’re using NervesKey modules to authenticate the connection to NervesHub then the ID must encode to 16 bytes or less.

Since you’re not making many devices, manually assigning IDs seems reasonable.

One company I worked at created a project in Jira to track and keep history on devices. Each device was an “issue” (well, they customized Jira so it wasn’t called an issue) and the serial number was the Jira issue identifier. That ended up working out really well for them, since tracking device history was really important and the non-technical people in the organization liked Jira.

Another option if you’re using NervesKeys is that the nerves_key library can make a suggestion for a serial number that’s guaranteed unique. See the NervesHub provisioning docs and the NervesKey.default_info/1 function.

One last thing, nearly every place I’ve worked at has printed out barcodes (usually Code128 linear ones) on the serial number labels. IMHO, trying to figure out short, easy-to-type serial number schemes doesn’t feel like a good use of time. If anyone ends up needing to type in the serial numbers a lot, they always seem to get a scanner.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
achempion
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
jtormey
Lately I’ve been thinking about how to organize components as a LiveView application grows. One of the pain points I’ve found (for myself...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews