AsawariC
Posts: 10
Joined: Mon Aug 03, 2015 5:17 am

Raspberry_Pi_2_driver

Mon Aug 03, 2015 6:03 am

Need help on 'How to install Raspberry_Pi_2_Driver?' I have searched for Raspberry_Pi_2_Driver but could not get relevant info. Following is the python code lines for programming DHT-22 sensor on Raspbery Pi 2 model B. Please give your suggestions on this.
code for DHT-22 sensor in python :
>>> import Adafruit_DHT
>>> Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, '22')

Error encounter:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, '22')
File "Adafruit_DHT/common.py", line 90, in read_retry
humidity, temperature = read(sensor, pin, platform)
File "Adafruit_DHT/common.py", line 76, in read
platform = get_platform()
File "Adafruit_DHT/common.py", line 51, in get_platform
import Raspberry_Pi_2
File "Adafruit_DHT/Raspberry_Pi_2.py", line 22, in <module>
import Raspberry_Pi_2_Driver as driver
ImportError: No module named Raspberry_Pi_2_Driver

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: Raspberry_Pi_2_driver

Mon Aug 03, 2015 8:21 am

How did you install the Adafruit_DHT module? Did you follow these instructions: https://github.com/adafruit/Adafruit_Python_DHT

I can see the driver you need in the "source" folder so I suspect it would be built when you run the necessary installation commands.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

AsawariC
Posts: 10
Joined: Mon Aug 03, 2015 5:17 am

Re: Raspberry_Pi_2_driver

Mon Aug 03, 2015 9:01 am

Thank you for the reply.
yes, I followed the instruction in the mentioned link.
Also found the driver in source folder and the code is in the same folder as the driver is in. still i get this error and don't know how to get rid of that error. could you suggest something?

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Raspberry_Pi_2_driver

Mon Aug 03, 2015 10:06 am

Are you using python2 or python3?

You have to install external libraries twice, once for each flavour of python.

sudo python setup.py install
will use python2

sudo python3 setup.py install
will install it for python3 (if it's compatible)
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

AsawariC
Posts: 10
Joined: Mon Aug 03, 2015 5:17 am

Re: Raspberry_Pi_2_driver

Tue Aug 04, 2015 4:47 am

Thank you for the reply.
I am using python2.
However, I tried installing external libraries twice as suggested but still getting the same ImportError: No module named Raspberry_Pi_2_Driver.
I am still trying to solve this..
If you could suggest me anything further on this, I would be very thankful.

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Raspberry_Pi_2_driver

Tue Aug 04, 2015 6:45 am

Contact Adafruit, or make a comment on the relevant Adafruit product webpage. That would of been the first place I would of asked.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Raspberry_Pi_2_driver

Tue Aug 04, 2015 7:43 am

texy wrote:Contact Adafruit, or make a comment on the relevant Adafruit product webpage. That would of been the first place I would of asked.
Texy
I would use their forums: https://forums.adafruit.com/

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Raspberry_Pi_2_driver

Tue Aug 04, 2015 8:16 am

DirkS wrote:
texy wrote:Contact Adafruit, or make a comment on the relevant Adafruit product webpage. That would of been the first place I would of asked.
Texy
I would use their forums: https://forums.adafruit.com/
YesI would've included a link, but I can't access those sites during work times :o
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

AsawariC
Posts: 10
Joined: Mon Aug 03, 2015 5:17 am

Re: Raspberry_Pi_2_driver

Wed Aug 05, 2015 4:57 am

Thank you very much for the reply.
I will do accordingly.

techspree
Posts: 1
Joined: Sat Dec 26, 2015 4:55 pm

Re: Raspberry_Pi_2_driver

Sat Dec 26, 2015 4:59 pm

I had the same problem and found the solution!

Just make sure you are in the examples path
  • pi@raspberrypi ~/Adafruit_Python_DHT/examples
Then run the program with
  • sudo AdafruitDHT.py 22 23
where 22 means it is DHT22 and GPIO pin is 23


Hope this helps.

uglyotter
Posts: 1
Joined: Fri Jul 15, 2016 1:53 pm

Re: Raspberry_Pi_2_driver

Fri Jul 15, 2016 1:59 pm

Hey,
same prob here - the script works when using it in the examples path. But why do they only work there? I actually wanted to move my scripts to /root.

Return to “Python”