ARDUINO MEGA + WIFI board arduino is no sending data from sensor

Hello i have issue

I recently had to buy new arduino board of this type my last board worked fine i would say perfectly.

But this one i have only issues

I want to send data from DHT22 to server on blynk but i dont get any data and in serial monitor i dont get any msg about status of sensor

#define BLYNK_TEMPLATE_ID "*****"
  #define BLYNK_DEVICE_NAME "*****"
  #define BLYNK_AUTH_TOKEN "*******"
  #define BLYNK_PRINT Serial
  #define EspSerial Serial
  #define ESP8266_BAUD 115200
  #define DHTPIN 4         
  #define DHTTYPE DHT22   
  
  #include <ESP8266_Lib.h>
  #include <BlynkSimpleShieldEsp8266.h>
  #include <DHT.h>



  char auth[] = BLYNK_AUTH_TOKEN;
  char ssid[] = "*****";
  char pass[] = "*****";

  BlynkTimer timer;

    
  ESP8266 wifi(&EspSerial);

  
  DHT dht(DHTPIN, DHTTYPE);

  
  void sendSensor()
  {
    float h = dht.readHumidity();
    float t = dht.readTemperature(); 

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  
  }
    Serial.print(F("Humidity: "));
    Serial.print(h);
    Serial.print(F("%  Temperature: "));
    Serial.print(t);
    Serial.println(F("°C "));
    
    
    Blynk.virtualWrite(V1, h);
    Blynk.virtualWrite(V0, t);


  }
  
  void setup()
  {
    
    Serial.begin(115200);
    EspSerial.begin(ESP8266_BAUD);
    delay(10);
    Blynk.begin(auth, wifi, ssid, pass, "blynk.cloud", 80);
    dht.begin();
   
  }

  void loop()
  {  
    Blynk.run();
    timer.run();
    
  }

[521] Connecting to WifiA_hore
AT
ATE0
AT+GMR
[3580] AT version:1.1.0.0(May 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb)
Ai-Thinker Technology Co. Ltd.
Jun 13 2016 11:29:20
OK
AT+CIPMUX=1
AT+CWMODE?
AT+CWJAP="WifiA_hore","zajac205"
AT+CIFSR
[10653] +CIFSR:STAIP,"192.168.1.119"
+CIFSR:STAMAC,"a4:e5:7c:1e:4e:ee"
[10654] Connected to WiFi
AT+CIPCLOSE=1
AT+CIPCLOSE=1
AT+CIPSTART=1,"TCP","blynk.cloud",80
AT+CIPCLOSE=1
AT+CIPSTART=1,"TCP","blynk.cloud",80
AT+CIPSEND=1,37

you didn't initialize the timer in setup()

Thank you
I completly forgot about that command

You saved my nerves.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.