kelnos / dht-embedded-rs

Rust embedded-hal driver for DHT11 and DHT22 temperature/humidity sensors
Apache License 2.0
12 stars 7 forks source link

Device not found using ESP32 + Wokwi #4

Closed knightpp closed 12 months ago

knightpp commented 1 year ago

Hi. I use Wokwi emulator, you can try the test project here https://wokwi.com/projects/368352408492370945.

I adapted your example from README.md to ESP32 hal, but the log says Error: DHT device not found. Do you know what I am doing wrong?

koenw commented 1 year ago

I can confirm this issue also exists using hardware.

knightpp commented 12 months ago

I've not tried but the possible solution is https://github.com/michaelbeaumont/dht-sensor/issues/23#issuecomment-1784107501

kelnos commented 12 months ago

Ah interesting. I'd always used open drain but hadn't known it was required.

I tried modifying the Wokwi project, but cloning some fork of this repo failed. Tried to use the main version, but that didn't work for other reasons, and I don't really have the time to learn how Wokwi works right now. @knightpp, can you get your project working again and give it a try?

navaati commented 12 months ago

Hi !

Ah, funny how things happen, just at this instant I found that solution as well on my side (on actual hardware). So, I confirm it works with input_output_od. Too bad the types in embedded_hal don’t prevent that…

kelnos commented 12 months ago

Ok, it took some doing, but I managed to get it working on Wokwi, using the latest versions of things as well as using the open-drain pin. Temp and humidity print out as 0 tho, I assume that's just what the simulator does... I hope.

SergioGasquez commented 10 months ago

For reference, here is a working Wokwi project with DHT22: https://wokwi.com/projects/384087992261474305