Due to high demand and inclement weather, expect some shipping delays at this time, orders may not ship for 4-5 business days.
0

Trinket M0 + DHT 22 Issue: Bitbanging Exception
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket M0 + DHT 22 Issue: Bitbanging Exception

by Peterzhao on Fri Dec 03, 2021 5:54 pm

Hi everyone!

I currently working on a project with Trinket M0 and DHT22. I'm following the exact tutorials here:
https://learn.adafruit.com/dht/dht-circuitpython-code

I have Circuitpython 7.0.0 installed on the M0. I got the adafruit_dht.mpy file for the 7.x circuitpython . And I copy and pasted the exact code from the tutorial(With the same wiring on D2). But went I ran the code I got the following error:

Traceback (most recent call last):
File "main.py", line 6, in <module>
File "adafruit_dht.py", line 305, in __init__
File "adafruit_dht.py", line 82, in __init__

Exception: Bitbanging is not supported when using CircuitPython.
Code done running.

From reading the DHT library source code:
if "Linux" not in uname() and not self._use_pulseio:
raise Exception("Bitbanging is not supported when using CircuitPython.")

I suspect the issue is use_pulseio is set the False.

And I don't why that's the case. I thought M0 had pulseio enable for the pins?

Any help is appreciated. Thank you!

Peterzhao
 
Posts: 1
Joined: Fri Dec 03, 2021 5:41 pm

Re: Trinket M0 + DHT 22 Issue: Bitbanging Exception

by dastels on Fri Dec 03, 2021 6:21 pm

The TrinketM0 does not include pulseio. I don't know why that is presenting a problem... I see if I can get someone more involved to have a look at that logic.

Dave

dastels
 
Posts: 8500
Joined: Tue Oct 20, 2015 3:22 pm

Re: Trinket M0 + DHT 22 Issue: Bitbanging Exception

by dastels on Fri Dec 03, 2021 6:54 pm

So, pulseio is only available on full-size CP builds. See https://github.com/adafruit/circuitpython/pull/4696 for background.

Also relevant is https://learn.adafruit.com/modern-replacements-for-dht11-dht22-sensors

Dave

dastels
 
Posts: 8500
Joined: Tue Oct 20, 2015 3:22 pm

Re: Trinket M0 + DHT 22 Issue: Bitbanging Exception

by adafruit_support_carter on Fri Dec 03, 2021 6:57 pm

This is due to a change that occurred with 7.x release of CircuitPython. Opened a new issue for this here:
https://github.com/adafruit/Adafruit_Ci ... /issues/78

For now, can try reverting to an older version of CP. Here's a link to 6.3.0 firmware, which is last pre-7.x release:
https://adafruit-circuit-python.s3.amaz ... -6.3.0.uf2

adafruit_support_carter
 
Posts: 22294
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.