B4R Question WeMos D1 R2 & DHT22

atiaust

Active Member
Licensed User
Longtime User
Hi All,

Has anyone tried the DHT22 Temp/Humidity sensor with the WeMos D1 R2 board.

I can get the app to compile using the DHT11 libraries but not the DHT22 versions.

Not sure if you can use the DHT22 sensor with the DHT11 library?

I have tried the libraries from https://b4x.com/android/forum/threads/dht11-dht22-temperature-and-humidity-sensors.66113/ but I can't get rid of an error "missing dht.h". Doesn't matter where the dht.h file is located.

Any help appreciated
 

atiaust

Active Member
Licensed User
Longtime User
Hi Erel,

Tried the library with a DHT22 connected to an Arduino Nano board with the sensor connected to pin 3 and the data returned is good both Temp & Humidity as expected.

I connected the same DHT22 to a WeMoS on pin D3 (GPIO0) also tried D1, D2, D6 with no luck. The App now compiles without error OK.
The WeMos appears to be receiving a data stream from the DHT22 (see attached screen capture from oscilloscope monitoring pin D3) but not logging any data. The log just shows 0.0 for temp & humidity.

Any ideas?
Thanks
 

Attachments

  • IMG_000.jpg
    IMG_000.jpg
    36.9 KB · Views: 1,027
Upvote 0

atiaust

Active Member
Licensed User
Longtime User
Hi Erel,

I found a couple of articles relating to WeMos and DHT22 library issues on WeMos.cc which discusses problems with processor clock speeds and different DHT libraries.

I have tested the attached library with an Arduino Nano board and DHT22 and it works.
Will these library files work with your rDHT libraries.

Thanks
 

Attachments

  • DHT-sensor-library-master.zip
    9.4 KB · Views: 632
Upvote 0

atiaust

Active Member
Licensed User
Longtime User
Thanks Erel,

The attached library files work with the WeMos D1 R2 board compiled through the Arduino IDE.

I have tried unsuccessfully to write the wrappers for B4R. Can you assist please.

Thanks in advance.
 

Attachments

  • DHT.zip
    4 KB · Views: 604
Upvote 0

ingo.tw

Member
Licensed User
Longtime User
Hi All,
Has anyone tried the DHT11 Temp/Humidity sensor using new DHT11/ DHT22 libraries with the WeMos D1 R2 board.
I can get the app to compile but Value is 0.
upload_2016-7-15_10-12-11.png
 
Upvote 0

atiaust

Active Member
Licensed User
Longtime User
Hi ingo.tw

The DHT11 works with the B4R library but not the DHT22.

The library attached to my previous post works with the WeMos board compiled thru the Arduino IDE but not B4R.

I have tried unsuccessfully to write the B4R wrapper for it and gave up.

Would be interested if you can get it work.

Thanks.
 
Upvote 0

atiaust

Active Member
Licensed User
Longtime User
Hi ingo.tw

I don't have a DHT11.

The DHT22 that I have works great with WeMos/Arduino but the same as you I only get 0 deg temp & o % humidity with WeMos/B4R combination.

I also can compile but it doesn't work. I think it needs different library.
 
Upvote 0

ingo.tw

Member
Licensed User
Longtime User
rDHT11 library installation:
Create folder B4R additional libraries folder\rDHT
Copy rDHT11.xml to the B4R additional libraries folder.
Copy rDHT.h + cpp and dht.h + cpp to the B4R additional libraries folder\rDHT

I can run with the library
upload_2016-7-15_11-22-54.png
 

Attachments

  • rDHT.ZIP
    3.8 KB · Views: 607
Upvote 0

atiaust

Active Member
Licensed User
Longtime User
Hi Ingo.tw

I just recieved a DHT11 module and tried to open the library you posted in your previous post.
Unfortunately the rDHT.zip file is corrupt and won't open. Can you repost it please.

Also what pin number are you using on the WeMos?

Thanks.
 
Upvote 0

atiaust

Active Member
Licensed User
Longtime User
Thanks for your answer but I wish to know which library you are using to get the DHT11 working with the WeMos.
The library you posted earlier, the zip file is corrupt and will not open.
 
Upvote 0
Top