March 19, 2016 · Raspberry Zero 2 3 HTU21 Temperature Humidity Sensor Graph ZingChart
ZeroSensor Quick & Easy
go home ;)
cd /home/pi/
setup i2c
sudo apt-get update && sudo apt-get install -y python-smbus i2c-toolssudo suecho "i2c-bcm2708" >> /boot/config.txtecho "i2c-dev" >> /boot/config.txt
Install pigpio
su pigit clone https://github.com/joan2937/pigpio && cd pigpiosudo make && sudo make installsudo pigpiodsudo suecho "pigpiod" >> rc.local
Install dalexgray's htu21 libary and get zerosensor
su pigit clone https://github.com/nwgat/zerosensorgit clone https://github.com/dalexgray/RaspberryPI_HTU21DFcp RaspberryPI_HTU21DF/HTU21DF.py zerosensor/cd zerosensor && python HTU21DF.py installsudo pip install arrow
Run zerosensor
rm -r data/datarm -r data/data.jsonpython2 zerosensor-basic.py(basicly logs to data file with format temp,humidity,timepython2 zerosensor-db.py(logs to mongodb)
Start the web server
python zerosensor-httpd.py- go to http://pizero:9000
- if you want to run it on port 80 aka http://pizero/ you can redirect it
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 9000