-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs for clarity (h/t @jschneck on Slack)
[@fhunleth - removed :nerves_network from extra_applications]
- Loading branch information
1 parent
b2adf2e
commit eff203c
Showing
2 changed files
with
49 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## Loading WiFi kernel module (unnecessary for newer versions of `nerves_runtime`) | ||
|
||
**Note** | ||
If you are using `nerves_runtime` >= `0.3.0` the kernel module will be auto | ||
loaded by default, and this step is not necessary. | ||
|
||
Before WiFi will work, you will need to load any modules for your device if they | ||
aren't loaded already. Here's an example for Raspberry Pi 0 and Raspberry Pi 3: | ||
|
||
``` elixir | ||
defmodule MyApplication do | ||
use Application | ||
|
||
def start(_type, _args) do | ||
import Supervisor.Spec, warn: false | ||
|
||
children = [ | ||
worker(Task, [fn -> init_kernel_modules() end], restart: :transient, id: Nerves.Init.KernelModules) | ||
] | ||
|
||
opts = [strategy: :one_for_one, name: MyApplication.Supervisor] | ||
Supervisor.start_link(children, opts) | ||
end | ||
|
||
def init_kernel_modules() do | ||
{_, 0} = System.cmd("modprobe", ["brcmfmac"]) | ||
end | ||
end | ||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters