TODO: Add description
https://hexdocs.pm/nerves/installation.html
The application requires Elixir v1.8
mix deps.get
Secrets are passed through the secrets.exs
file within /config
directory.
Copy and rename secrets.exs.example
for an example of what to setup.
After setting up the application, execute
docker-compose up # Brings any needed services up
mix ecto.migrate # Only needed once to run migrations on the db
iex -S mix
Where target = your target, eg: rpi0
, rpi
, rpi2
, rpi3
You may need to install dependencies for a particular target as well
env MIX_TARGET=target mix deps.get
env MIX_TARGET=target mix firmware
env MIX_TARGET=target mix firmware.burn
Where HOSTNAME = the domain defined on each remote device. See the respective target config on /config
, where each should have a mdns_domain
corresponding to this HOSTNAME
For this to work you must:
- Put
keys/taocupao.pem
private key andkeys/taocupao.pub
public key (they will all be included automatically -- as long as they have a.pub
extension). - Be in the same wifi connection as the devices. If this the first time installing the firmware, refer to the "Building and burning to sd"
env MIX_TARGET=rpi mix firmware
env MIX_TARGET=rpi ./upload.sh HOSTNAME
ssh -i ./keys/taocupao.pem HOSTNAME
This will put you in iex (interactive elixir) remotely.
For any command that requires an input
, this corresponds to the input on the arduino.
RingLogger.attach
: Start logging for the application to your iex instance.
Tracker.inspect(input)
: Prints the currrent state for a particular tracker (sensor)
Tracker.set_threshold(input, value)
: Sets a new threshold for a particular sensor
Tracker.start_log(input)
: Starts logging the current values being read from arduino
Tracker.stop_log(input)
: Stops logging the current values being read from arduino
Nerves applications produce images for hardware targets based on the
MIX_TARGET
environment variable. If MIX_TARGET
is unset, mix
builds an
image that runs on the host (e.g., your laptop). This is useful for executing
logic tests, running utilities, and debugging. Other targets are represented by
a short name like rpi3
that maps to a Nerves system image for that # TaocupaoAppNerves
https://hexdocs.pm/nerves/targets.html#content
To start your Nerves app:
export MIX_TARGET=my_target
or prefix every command withMIX_TARGET=my_target
. For example,MIX_TARGET=rpi3
- Install dependencies with
mix deps.get
- Create firmware with
mix firmware
- Burn to an SD card with
mix firmware.burn
- Official docs: https://hexdocs.pm/nerves/getting-started.html
- Official website: https://nerves-project.org/
- Forum: https://elixirforum.com/c/nerves-forum
- Discussion Slack elixir-lang #nerves (Invite)
- Source: https://github.com/nerves-project/nerves