adafruit / Adafruit_CircuitPython_DHT

CircuitPython support for DHT11 and DHT22 type temperature/humidity devices
MIT License
179 stars 62 forks source link

PulseIO NotImplemented Error raised #54

Closed yeyeto2788 closed 3 years ago

yeyeto2788 commented 3 years ago

Hey guys!

I have installed blinka plus this library (as editable) in order to make some changes for the issue #32 and as @ladyada suggested on this PR in blinka but now I'm getting this error:

Traceback (most recent call last):
  File "a.py", line 3, in <module>
    import adafruit_dht
  File "/home/yeyeto2788/workspace/dht_implementation/venv/src/adafruit-circuitpython-dht/adafruit_dht.py", line 38, in <module>
    from pulseio import PulseIn
  File "/home/yeyeto2788/workspace/dht_implementation/venv/lib/python3.8/site-packages/pulseio.py", line 34, in <module>
    raise NotImplementedError("pulseio not supported for this board.")
NotImplementedError: pulseio not supported for this board.

In the past I did not experience this issue before but even setting the argument use_pulseio does not get properly passed to it.

Script used:

import time
import board
import adafruit_dht
dhtDevice = adafruit_dht.DHT11(board.PG7, use_pulseio=False)

for try_number in range(1,11):
  print(f"Try number {try_number}")
  try:
    print(f"Got temp of: {dhtDevice.temperature}")
    print(f"And hum of: {dhtDevice.humidity}")
  except RuntimeError as e:
    print(e)
    time.sleep(2)
  else:
    time.sleep(2)
  print("\n")

Debug info: