Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polish the readme and the deployment script.
- Loading branch information
Showing
4 changed files
with
18 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.