Sample code for DHT11 senor without using library function

Dear all,

I am using NodeMCU unit. Is there any sample code avilable to read DHT Sesor value without using library function. I have tested DHT11 with Arduino uno & its working fine. But it wont wont work with Simple DHT11 library.

Is There any sample code avilable for test it out.

But it wont wont work with Simple DHT11 library.

What is "it" that won't work?

I am testing below code with sesnor connected to pin 2

#include <SimpleDHT.h>

// for DHT11, 
//      VCC: 5V or 3V
//      GND: GND
//      DATA: 2
int pinDHT11 = 2;
SimpleDHT11 dht11;

void setup() {
  Serial.begin(115200);
}

void loop() {
  // start working...
  Serial.println("=================================");
  Serial.println("Sample DHT11...");
  
  // read without samples.
  byte temperature = 0;
  byte humidity = 0;
  int err = SimpleDHTErrSuccess;
  if ((err = dht11.read(pinDHT11, &temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
    Serial.print("Read DHT11 failed, err="); Serial.println(err);delay(1000);
    return;
  }
  
  Serial.print("Sample OK: ");
  Serial.print((int)temperature); Serial.print(" *C, "); 
  Serial.print((int)humidity); Serial.println(" H");
  
  // DHT11 sampling rate is 1HZ.
  delay(1500);
}

I get an error saying.

Sample DHT11…
Read DHT11 failed, err=101

Sample DHT11…
Read DHT11 failed, err=101

Sample DHT11…
Read DHT11 failed, err=101

Sample DHT11…
Read DHT11 failed, err=101

Sample DHT11…
Read DHT11 failed, err=101

Sample DHT11…
Read DHT11 failed, err=101

I have tested code using arduino Uno board and Its working fine . I have also tested giving separate 3.3v power and Gnd the result same. I have tested without library function it gives timeout error

You could try Adafruit's DHT Library.
If that doesn't "work" either, then just open up the library source code, figure out what it does, and then write your own code.