Skip to content

Commit

Permalink
Polish the readme and the deployment script.
Browse files Browse the repository at this point in the history
  • Loading branch information
grapeot committed Jan 6, 2017
1 parent 4f89f76 commit dc3b02e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 29 deletions.
12 changes: 10 additions & 2 deletions README.md
@@ -1,8 +1,16 @@
This is a Tornado project reading from MCP3008 ADC using raspberry pi.
There is a MQ135 sensor on channel 0, a MQ138 on channel 1, and a Sharp dust sensor on channel 2.
More information/documents can be found on the [blog post](https://grapeot.me/smart-air-purifier.html).

## SPI

* Need to first enable by running `sudo raspi-config`.
* Python requires package spidev
* Python requires package `spidev`.
* Example: [link](http://jeremyblythe.blogspot.ca/2012/09/raspberry-pi-hardware-spi-analog-inputs.html)
* We also have code [here](https://bitbucket.org/grapeot/gassensorapi).

## Usage

* Tested on Raspbian
* Use `deploy.sh` to install dependencies.
* Use `launch.sh` to launch.
* Visit `http://<YOUR PI IP>:5000/` to check the visualization.
9 changes: 8 additions & 1 deletion deploy.sh
@@ -1,9 +1,16 @@
# install python dependencies
sudo apt-get update
sudo apt-get install python3-dev python3-pip
sudo apt-get install python3-dev python3-pip swig2.0
pip3 install spidev rpi.gpio
# Compile and install the wiringpi library, detailed instructions available at https://github.com/WiringPi/WiringPi-Python
git clone https://github.com/WiringPi/WiringPi-Python
cd WiringPi
swig2.0 -python -threads wiringpi.i
sudo python3 setup.py build install
cd ..

# install nodejs + pm2 to launch
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
nvm install node
npm install -g pm2

13 changes: 0 additions & 13 deletions static/main.js

This file was deleted.

13 changes: 0 additions & 13 deletions views/api.html

This file was deleted.

0 comments on commit dc3b02e

Please sign in to comment.