Close

Control a Humidifier with a Raspberry Pi

Back to project overview

Wirelessly control a humidifier based on time and humidity

Discussions

jerryhien wrote 06/06/2018 at 04:23 point

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

Lena wrote 08/05/2018 at 15:15 point

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

einsfck wrote 01/15/2017 at 16:53 point

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

einsfck wrote 01/16/2017 at 17:04 point

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

Jeremy wrote 03/18/2016 at 00:21 point

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

FiZiX wrote 03/18/2016 at 00:28 point

No worries! Happens to the best of us.

  Are you sure? yes | no

Jeremy wrote 03/17/2016 at 04:31 point

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

FiZiX wrote 03/17/2016 at 13:01 point

type "make rht03", not "make rht03.c"

  Are you sure? yes | no

hel wrote 06/30/2015 at 14:40 point

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

hel wrote 06/29/2015 at 13:23 point

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

FiZiX wrote 06/30/2015 at 02:10 point

Okay, try this:

cd ~
mkdir .git

  Are you sure? yes | no

hel wrote 06/29/2015 at 08:29 point

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

FiZiX wrote 06/29/2015 at 12:37 point

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

hel wrote 06/26/2015 at 14:00 point

chown -R pi .git/

chown: cannot access `.git/': No such file or directory
still get the same error

  Are you sure? yes | no

FiZiX wrote 06/26/2015 at 14:17 point

Try it with sudo:

sudo chown -R pi .git/

  Are you sure? yes | no

FiZiX wrote 06/25/2015 at 13:24 point

@hel Try this from your home directory:

chown -R pi .git/

  Are you sure? yes | no

hel wrote 06/25/2015 at 07:38 point

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

FiZiX wrote 06/24/2015 at 15:39 point

@hel That's a permissions issue. Are you sure you're in your home directory?

  Are you sure? yes | no

hel wrote 06/24/2015 at 14:58 point

on step 14 when running:

git fetch https://github.com/FiZiX/raspi-rht

  Are you sure? yes | no

hel wrote 06/24/2015 at 14:57 point

stuck with the error message

error: cannot open .git/Fetch_head: permission denied

  Are you sure? yes | no