Skip to content
wendysmoak edited this page Dec 22, 2019 · 1 revision

= Nerves =

building firmware for embedded Elixir

How to print out MAC address File.read! "/sys/class/net/eth0/address" or use nerves project nerves_networking dependency. https://github.com/nerves-project/nerves_networking/blob/master/lib/networking/subsystem.ex#L56

Using Screen to connect to RPi3

https://github.com/ssachse/my_elixir_notes/blob/master/README.md#how-do-i-use-erlang-observer-on-the-nerves-target-

== Wifi ==

http://www.microcenter.com/product/458213/150mbs_80211_B-G-N_Wireless_LAN_USB_20_Adapter_compatible_with_Raspberry_Pi is supported - RT2800

Known issues with 8192? https://github.com/pvaret/rtl8192cu-fixes

Checking whether wifi is up/working:

defp wait_for_wifi() do
    :timer.sleep 500
    case Nerves.NetworkInterface.settings("wlan0") do
      {:ok, _} -> :done
      _        -> wait_for_wifi
    end
  end

pkazmier [8:15 PM] I got the idea from a comment from @fhunleth here: https://github.com/nerves-project/nerves_interim_wifi/issues/1#issuecomment-244620159

== Chocolate ==

wsmoak [9:16 PM] so do I owe anyone that chocolate, did anyone get one or both of my wifi adapters working on RPi2 ?

gregmefford [9:18 PM] @wsmoak LOL - I think they might be both supported by default now, but you have to modprobe a driver to activate it.

gregmefford [9:20 PM] Oh wait, is it this? Looks like it's not merged yet but I thought it was: https://github.com/nerves-project/nerves_system_rpi2/pull/6/files

[9:21] Ah, this is the one I was thinking about that got merged longer ago: https://github.com/nerves-project/nerves_system_rpi/pull/8

[9:22] So I think if those are the ones you're talking about, @alfert gets the chocolate, assuming you can get it working and/or wait for the next rpi2 system release. 😉

== Umbrella Project ==

@misiek - btw is someone is interested seems to be working… my (sample) main umbrella mix.exs:

defmodule Nervy.Mixfile do
  use Mix.Project

  def project do
    [
      apps_path: "apps",
      archives: [nerves_bootstrap: "~> 0.1.4"],
      build_embedded: Mix.env == :prod,
      start_permanent: Mix.env == :prod,
      deps: deps,
      aliases: aliases
    ]
  end

  defp deps do
    []
  end

  def aliases do
    ["deps.precompile": ["nerves.precompile", "deps.precompile"],
     "deps.loadpaths":  ["deps.loadpaths", "nerves.loadpaths"]]
  end

end

paulwilson [3:10 AM] @misiek It is possible to set it up so that you can build for the host as well as the target, but it does take a bit of massaging. I’ll write it up in the next few days, but here’s an example. https://github.com/CultivateHQ/cultivatarmobile/blob/master/apps/fw/mix.ex [3:11] A key difference is that to build for the target you need to set the MIX_ENV to prod. eg

MIX_ENV=prod mix release
MIX_ENV=prod mix release.burn

[3:12] That way you can build and test from the root of the umbrella. (Note the dummy_nerves project that fakes out target specific things)

NervesSystem

=== NTP === after your connection is established you have to do something along the lines of System.cmd("ntpd", ["-q", "-p", "pool.ntp.org"]) this is on rpi3 btw

Clone this wiki locally