This example shows how to connect your Nerves device to the network using WiFi. The directions below show how to use the Raspberry Pi 3 with its built in WiFi, but it will also work with a variety of popular USB WiFi dongles on other targets.
If you are using a Raspberry Pi 3, the WiFi hardware is already built-in. If you're using another board, you will need to connect a supported USB WiFi dongle.
-
Configure your WiFi settings by editing
config/config.exs
(note:ssid
is case-sensitive`)# config/config.exs use Mix.Config config :blinkfi, :wlan0, ssid: "my_accesspoint_name", key_mgmt: :"WPA-PSK", psk: "secret"
-
Specify your target with the
MIX_TARGET
environment variable -
Get dependencies with
mix deps.get
-
Create firmware with
mix firmware
-
Burn firmware to an SD card with
mix firmware.burn
-
Connect a monitor to the HDMI port on the board
-
Insert the SD card into your target board and power it on
-
After it finishes booting (about 5 seconds), pressing the button will log events to the console on the HDMI monitor
export MIX_TARGET=rpi3
mix deps.get
mix firmware
mix firmware.burn
- Official docs: https://hexdocs.pm/nerves/getting-started.html
- Official website: http://www.nerves-project.org/
- Discussion Slack elixir-lang #nerves (Invite)
- Source: https://github.com/nerves-project/nerves