For those exploring Nerves for the first time, we recommend Nerves Livebook. It allows you to try out the Nerves project on real hardware without needing to build a project from scratch.
Within minutes, you'll have a Raspberry Pi or Beaglebone running Nerves. You'll be able to run code in Livebook and work through Nerves tutorials from the comfort of your browser.
No prior knowledge about the Elixir programming language is required. You can learn it in Nerves Livebook.
Underjord has put together a fantastic video to help walk-through the entire setup process.
- host computer (macOS, Linux, or Windows)
- target computer that Nerves supports (Raspberry Pi family, BeagleBone-based boards, etc)
- MicroSD card
- MicroSD card reader (depends on your host computuer)
- Micro-USB to USB cable (depends on your target computuer)
fwup is a command line utility that is used for burning a firmware image to MicroSD card.
The installation method differs depending on your host computer, so refer to the fwup documentation.
First, download the firmware image (.fw
file) corresponding to your target computer from the Nerves Livebook Releases page. For example, if your target computer is Raspberry Pi 4, download nerves_livebook_rpi4.fw
.
This is a one time step. There's a Livebook notebook for upgrading the firmware for when we make releases!
We will create a bootable MicroSD card.
Navigate to the directory where you downloaded the firmware earlier.
cd path/to/my-firmware
To be clear, this formats your MicroSD card, and you will lose all data on the SD card. Make sure you're OK with that.
fwup nerves_livebook_rpi4.fw
Depending on your OS, you'll likely be asked to authenticate this action. Go ahead and do so.
Use 15.84 GB memory card found at /dev/rdisk2? [y/N] y
Depending on your OS, you'll likely be asked to authenticate this action. Go ahead and do so.
|====================================| 100% (31.81 / 31.81) MB
Success!
Elapsed time: 3.595 s
There can be multiple ways to connect to your target computer.
- Connect in USB gadget mode using Micro-USB to USB cable
- Connect via Ethernet using LAN cable
- Connect via UART using USB to TTL serial cable
The supported connection methods vary depending on your target computer.
Nerves System | Gadget Mode | Ethernet | UART | |
---|---|---|---|---|
Raspberry Pi Zero W | rpi0 | ✓ | x | ✓ |
Raspberry Pi 3 Model B | rpi3 | x | ✓ | ✓ |
Raspberry Pi 4 Model B | rpi4 | ✓ | ✓ | ✓ |
If you are using a target computer that supports USB gadget mode, you can use the Micro-USB to USB cable for both power supply and networking by connecting it to the USB On-The-Go (OTG) port.
Insert the MicroSD card into the target computer. Power up your target computer and connect a network cable. If you're using a Raspberry Pi Zero, Beaglebone or Raspberry Pi 4, a USB cable can provide both power and network.
Most, but not all supported devices, have an LED on them. Nerves Livebook will make it blink when the network is disconnected and change it to solid on when it's possible to connect over any network interface.
Once the device is ready, point your browser at http://nerves.local. The password is "nerves".
You can actually run the Elixir code in your Livebook notebook, so you can learn Nerves and the Elixir language comfortably and happily on your browser. Here are some useful notebooks:
You may discover interesting notebooks from the Elixir community at https://notes.club.
At some point you may want to create your own custom Nerves firmware. See the Nerves Installation and Getting Started guides for details.
Elixir Nerves Quickstart (日本語)
https://gist.github.com/mnishiguchi/b2b6472dad381065da298f2c9db62988