README for Remote Light Control
Benjamin Temple
ECE 4220
SS2015 - University of Missouri

This code is divided into three parts, the Anrdoid app, the Arduino code, and the Raspberry PI server code.

Assuming all wiring is followed as shown in my documentation in my final report, this should function properly.


Android App:

In order to run the Android app, import the project into Android Studio 1.0. 
It should compile and run without issues.

Arduino code:

The arduino code is specifically designed to be run on a Lightblue Bean designed by punchthrough.
The exact Arduino can be found here:

https://punchthrough.com/bean/

In conjunction with this found on punch through design's website they have a special loader which allows the Arduino code to be installed via bluetooth.
They have setup instructions which can be found here on how to setup the loader with the Arduino compiler:

https://punchthrough.com/bean/getting-started-osx/
https://punchthrough.com/bean/getting-started-windows/

Once the Lightblue Bean is setup and functioning with a demo project, merely load my remote.control.arduinoCode.ino file into the Arduino and the arduino code should function properly.

Server Code:

To use the server code, first a raspberry pi (arm processor) needs to be setup and running on the same network as the network the Android phone is connected to.
Once this is accomplished, the wiring pi library needs to be installed.
This can be found here:

http://wiringpi.com/download-and-install/

After wiringPi is installed, in my ./remote.control.serverCode/ directory compile the server code by running make:

cd ./remote.control.serverCode/
make

Next we need to load the SPI drivers, this can be accomplished with wiring pi's gpio utility:

gpio load spi

Finally run the server script as root:

sudo ./udpServer

A script can also be made to run this automatically on startup. Merely add the following line to "/etc/rc.local" somewhere before the exit.

sh /[path to remote.control.serverCode]/runServer.sh
