-
11Step 11
Test sensor by running rht03
sudo ./rht03
You should see continuous temperature and humidity readings. If not, make sure the sensor is connected correctly.
Press Ctrl-C to quit
-
12Step 12
Install Python headers
sudo apt-get install python-setuptools python-dev sudo easy_install -U gevent==1.1b4
-
13Step 13
Install ouimeaux for WeMo control
sudo easy_install ouimeaux
This will take a while. Equip beer.
-
14Step 14
Fetch raspi-rht from GitHub
cd ~ git init git clone https://github.com/FiZiX/raspi-rht
-
15Step 15
Copy makefile from wiringPi and compile th_2
cd raspi-rht cp ~/wiringPi/examples/Makefile . make th_2
-
16Step 16
Change control.xml to match your preferences and environment
Read the comments in the file to understand what each setting means.
-
17Step 17
Test control.py
python ~/raspi-rht/control.py
The command should run for about 7 seconds (sometimes longer) and finish with no output.
View control.xml and make sure the status fields have populated.
The <startedDateTime /> and <stoppedDateTime /> will remain empty if the current time is outside the period in which the humidifier should run or if the target RH has already been reached.
-
18Step 18
Set control.py to run every five minutes
crontab -e
Add this to the end of the file*/5 * * * * python /home/pi/raspi-rht/control.py >> /home/pi/raspi-rht/control.log
Save changes
-
19Step 19
** The following steps are only required if you want to monitor raspi-rht via a web page. **
-
20Step 20
Install CherryPy
sudo easy_install cherrypy
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Hello ! I'm new here, i'm use Raspbian and Raspberrypi 3 model B+
Step 17, I run the command: "python ~/raspi-rht/control.py"
, it show the error bellow, please help me fix that error:
"pi@rp:~ $ python ~/raspi-rht/control.py
Traceback (most recent call last):
File "/home/pi/raspi-rht/control.py", line 4, in <module>
from ouimeaux.environment import Environment
File "/usr/local/lib/python2.7/dist-packages/ouimeaux-0.8-py2.7.egg/ouimeaux/environment.py", line 16, in <module>
from ouimeaux.subscribe import SubscriptionRegistry
File "/usr/local/lib/python2.7/dist-packages/ouimeaux-0.8-py2.7.egg/ouimeaux/subscribe.py", line 7, in <module>
from gevent.wsgi import WSGIServer
ImportError: No module named wsgi"
Are you sure? yes | no
Hey Jerry! I just worked through this and found that when I installed gevent that it installed a newer version. You can check what you install by running "pip freeze". Since I had the wrong version I tried installing again using "sudo pip install gevent==1.1b4". It seems to work now. Hope this helps!
Are you sure? yes | no
Hello. First off, thanks for building and documenting this project. It will save me a ton of money on a "high end" humidifier system. I am experiencing two problems that hopefully you can help with. 1. I'm getting a 500 error on the webpage for the device. Below is the error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/CherryPy-8.9.0-py2.7.egg/cherrypy/_cprequest.py", line 670, in respond
response.body = self.handler()
File "/usr/local/lib/python2.7/dist-packages/CherryPy-8.9.0-py2.7.egg/cherrypy/lib/encoding.py", line 220, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/CherryPy-8.9.0-py2.7.egg/cherrypy/_cpdispatch.py", line 60, in __call__
return self.callable(*self.args, **self.kwargs)
File "/home/pi/raspi-rht/web/index.py", line 44, in index
s = datetime.strptime(lastStart, timeFormatIn)
TypeError: must be string, not None
2. I'm having an issue when running "python ~/raspi-rht/control.py" a second time. It worked fine the first time it ran. I'm getting this error:
Traceback (most recent call last):
File "home/pi/raspi-rht/control.py, line 141 in <modules>
switch = connectToWeMo(env, switchName)
File "home/pi/raspi-rht/control.py, line 22 in connectToWemMo
return env.get_switch(switchName)
File "/usr/local/local/lib/python2.7/dis-packages/ouimeaux-0.8-py2.7.egg/ouimeaux/environment.py", line 223, in get_switch
raise UnknownDevice(name)
ouimeaux.environment.UnknownDevice: humidifier
When running "wemo list", my device "humidifier" comes up. I'm also able to switch it on and off from the wemo command line.
Any thoughts? Thanks in advance.
-einsfck
Are you sure? yes | no
I was able to resolve the web site issue by filling in the startedDateTime and stoppedDateTime in the control.xml file. That said, I'm sure the information wasn't auto populated due the program not running properly. Thanks.
-einsfck
Are you sure? yes | no
That gave me an error too. Turns out I had omitted a space between the RHT03_PIN and the 7 and it didn't like that. Figures it would be one of the simpler steps that tripped me up. Thank you for your response.
Are you sure? yes | no
No worries! Happens to the best of us.
Are you sure? yes | no
I am stuck. I have been following all the instructions, but when I get to the "make rht03.c" I get an error that says: "Nothing to be done for rht03.c. So, that sounds like positive news, but when I go to the next command, "sudo ./rht03.c", I get a command not found error. I am a noob of the highest order so I am sure the problem is my lack of experience. What am I not doing right
Are you sure? yes | no
type "make rht03", not "make rht03.c"
Are you sure? yes | no
sudo git init
Reinitialized existing Git repository in /home/pi/.git/
pi@temperature ~ $ sudo git fetch https://github.com/FiZiX/raspi-rht
remote: Counting objects: 266, done.
remote: Total 266 (delta 0), reused 0 (delta 0), pack-reused 266
Receiving objects: 100% (266/266), 38.50 KiB, done.
Resolving deltas: 100% (149/149), done.
From https://github.com/FiZiX/raspi-rht
* branch HEAD -> FETCH_HEAD
pi@temperature ~ $ cd raspi-rht
-bash: cd: raspi-rht: No such file or directory
pi@temperature ~ $ cd ~
pi@temperature ~ $ cd raspi-rht
-bash: cd: raspi-rht: No such file or directory
pi@temperature ~ $ ls
python_games wiringPi
pi@temperature ~ $ ls -la
total 36
drwxr-xr-x 5 pi pi 4096 Jun 30 08:07 .
drwxr-xr-x 3 root root 4096 Dec 21 2014 ..
-rw------- 1 pi pi 973 Jun 29 09:32 .bash_history
-rw-r--r-- 1 pi pi 220 Dec 21 2014 .bash_logout
-rw-r--r-- 1 pi pi 3243 Dec 21 2014 .bashrc
drwxr-xr-x 7 pi pi 4096 Jun 30 13:49 .git
-rw-r--r-- 1 pi pi 675 Dec 21 2014 .profile
drwxrwxr-x 2 pi pi 4096 Mar 10 2013 python_games
drwxr-xr-x 9 pi pi 4096 Jun 26 09:38 wiringPi
pi@temperature ~ $ cd raspi-rht
-bash: cd: raspi-rht: No such file or directory
pi@temperature ~ $ ls
python_games wiringPi
pi@temperature ~ $ cd wiringPi/
pi@temperature ~/wiringPi $ ls
build COPYING.LESSER debian devLib examples gpio INSTALL People pins RE
pi@temperature ~/wiringPi $ cd raspi-rht
-bash: cd: raspi-rht: No such file or directory
pi@temperature ~/wiringPi $ sudo chown -R pi .git/
pi@temperature ~/wiringPi $ ls ~
python_games wiringPi
pi@temperature ~/wiringPi $ sudo chown -R pi .git/
pi@temperature ~/wiringPi $ chown -R pi .git/
pi@temperature ~/wiringPi $ mkdir raspi-rht
pi@temperature ~/wiringPi $ rmdir
debian/ examples/ gpio/ raspi-rht/
devLib/ .git/ pins/ wiringPi/
pi@temperature ~/wiringPi $ rmdir
debian/ examples/ gpio/ raspi-rht/
devLib/ .git/ pins/ wiringPi/
pi@temperature ~/wiringPi $ rmdir raspi-rht
pi@temperature ~/wiringPi $ ls
build debian examples INSTALL pins VERSION
COPYING.LESSER devLib gpio People README.TXT wiringPi
pi@temperature ~/wiringPi $ cd ~
pi@temperature ~ $ mkdir raspi-rht
pi@temperature ~ $ ls
python_games raspi-rht wiringPi
pi@temperature ~ $ cd raspi-rht
pi@temperature ~/raspi-rht $ cp ~/wiringPi/examples/Makefile .
pi@temperature ~/raspi-rht $ make th_2
make: *** No rule to make target 'th_2'. Stop.
Hi mate i manage to figure it out what was the issue with the previous command, i think i just had to re-initiate the service. but now i get stuck on the make th2, any ideas what this might be?
Are you sure? yes | no
pi@temperature ~ $ ls -la
total 32
drwxr-xr-x 4 pi pi 4096 Jun 26 09:38 .
drwxr-xr-x 3 root root 4096 Dec 21 2014 ..
-rw------- 1 pi pi 973 Jun 29 09:32 .bash_history
-rw-r--r-- 1 pi pi 220 Dec 21 2014 .bash_logout
-rw-r--r-- 1 pi pi 3243 Dec 21 2014 .bashrc
-rw-r--r-- 1 pi pi 675 Dec 21 2014 .profile
drwxrwxr-x 2 pi pi 4096 Mar 10 2013 python_games
drwxr-xr-x 9 pi pi 4096 Jun 26 09:38 wiringPi
pi@temperature ~ $
Are you sure? yes | no
Okay, try this:
cd ~
mkdir .git
Are you sure? yes | no
Hi mate I already try that. unfortunately to no avail.
pi@temperature ~ $ sudo chown -R pi .git/
chown: cannot access `.git/': No such file or directory
I try to start a few times, perhaps was something I was missing but always get stuck there
Are you sure? yes | no
Okay. Maybe we should have checked the basics first. Please perform the following command from your home directory and post the results:
ls -la
Are you sure? yes | no
chown -R pi .git/
chown: cannot access `.git/': No such file or directory
still get the same error
Are you sure? yes | no
Try it with sudo:
sudo chown -R pi .git/
Are you sure? yes | no
@hel Try this from your home directory:
chown -R pi .git/
Are you sure? yes | no
pi@raspberrypi ~ $ git fetch https://github.com/FiZiX/raspi-rht/
error: cannot open .git/FETCH_HEAD: Permission denied
pi@raspberrypi ~ $ pwd
/home/pi
pi@raspberrypi ~ $
So... I'm in my home directory, any advice??
Are you sure? yes | no
@hel That's a permissions issue. Are you sure you're in your home directory?
Are you sure? yes | no
on step 14 when running:
git fetch https://github.com/FiZiX/raspi-rht
Are you sure? yes | no
stuck with the error message
error: cannot open .git/Fetch_head: permission denied
Are you sure? yes | no