Measure room temperature and write to MySQL database for use on website, iOS, and Apple Watch app.
[Temperature in 219] (https://server.myprevio.us)
Navigate to your working directory in Terminal.app.
$ cd /path/to/working/directory
Clone the repo to your directory.
$ git clone https://github.com/spetykowski/room-219.git
Clone szazo's DHT11 Python library repo to your directory.
$ git clone https://github.com/szazo/DHT11_Python.git
Rename file [config_example.py] (https://github.com/spetykowski/room-219/blob/master/config_example.py) to config.py.
$ mv config_example.py config.py
Edit your newly renamed config.py
host='hostname' # Host Name of MySQL Server
user='username' # Username used to conenct to MySQL Server
password='password' # Password used to conenct to MySQL Server
db='database' # Name of MySQL Database
charset='SQLcharset' # Charset for MySQL Database
pin=4 # refer to RaspberryPi GPIO pin layout
Room 219 can be started a number of ways. First is by calling Python to run the script.
$ python Room219.py start
Call the process directly: (file requires execute permissions)
$ ./Room219.py start
To run the script continiously in the background:
$ nohup ./Room219.py start &
Stop a background process with:
$ ./Room219.py stop