/Restidscreen

A Nerves and Scenic application for displaying Västtrafik departure times on an Inky wHAT

Primary LanguageElixir

Restid

An e-ink screen that displays departure time of relevant Västtrafik trips.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Install elixir

Install Scenic dependencies

Install Nerves dependencies

Installing

Add api key and secret from Västtrafik developer portal to ./config/secret.exs

cp ./config/secret.example.exs ./config/secret.exs

Install dependencies

export MIX_TARGET=host
mix deps.get

Start application in interactive mode

iex -S mix

Running the tests

Tests can be run with

mix test

Deployment

This project has only been tested on a Raspberry Pi.

Burn the initial firmware

# Set the correct target device in the env variable MIX_TARGET
export MIX_TARGET=rpi3a

# Configure the Nerves network connection by setting env variables
export NERVES_NETWORK_SSID="YOUR WIFI SSID NAME"
export NERVES_NETWORK_PSK="YOUR WIFI PASSWORD"

# Fetch the dependencies for the device specified in MIX_TARGET
mix deps.get

# Compile the firmware
mix firmware

# Burn the firmware to a SD card
mix firmware.burn

Ensure that Nerves is up and running by pinging it or SSH:ing to it

ping nerves.local

ssh nerves.local

Generate a nerves script to upload updates via the network

mix firmware.gen.script

Compile and push updates via the network

mix firmware
./upload.sh

Acknowledgments