The firmware that runs on the Raspberry Pis for https://github.com/dwyl/smart-home-security-system
We're using UART to connect to the board, so connect the pins up as follows:
Pi | PN532 |
---|---|
5v | 5v |
Ground | Ground |
TXD (GPIO 14) | RX |
RXD (GPIO 15) | TX |
git clone https://github.com/dwyl/smart-home-firmware
For the firmware to compile you will need a few build dependencies installed, please see: https://github.com/dwyl/learn-scenic#installing
export MIX_TARGET=<tag> # see dwyl/learn-nerves
export NERVES_NETWORK_SSID=<Wifi network name> # Optional, if you want WiFi connection
export NERVES_NETWORK_PSK=<Wifi password> # again, optional
Insert and SD card to your host
mix firmware.burn
Insert SD card into Raspberry pi, turn it on then SSH in
ssh nerves.local
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 platform.
All of this logic is in the generated mix.exs
and may be customized. For more
information about targets see:
https://hexdocs.pm/nerves/targets.html#content
To start your Nerves app:
export MIX_TARGET=my_target
or prefix every command with
MIX_TARGET=my_target
. For example, MIX_TARGET=rpi3
mix deps.get
mix firmware
mix firmware.burn