Giter Club home page Giter Club logo

lifx_controller's Introduction

LifxController

This is a demo app for the talk I gave on October 26th, 2016 at ChicagoElixir

The app serves a simple web app available at http://lifx.local:8800 for controlling a Lifx lightbulb. It runs on a Raspberry Pi 2 Model B with a Canakit Wifi dongle using Nerves to build the embedded Linux/Elixir environment.

Getting Started

First things first, you'll need to install the nerves system.

mix archive.install https://github.com/nerves-project/archives/raw/master/nerves_bootstrap.ez

Next clone this repo git clone https://github.com/NationalAssociationOfRealtors/lifx_controller.git

Copy default.env to .env and change the variables as needed to set your SSID and PSK.

If you plan on burning an SD Card and running it on a Raspberry Pi, make sure to set NERVES=true otherwise keep it as NERVES=false.

To build Nerves systems you must run Linux, I also recommend running the app in a Linux environment, as it hasn't been tested outside of that.

If you are running the app locally in a VM you will need to adjust the INTERFACE variable. Run ifconfig in your VM to figure out the correct interface. Also, because the Lifx library uses UDP broadcasting you will most likely need to setup the VM network in Bridged Adaptor mode and select the network interface from your host machine

To burn your Nerves app to an SD Card:

  • Install your enviornment variables source .env you'll need to do this for each new terminal window
  • Install dependencies with mix do deps.get, deps.compile
  • Create firmware with mix firmware
  • Burn to an SD card with mix firmware.burn
  • Install SD Card in Pi
  • Power On
  • Browse to http://lifx.local:8800

The default settings for this app pipe the Elixir console over the Raspberry Pi's serial console, use a USB -> Serial cable, like this https://www.adafruit.com/products/954 to view boot messages and access the Elixir console. Running screen /dev/ttyUSB0 115200 is a super easy way to access the serial console on your host machine.

To run the app locally

  • Install your enviornment variables source .env you'll need to do this for each new terminal window
  • Install dependencies with mix do deps.get, deps.compile
  • run iex -S mix to get an interactive console
  • Browse to http://lifx.local:8800

Learn more

lifx_controller's People

Contributors

entone avatar

Stargazers

John Barker avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.