Blynk + dht11 an interesting problem!

void loop()
{
  
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
  if(Blynk.connected())
  {
    
    Serial.println(t); // no problem blynk server success connect
    delay(1000);
    //sendSMS(); // blynk server no connect.
  }
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
}
sendSMS(); Serial monitor print
[0] Blynk v0.3.6 on Arduino Uno
[0] Getting IP
[5302] IP:192.168.50.43

Serial.println(t); Serial monitor print
[0] Blynk v0.3.6 on Arduino Uno
[0] Getting IP
[5302] IP:192.168.50.43
[5001] Connecting to blynk-cloud.com:8442
Ready Ping: (185ms.)
23.00
23.00
23.00

what is the problem ?

Hello. Please attach full sketch.

you have to get out of void loop
use Blynk timers

timer.setInterval(200000L, TempUpdate); // Update temp reading 

void TempUpdate() {

  int Temp = dht.readTemperature(); //Get a new reading from the temp sensor
  int Hum = dht.readHumidity();
}

Aside from you not reading the instructions about formatting the code you post here (I fixed that for you) and not reading the recommended help documentation before asking questions :stuck_out_tongue_winking_eye: Well… as stated, your void loop() is a big problem.

See Avoiding the Void in this document… along with all the rest :wink:

http://help.blynk.cc/getting-started-library-auth-token-code-examples/blynk-basics/how-to-display-any-sensor-data-in-blynk-app

Don’t you feel the need to update “things” from time to time? :wink:

1 Like

The things that become noticeable with properly formatted code :smiley: