guild icon
Toit
#too many DHTXX devices ?
Thread channel in help
kaxori
kaxori 03/14/2025 11:06 AM
For plant cultivation, I would like to use several DHTxx sensors to check the favorable germination environment. The prototype uses an ESP32 'wroom'. Four sensors can be configured in the application. An exception error is generated when initializing the fifth sensor:
EXCEPTION error. ALREADY_IN_USE 0: gpio-use_ <sdk>\gpio\gpio.toit:855:5

The Toit DHTxx package uses RMT-devices.

ESP32 shout provide 8 RMT channels.
Is it possible to use more than 4 devices on an ESP32-Wroom ?
floitsch
floitsch 03/14/2025 11:07 AM
We are using two RMT channels per device. One for reading and one for writing. And they have to run at the same time...
floitsch
floitsch 03/14/2025 11:08 AM
You could just close the ones you are currently not using and just run through them one by one
kaxori
kaxori 03/14/2025 11:09 AM
that explains it:💡:
floitsch
floitsch 03/14/2025 11:09 AM
The protocol of the dht is also slow enough that it works in software. Not super reliably, but still.
floitsch
floitsch 03/14/2025 11:11 AM
Fwiw I prefer the ds18b20 (temperature only) and the bmw280 (i2c).
kaxori
kaxori 03/14/2025 11:11 AM
:👍🏻: Thank You, I will try to close the channels after use.
👍1
kaxori
kaxori 03/14/2025 11:42 AM
It works !
close: //driver.close: not implemented driver.channel-in_.close driver.channel-out_.close
has caused it:
- DHTXX-1: T:22.4 °C, H:28.1 %, Habs: 5.6 g/m^3 - DHTXX-2: T:23.3 °C, H:29.7 %, Habs: 6.2 g/m^3 - DHTXX-3: T:19.7 °C, H:92.1 %, Habs:15.6 g/m^3 - DHTXX-4: T:20.0 °C, H:74.2 %, Habs:12.8 g/m^3 - DHTXX-5: T:19.9 °C, H:99.9 %, Habs:17.2 g/m^3 - DHTXX-6: T:19.2 °C, H:67.6 %, Habs:11.1 g/m^3 - DHTXX-7: T:19.3 °C, H:65.4 %, Habs:10.8 g/m^3 - DHTXX-8: T:19.9 °C, H:58.0 %, Habs:10.0 g/m^3
🥳1
floitsch
floitsch 03/14/2025 12:14 PM
you are right: we forgot to implement close.
I will do that. Thanks.
floitsch
floitsch 03/14/2025 12:20 PM
v1.6.0 has been released.
if you update the dhtxx driver you should be able to just call driver.close.
kaxori
kaxori 03/14/2025 12:35 PM
:🌩️: faster than lightning strikes !
😁1
kaxori
kaxori 03/14/2025 05:49 PM
Contribute to kaxori/Multiple-DHTxx-sensor-example development by creating an account on GitHub.
12 messages in total