-
1Step 1
Trim three jumper wires to 3 inches each. Use different colors if possible.
-
2Step 2
Strip the ends of the wires
-
3Step 3
Solder the wires to pins 1, 2, and 4 of the AM2302
-
4Step 4
Connect the AM2302 to the Raspberry Pi as follows
Pin 1 on the AM2302 to pin 1 (+3.3V) on the GPIO connector (labeled P1 on the raspi)
Pin 2 on the AM2302 to pin 7 (GPIO 4) on the GPIO connector
Pin 4 on the AM2302 to pin 9 (Ground) on the GPIO connector -
5Step 5
Cut some styrofoam or scrap wood to size. Hot glue the sensor to the case as you see fit.
-
6Step 6
Power on the Raspberry Pi and connect via SSH or locally attached keyboard and monitor.
Login as pi. NOT ROOT!
-
7Step 7
Update Raspbian
sudo apt-get update sudo apt-get upgrade sudo rpi-update
-
8Step 8
Reboot
-
9Step 9
Install wiringPi
git clone git://git.drogon.net/wiringPi cd wiringPi ./build
-
10Step 10
Modify rht03.c example with pin where sensor is connected
cd examples nano rht03.c
Change #define RHT03_PIN 0 to #define RHT03_PIN 7
Save the file
make rht03
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