Skip to content

strobe-audio/nerves_networking

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Networking

A Nerves module to handle configuring IP networking on embedded systems.

Features

  • Supports multiple address setting modes:
    • DHCP (via udhcpc), including handling timeouts and re-acquisition
    • Static Address configuration
    • IP4LL/APIPA automatic address configuration
  • Easy callback-based notification of device state changes

Setup

Include :nerves_networking as a dependency and application in your mix.exs.

# add as an application to start
def application, do: [
  ...
  applications: [:nerves_networking],
  ...
]

# add to your dependencies
def deps do
  [.....
  {:nerves_networking, github: "nerves-project/nerves_networking"},
  ....]
end

Simple DHCP configuration

alias Nerves.Networking

{:ok, _pid} = Networking.setup :eth0

For a simple example, see the Hello Network example.

Static IP configuration

You can setup static IP parameters by doing something more like this:

alias Nerves.Networking
{:ok, _pid} = Networking.setup :eth0, mode: "static", ip: "10.0.0.5", router:
            "10.0.0.1", mask: "16", subnet: "255.255.0.0", mode: "static",
            dns: "8.8.8.8 8.8.4.4", hostname: "myhost"

WORK LIST

Some of the things currently on the TO-DO list before this is considered finished:

  • Finish documentation for callback models
  • Finish documentation for modes (:dynamic, :static)
  • Tests for APIPA/IP4LL currently fail and are disabled (bad test)
  • UDP Configuration module made of broken-out parts
  • Configuration storage module made of broken-out parts

About

Ethernet management for Nerves

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%