blatyo

blatyo

Conduit Core Team

Are there any special considerations to keep in mind when buying hardware for a Nerves project?

How do you decide what hardware to buy? Do you do anything special to make sure things are compatible?

Most Liked

ConnorRigby

ConnorRigby

Nerves Core Team

I want to put something out there that may help someone else out down the line about buying/selecting a device that can run Nerves. Sorry in advance for the huge wall of text you are about to witness.

What it means to “run” Nerves.

I see a lot of confusion here as what it means to run Nerves, so i am going to define this first. Nerves itself is just a lot of tooling that essentially removes everything that might be in your way. This includes building the kernel (hereafter referred to as simply linux) and the root file system (this contains your various root dirs such as /bin, /usr/, /etc and all their contents). these things are related but not the same as some fruity organizations would lead you to believe. So Nerves is just the tooling that brings all those pieces together using a project called buildroot. It compiles both linux, and the rootfs using a cross compiler toolchain. (we won’t get into that, it’s essentially magic).

so what it means to “run” Nerves is the device must have linux support to some extent, and buildroot support. If you start with linux, buildroot is usually pretty easy depending on how true to the kernel build process your manufacturer is.

Now some boards have both linux and buildroot, can’t (read “no one has put the work in yet”) work with Nerves. This includes the elusive C.H.I.P board. I won’t go into the details as to why it doesn’t work easily, but I will say there is a third part that makes Nerves so magic: fwup.

Fwup is how linux, the rootfs, and your elixir project is all packaged. Now supporting fwup is nothing all to special, its just a configuration file with a manifest of all the required files, some block offsets mapping to a block devices, etc that builds a special zip file. the caveat is that while it doesn’t require a certain sort of storage device, it makes it so much easier to get up and running.

If you’re still confused just know that if your device of choice can boot linux somehow, and a root filesystem can be written to an sdcard, you are probably good.

This means Nerves will never “run” on an embedded micro controller such as Arduino, Teensy, etc. They just won’t/can’t meet the requirements that the Nerves tooling expects or requires. That is not to say that Nerves can’t interface with those devices however.

So if looking for a device that “supports” Nerves, just know if you want to “interface” with a Nerves device, or “be” the Nerves device.

GregMefford

GregMefford

I just want to call more attention to this to say that, unless you have a Pi hat that gives you analog-to-digital conversion, you’ll want to make sure your sensors are digital (SPI, I2C, 1-wire, etc) instead of analog (e.g. 0-5V) because the Raspberry Pi doesn’t have analog pins like an Arduino does.

I’d recommend getting started by just buying Pi hats to connect to your RPi, because then you can be pretty sure that the hardware will work. That way, you can get comfortable with how things work before you branch out into the unknown.

frigidcode

frigidcode

I look for hardware using the following criteria:

  • Supported communication [GPIO, SPI, UART, I2C]
  • Specifications for sending/receiving data (decipher a lot of docs in a Chinese dialect)
  • Power requirements (can I power off the GPIO or do I need a barrel jack + power brick)
  • Digital vs Analog (do I need an MCP3008 chip)

Communication links
https://github.com/nerves-project/nerves_uart
https://github.com/fhunleth/elixir_ale

Places to buy (off the top of my head)
Adafruit
SparkFun
Alibaba

Where Next?

Popular in Discussions Top

arcanemachine
https://nitter.net/josevalim/status/1744395345872683471 https://twitter.com/josevalim/status/1744395345872683471
New
PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
Jayshua
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New
hazardfn
I suppose this question is effectively hackney vs. ibrowse but we are at a point in our project where we have to make a choice between th...
New
Qqwy
Looking at the stacks that existing large companies have used, WhatsApp internally uses Mnesia to store the messages, while Discord uses ...
New
AstonJ
It’s been a while since we’ve had a thread like this, so what better way to kick off the year with :003: What does being an Elixir user ...
New

Other popular topics Top

New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43757 214
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54120 245
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement