-
Couldn't load subscription status.
- Fork 984
Pi Zero w support #79
Description
Hi ,
i was trying to run the code on the Raspberry pi zero w , and even if i can install it with forcing the pi option
since it can't detect what platform is that when trying to use the code i get the following error :
Traceback (most recent call last):
File "/home/pi/Scripts/Live-Temperature-DHT11/AdafruitDHT.py", line 41, in
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
File "build/bdist.linux-armv6l/egg/Adafruit_DHT/common.py", line 91, in read_retry
File "build/bdist.linux-armv6l/egg/Adafruit_DHT/common.py", line 77, in read
File "build/bdist.linux-armv6l/egg/Adafruit_DHT/common.py", line 60, in get_platform
RuntimeError: Unknown platform.
so the work around was to copy the lib dir Adafruit_DHT to my script dir , and to made the following change in common.py
def get_platform():
"""Return a DHT platform interface for the currently detected platform."""
plat = platform_detect.platform_detect()
plat = platform_detect.RASPBERRY_PI <<<<<<<<<<<<<
if plat == platform_detect.RASPBERRY_PI:
# Check for version 1 or 2 of the pi.
version = platform_detect.pi_version()
version = 1 <<<<<<<<<<<<<<<<<
if version == 1:
from . import Raspberry_Pi
return Raspberry_Pi
elif version == 2:
from . import Raspberry_Pi_2
return Raspberry_Pi_2
else:
the question can you create an official solution for this please , thanks .....