From a5930acaf81204a8b0449a1db55d14c9dc5625e8 Mon Sep 17 00:00:00 2001 From: Jonny Ervine Date: Wed, 17 Jun 2015 12:26:47 +0800 Subject: [PATCH] modified: README.md modified: th.c --- README.md | 15 +++++++++++++++ th.c | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c4ad56..9c78601 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,18 @@ In this repository are my copies of the th.c code, a thd init script, and two fi The th.c code was modified so that a forth column in MySQL is used (an auto incrementing id - probably not strictly necessary as the ComputerTime entry is incrementing anyway), as well as having th detect if an incorrect temperature/humidity reading has been made (by checking against the previously recorded value) and silently not adding this to the MySQL database if it is seen to be a big change. Using a thd init script means that we don't need to modify /etc/rc.local - which is useful for me as this file is used by other projects and can be overwritten at times. + +## UPDATED - 17 June 2015 +Looking to replace the C code with a python script that takes a configuration file. Added here: + + - temp-humid-read-loop.py - python code to continuously loop and read the temperature and humidity settings + + - updateMysql.py - python code called by the loop script to update the MySQL database + + - temphumid.conf - sample configuration file to be used with the python script + + - dhtreader.so - binary shared object file. This has been created from (http://www.airspayce.com/mikem/bcm2835/)[http://www.airspayce.com/mikem/bcm2835/] + +#Please note this updated python code was heavily inspired by the work done by Adafruit here:# +(https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_DHT_Driver_Python)[https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_DHT_Driver_Python] + diff --git a/th.c b/th.c index 18ae956..f3bb187 100644 --- a/th.c +++ b/th.c @@ -132,7 +132,7 @@ int main() wiringPiSetup () ; piHiPri (55) ; - printf("th.c rev 1.9 04/06/2015 JDE %sCycle time: %i seconds, %i retries\n",ctime(&oldtime),CYCLETIME,RETRIES); + printf("th.c rev 1.10 11/06/2015 JDE %sCycle time: %i seconds, %i retries\n",ctime(&oldtime),CYCLETIME,RETRIES); fflush(stdout); MYSQL *con = mysql_init(NULL);