ZeroSensor Quick & Easy

go home ;)

  • cd /home/pi/

setup i2c

  • sudo apt-get update && sudo apt-get install -y python-smbus i2c-tools
  • sudo su
  • echo "i2c-bcm2708" >> /boot/config.txt
  • echo "i2c-dev" >> /boot/config.txt

Install pigpio

  • su pi
  • git clone https://github.com/joan2937/pigpio && cd pigpio
  • sudo make && sudo make install
  • sudo pigpiod
  • sudo su
  • echo "pigpiod" >> rc.local

Install dalexgray's htu21 libary and get zerosensor

  • su pi
  • git clone https://github.com/nwgat/zerosensor
  • git clone https://github.com/dalexgray/RaspberryPI_HTU21DF
  • cp RaspberryPI_HTU21DF/HTU21DF.py zerosensor/
  • cd zerosensor && python HTU21DF.py install
  • sudo pip install arrow

Run zerosensor

  • rm -r data/data
  • rm -r data/data.json
  • python2 zerosensor-basic.py (basicly logs to data file with format temp,humidity,time
  • python2 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