DHT Humidity sensor tutorial
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

DHT Humidity sensor tutorial

by JustRaspberry on Mon Feb 18, 2013 2:20 pm

Greetings,
I am running a last step of dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging.pdf. The last step requires me to run python script of the Adafruit_DHT_googledocs.ex.py . After typing python Adafruit_DHT_googledocs.ex.py I received a following error message.


python Adafruit_DHT_googledocs.ex.py
bcm2835_init: Unable to open /dev/mem: Permission denied
Traceback (most recent call last):
File "Adafruit_DHT_googledocs.ex.py", line 44, in <module>
output = subprocess.check_output(["./Adafruit_DHT", "2302", "4"]);
File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['./Adafruit_DHT', '2302', '4']' returned non-zero exit status 1

I am new to python. I know that my device is working and communicate with the rpi . The last step is to communicate dht22 with rpi and google spreadsheet.
I assume that python script has error or some other process is missing something to do with bc2835. Another issue could be directories?
Any ideas are appreciated.
JustRaspberry
 
Posts: 6
Joined: Sun Feb 17, 2013 2:32 pm

Re: DHT Humidity sensor tutorial

by adafruit_support_rick on Tue Feb 19, 2013 11:12 am

Did you run the script with sudo?

adafruit_support_rick
 
Posts: 13705
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: DHT Humidity sensor tutorial

by JustRaspberry on Tue Feb 19, 2013 5:45 pm

Nope, I'll check it.
JustRaspberry
 
Posts: 6
Joined: Sun Feb 17, 2013 2:32 pm

Re: DHT Humidity sensor tutorial

by JustRaspberry on Tue Feb 19, 2013 9:21 pm

Yes, it works....It funny that every command has to start with sudo....
Thank you for your support. :D
JustRaspberry
 
Posts: 6
Joined: Sun Feb 17, 2013 2:32 pm

Re: DHT Humidity sensor tutorial

by adafruit_support_rick on Wed Feb 20, 2013 10:54 am

Don't know that it's every command, but in that step you're writing to the protected kernel area of the file system.

adafruit_support_rick
 
Posts: 13705
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY