This commit is contained in:
James Devine 2021-06-10 21:46:36 -07:00 committed by GitHub
parent 094e39fb18
commit 0d049e9c2f

View file

@ -45,21 +45,22 @@ sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 3000
sudo iptables-save > /etc/iptables/rules.v4
echo "installing BME680 library and MQTT client"
sudo pip3 install bme680 paho-mqtt
pip3 install bme680 paho-mqtt
echo "setting up I2C_LCD, CSS811 and air monitoring script"
cd /home/pi
mkdir airmon
cd airmon
wget -O I2C_LCD_driver.py https://gist.githubusercontent.com/vay3t/8b0577acfdb27a78101ed16dd78ecba1/raw/6cc9bc9989e549c97b32b9df44fe17b1db5a8950/I2C_LCD_driver.py
wget -O airmon.py https://gist.githubusercontent.com/pingud98/0f16f733e2c5a1a2ee1afd3879acd546/raw/3c7e72f12c2d6f0e1f8b3ac783f0c8d7e153c7c4/gistfile1.txt
wget -O airmon_if.py https://gist.githubusercontent.com/pingud98/48062767e93534b0bb2e049bba131df0/raw/49519d9cac40ea902dbd7442a2d822352bf25bc2/airmon_if.py
wget -O CCS811_RPi.py https://gist.githubusercontent.com/pingud98/f21b44db4a646da267f964396b41c017/raw/99550ee263091a371de7d423cfd6a0860678aef3/CCS811_RPi.py
wget -O airmon.service https://gist.githubusercontent.com/pingud98/a65a5cbab9b008a32b2f7a1e84a04994/raw/feb5cadbad186d847f93ae9b8cb0f614f9685127/airmon.service
sudo cp airmon.service /etc/systemd/system/airmon.service
sudo systemctl daemon-reload
sudo systemctl enable airmon.service
sudo systemctl start airmon.service
echo "slowing down I2C on Raspberry Pi to 10kbps, required for CCS811 sensor"
echo "Enabling and slowing down I2C on Raspberry Pi to 10kbps, required for CCS811 sensor"
echo "dtparam=i2c_arm=on" | sudo tee -a /boot/config.txt
echo "i2c-dev" | sudo tee -a /etc/modules
echo "dtparam=i2c_arm_baudrate=10000" | sudo tee -a /boot/config.txt
echo "All done!"
read -p "Press enter to reboot"