NervesNtp
NervesNtp is simple OTP application which synchronizes time using busybox ntpd command. Primary use is for Nerves embedded devices without RTC.
There are two configuration options:
# config/config.exs
use Mix.Config
# ntpd binary to use
config :nerves_ntp, :ntpd, "/usr/sbin/ntpd"
# servers to sync time from
config :nerves_ntp, :servers, [
"0.pool.ntp.org",
"1.pool.ntp.org",
"2.pool.ntp.org",
"3.pool.ntp.org"
]Installation
The package can be installed as:
-
Add
nerves_ntpto your list of dependencies inmix.exs:
```elixir
def deps do
[{:nerves_ntp, "~> 0.1.0"}]
end
```-
Ensure
nerves_ntpis started before your application:
```elixir
def application do
[applications: [:nerves_ntp]]
end
```