Page 1 of 1

After update DHT22 with read (Adafruit_DHT.read_retry..

Posted: Tue May 02, 2017 12:21 pm
by Mettauk
After running sudo apt-get update && sudo apt-get dist-upgrade, Adafruit DHT no longer works?

Its as though the software no longer recognises the pi?
Error i get from running a python script to read DHT22

Code: Select all

 $ sudo python humtemp.py
Traceback (most recent call last):
  File "humtemp.py", line 15, in <module>
    humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
  File "build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py", line 90, in read_r                                etry
  File "build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py", line 76, in read
  File "build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py", line 56, in get_pl                                atform
  File "build/bdist.linux-armv7l/egg/Adafruit_DHT/Beaglebone_Black.py", line 24,                                 in <module>
ImportError: cannot import name Beaglebone_Black_Driver
I reinstalled Adafruit_Python_DHT-master and got the following result

Code: Select all

:~/Adafruit_Python_DHT-master $ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing Adafruit_DHT.egg-info/PKG-INFO
writing top-level names to Adafruit_DHT.egg-info/top_level.txt
writing dependency_links to Adafruit_DHT.egg-info/dependency_links.txt
reading manifest file 'Adafruit_DHT.egg-info/SOURCES.txt'
writing manifest file 'Adafruit_DHT.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
running build_ext
building 'Adafruit_DHT.Beaglebone_Black_Driver' extension
creating build/temp.linux-armv7l-2.7/source/Beaglebone_Black
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTI                     FY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c sourc                     e/_Beaglebone_Black_Driver.c -o build/temp.linux-armv7l-2.7/source/_Beaglebone_Black_Driver.o -std=gnu99
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTI                     FY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c sourc                     e/common_dht_read.c -o build/temp.linux-armv7l-2.7/source/common_dht_read.o -std=gnu99
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTI                     FY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c sourc                     e/Beaglebone_Black/bbb_dht_read.c -o build/temp.linux-armv7l-2.7/source/Beaglebone_Black/bbb_dht_read.o -std=gnu                     99
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTI                     FY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c sourc                     e/Beaglebone_Black/bbb_mmio.c -o build/temp.linux-armv7l-2.7/source/Beaglebone_Black/bbb_mmio.o -std=gnu99
source/Beaglebone_Black/bbb_mmio.c: In function âbbb_mmio_get_gpioâ:
source/Beaglebone_Black/bbb_mmio.c:69:25: warning: argument to âsizeofâ in âmemsetâ call is the same expression                      as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
   memset(gpio, 0, sizeof(gpio));
                         ^
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DND                     EBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=f                     ormat-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security bui                     ld/temp.linux-armv7l-2.7/source/_Beaglebone_Black_Driver.o build/temp.linux-armv7l-2.7/source/common_dht_read.o                      build/temp.linux-armv7l-2.7/source/Beaglebone_Black/bbb_dht_read.o build/temp.linux-armv7l-2.7/source/Beaglebone                     _Black/bbb_mmio.o -lrt -o build/lib.linux-armv7l-2.7/Adafruit_DHT/Beaglebone_Black_Driver.so
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/common.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Beaglebone_Black.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/platform_detect.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Beaglebone_Black_Driver.so -> build/bdist.linux-armv7l/egg/Adafr                     uit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Raspberry_Pi_2_Driver.so -> build/bdist.linux-armv7l/egg/Adafrui                     t_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Raspberry_Pi.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/__init__.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Test.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
copying build/lib.linux-armv7l-2.7/Adafruit_DHT/Raspberry_Pi_2.py -> build/bdist.linux-armv7l/egg/Adafruit_DHT
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py to common.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Beaglebone_Black.py to Beaglebone_Black.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/platform_detect.py to platform_detect.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi.py to Raspberry_Pi.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Test.py to Test.pyc
  File "build/bdist.linux-armv7l/egg/Adafruit_DHT/Test.py", line 22
    import .Test_Driver as driver
           ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi_2.py to Raspberry_Pi_2.pyc
creating stub loader for Adafruit_DHT/Beaglebone_Black_Driver.so
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_DHT/Beaglebone_Black_Driver.py to Beaglebone_Black_Driver.p                     yc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_DHT.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
writing build/bdist.linux-armv7l/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating 'dist/Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg
Removing /usr/local/lib/python2.7/dist-packages/Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg
Copying Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg to /usr/local/lib/python2.7/dist-packages
Adafruit-DHT 1.2.0 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/Adafruit_DHT-1.2.0-py2.7-linux-armv7l.egg
Processing dependencies for Adafruit-DHT==1.2.0
Finished processing dependencies for Adafruit-DHT==1.2.0
pi@

Re: After update DHT22 with read (Adafruit_DHT.read_retry..

Posted: Tue May 02, 2017 12:23 pm
by fredoll
update to the latest version of the Adafruit library.
There was a change in the name of the CPU reported in /proc/cpuinfo

Re: After update DHT22 with read (Adafruit_DHT.read_retry..

Posted: Tue May 02, 2017 12:24 pm
by joan
What has the Beaglebone Black got to do with the Raspberry Pi?

Re: After update DHT22 with read (Adafruit_DHT.read_r.(FIXED

Posted: Tue May 02, 2017 12:32 pm
by Mettauk
fredoll wrote:update to the latest version of the Adafruit library.
There was a change in the name of the CPU reported in /proc/cpuinfo
Ah, thank you. That fixed it. When did something change because I'm also having trouble we a web port and WEBiopi?

Re: After update DHT22 with read (Adafruit_DHT.read_retry..

Posted: Tue May 02, 2017 12:33 pm
by Mettauk
joan wrote:What has the Beaglebone Black got to do with the Raspberry Pi?
Very little except the Adafruit software works with both and throws an error if it can find either!