Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Nerves @amselixir

Introduction to Nerves @amselixir

Introduction to nerves and demo of a temperature controlled closet for fermenting. See https://github.com/tverlaan/brew_ex

Avatar for Timmo Verlaan

Timmo Verlaan

June 15, 2016

Other Decks in Technology

Transcript

  1. Nerves vs Raspbian Nerves Raspbian Cold Boot to App 3-6

    seconds 30-60 seconds Zipped FW Image ~13-18 MB ~350-500 MB Update Strategy Entire Image Just Application Root Partition 64-128 MB 1-2 GB Fallback Strategy A/B Partitions ??? Unpluggability R/O Root Partition ???
  2. mix compile $ mix compile Nerves Precompile Start ... Compile

    Nerves toolchain Downloading from Github Cache Unpacking toolchain to build dir ... Generated nerves_system_rpi3 app [nerves_system][compile] [nerves_system][http] Downloading system from cache [nerves_system][http] System Downloaded [nerves_system][http] Unpacking System ... Nerves Env loaded Nerves Precompile End
  3. Future • More boards • LinkIt Smart 7688 • C.H.I.P

    • Display / Touchscreen support • Network firmware update • Video camera support • Better docs
  4. Hardware • Raspberry Pi 2 • DS18B20 1wire digital temperature

    sensor • 2x SSR-10DA solid state relay • 2x LED/diode • Fridge • Power!
  5. Enabling 1wire # config/config.exs config :nerves, :firmware, fwup_conf: "config/fwup.conf" #

    config/fwup.conf file-resource config.txt { host-path = "${NERVES_APP}/config/config.txt" } # config/config.txt dtoverlay=w1-gpio-pullup,gpiopin=4
  6. Core logic defp control(temp, system) when temp > @high do

    system.bulb |> off system.fridge |> on end defp control(temp, system) when temp < @low do system.bulb |> on system.fridge |> off end defp control(_, system) do system.bulb |> off system.fridge |> off end