B4R Question WeMos D1 R2 & DHT22

atiaust

Active Member
Licensed 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
 

Erel

Administrator
Staff member
Licensed User
Try it with the attached library.

I've only changed the way the dht.h file is referenced.
 

Attachments

atiaust

Active Member
Licensed 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

atiaust

Active Member
Licensed 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

atiaust

Active Member
Licensed 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

ingo.tw

Member
Licensed 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
 

atiaust

Active Member
Licensed 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.
 

ingo.tw

Member
Licensed User
Hi atiaust
I use DHT11 can compiled with the WeMos board,but mqtt feedback Temp/Humidity is 0
 

atiaust

Active Member
Licensed 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.
 

ingo.tw

Member
Licensed 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

atiaust

Active Member
Licensed 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.
 

atiaust

Active Member
Licensed 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.
 
Top