Sudo python /usr/lib/cgi-bin/temp-monitor.py & You then have to change again /etc/rc.local and insert a line for the program to start when the Rpi is rebooted : ![]() You need to register (it's free) an account to upload the data.Īfter that you will have an ID and a password which you sould change in the cmd variable as shownĬmd = "curl "+"' &PASSWORD= &dateutc=now&tempf="+str((temp*1.8)+32)+"&humidity="+str(round(humidity,2))+"&baromin="+str((pressure/100)*0.0295299)+"&action=updateraw"+"'" This website provides some really nice stats and graphs. The cmd variable is responsible for sending the data to using curl. Not importante stuff, but you cam always check them if you like There is a few calculations inside these functions, but this is all according to the sensors datasheet. It is necessary for the following function read_humidity. ![]() Read_temperature is a function that will read the temperature of the HUT21D for compensation when calculating the relative humidity. Import Adafruit_BMP.BMP085 as BMP085 import smbus import os import sys import getopt import sqlite3 import math import pigpio import timeįollowing the program we have 2 functions that will read humidity. ![]() The first part of the program shows the libraries needed. You should have python installed, if not, just follow
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |