Skip to content

ramyadhadidi/pi_sensor_webserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pi Zero Temperature Sensor + Webserver

A temperature and humidity sensor (Si7021) with an OLED screen on top of Pi Zero. The OLED shows temperature in C and F, and humidity. It is refreshed every 15 seconds. In the background, the average of every half an hour is recorded in a csv file. The csv file is later read by pandas, and Dash for the webserver for visualization. You have a basic selection of the days for the range of dates in the csv file. You can access it on http://[pi_ip]:8050/, and should show something like:

What's inside:

Software:

  • Latest version of HypriotOS
  • Flash it to your SD card with this guide we made here
  • Set your WiFi network in /etc/wpa_supplicant/wpa_supplicant.conf based on the guide.
  • SSH to your pi, after finding its IP on your local WiFi: pi@192.168.x.x
  • git clone this repo, I assume at /home/pi for the rest.
  • Install pandas and dash with pip3.
  • To startup the codes create /etc/rc.local, chmod +x /etc/rc.local, and edit it with sudo vim /etc/rc.local
#!/bin/sh
#
# rc.local - executed at the end of each multiuser runlevel
#
# Make sure that the script will "exit 0" on success or any other
# value on error.

sudo echo "$(date +%s),$(date),$(uname -a)"  >> /home/pi/logs/reboot.log
sudo python3 /home/pi/boot_oled.py > /dev/null 2>&1
sudo python3 /home/pi/update_oled.py > /dev/null 2>&1 &
sudo python3 /home/pi/app.py > /dev/null 2>&1 &

Additional Tools On My Pi

About

Pi Zero Temperature Sensor with Webserver for graphs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages