myhouse-project / myhouse-docker

myHouse on Docker
https://hub.docker.com/r/myhouseproject/myhouse
0 stars 0 forks source link

DHT plug-in is unable to import the RPi driver #1

Open raulmarinperez opened 5 years ago

raulmarinperez commented 5 years ago

While trying to setup a sensor using the DHT plug-in, I face the following issue:

[2019-02-03 13:15:18] [sensors.py:91 - poll()] WARNING: [indoor][temperature][living_room] unable to poll: Traceback (most recent call last):| File "/apps/myHouse/sensors.py", line 85, in poll| data = plugins[sensor['plugin']['plugin_name']].poll(sensor)| File "/apps/myHouse/plugin_dht.py", line 22, in poll| humidity, temperature = Adafruit_DHT.read_retry(dht_sensor,sensor["plugin"]["pin"])| File "build/bdist.linux-armv6l/egg/Adafruit_DHT/common.py", line 94, in read_retry| humidity, temperature = read(sensor, pin, platform)| File "build/bdist.linux-armv6l/egg/Adafruit_DHT/common.py", line 80, in read| platform = get_platform()| File "build/bdist.linux-armv6l/egg/Adafruit_DHT/common.py", line 55, in get_platform| from . import Raspberry_Pi_2| File "build/bdist.linux-armv6l/egg/Adafruit_DHT/Raspberry_Pi_2.py", line 22, in <module>|ImportError: cannot import name Raspberry_Pi_2_Driver|

Looks like the Docker image is missing some dependencies to make the sensor work.

user2684 commented 5 years ago

Definitely looks like a bug in the library or better the way it was installed:

Solutions provided in the links do not apply here since neither we are running in the library folder nor we are using python3. I tried installing previous and latest version without luck. Instead apparently looks like the latest version installed with pip works fine (originally it was not installed through pip since couldn't provide the force-pi argument which was required) but I need to apply it to the docker image to confirm, will keep you posted!

user2684 commented 5 years ago

Hey, give this updated docker image a try whenever you can, no hurry: myhouseproject/myhouse:2.4-1 I found the way to install the library via pip with pip install Adafruit-Python-DHT --install-option="--force-pi" and seems working now. Thanks!