guild icon
Toit
#RMT driver fail when running the DHT11 example code
Thread channel in help
Sedmund
Sedmund 03/16/2024 10:58 PM
Hello! Me and my friend wanted to implement a DHT11 temperature sensor to our project. But when we try to run the tutorial code that is provided in the TOIT documentation we get this error:
E (13509) rmt(legacy): rmt_set_gpio(519): RMT GPIO ERROR E (13509) rmt(legacy): rmt_config(673): set gpio for RMT driver failed ****************************************************************************** Decoding by jag, device has version <2.0.0-alpha.141> ****************************************************************************** EXCEPTION error. UNKNOWN ERROR 0x102(258) 0: rmt-config-tx_ <sdk>/rmt.toit:579:3 1: Channel.configure <sdk>/rmt.toit:421:5 2: Channel <sdk>/rmt.toit:321:12 3: Driver <pkg:toit-dhtxx>/driver_.toit:46:20 4: Dht11 <pkg:toit-dhtxx>/dht11.toit:19:5 5: main temperatureDHT.toit:8:13 ******************************************************************************

The error traces back to this line in the driver_.toit:
channel_out_ = rmt.Channel pin --output --channel_id=out_channel_id --idle_level=1

We have tried the DHT11 sensor on an ESP-WROOM-32 and a Heltec Wireless Stick Lite V3 and we get the same error. So we don't think it is the devices or the circuit that causes it.
(edited)
SedmundOPSedmund
Hello! Me and my friend wanted to implement a DHT11 temperature sensor to our project. But when we try to run the tutorial code that is provided in the TOIT documentation we get th...(edited)
floitsch
floitsch 03/17/2024 07:22 PM
Let me see if I can reproduce.
floitsch
floitsch 03/17/2024 07:40 PM
Unfortunately I don't have any DHT11 at home at the moment. I will test tomorrow (Monday) at work.
That said, installing the program on my ESP32 (without any sensor connected) fails a bit later than the stacktrace you provided.
Could you try that as well? Just to see if you get the same error without any DHT11.
For me I then get:
[jaguar] INFO: program 2b596f2c-1c25-73bd-db34-5032e9ab1c88 started E rmt(legacy): RMT RX BUFFER FULL E rmt(legacy): RMT RX BUFFER FULL ****************************************************************************** Decoding by `jag`, device has version <2.0.0-alpha.142> ****************************************************************************** EXCEPTION error. insufficient signals from DHT 0: Driver.read-data-no-catch_ <pkg:toit-dhtxx>/driver_.toit:130:7 1: Driver.read-data_.<block>.<block>.<block> <pkg:toit-dhtxx>/driver_.toit:94:18 2: Task_.with-deadline_.<block> <sdk>/core/task.toit:223:16 3: Task_.with-deadline_ <sdk>/core/task.toit:217:3 4: with-timeout <sdk>/core/utils.toit:182:24 5: with-timeout <sdk>/core/utils.toit:174:10 6: Driver.read-data_.<block>.<block> <pkg:toit-dhtxx>/driver_.toit:93:9 7: catch.<block> <sdk>/core/exceptions.toit:124:10 8: catch <sdk>/core/exceptions.toit:122:1 9: catch <sdk>/core/exceptions.toit:73:10 10: Driver.read-data_.<block> <pkg:toit-dhtxx>/driver_.toit:92:7 11: SmallInteger_.repeat <sdk>/core/numbers.toit:1194:3 12: Driver.read-data_ <pkg:toit-dhtxx>/driver_.toit:91:14 13: Driver.read <pkg:toit-dhtxx>/driver_.toit:61:13 14: main.<block> dht11.toit:11:18 15: Duration.of <sdk>/core/time.toit:105:10 16: Duration.periodic <sdk>/core/time.toit:160:19 17: main dht11.toit:10:24 ******************************************************************************
Sedmund
Sedmund 03/17/2024 09:32 PM
Okay I fixed it while trying to get your stacktrace.

What happened was that in that DHT11 example code, we had changed the analoge pin from GPIO 32 to use GPIO 35 instead. We had read in the TOIT documentation that all ADC1 pins was okay to use. So when I now tried to run the code and test every ADC1 pin without anything connected to the ESP, I only got your error stacktrace when I tried GPIO 32, which is the one used in the TOIT documentation for the DHT11. All the other ADC1 pins (except GPIO 33) got the stacktrace I first presented.

So in the end, when I tried the code with the DHT11 connected to GPIO 32 it all works perfectly. If only we would have tried that in the beginning :😮‍💨:.
floitsch
floitsch 03/17/2024 09:33 PM
Hmm. We should give a better error when the wrong pin is used. It's a bit hard die to all the different variants.
Glad it works for you now.
floitsch
floitsch 03/17/2024 09:34 PM
(btw it's not an analog pin. Or at least we are not using the analog functionality of it).
6 messages in total