Issue with getting data from temp sensor

hey there.
i got some issues with code… everything working, except i dont getting any data from dht sensor (temperature and humidity). so thats relay working on ESP12f and for getting data from dht sensor. relays working fine and DHT seems working, at least led light and it getting warm (means working).
I working both with web and android version - its just showing some same numbers for temp and humidity all time. here what i got set in blynk.console and code, thank you:
also, maybe you could tell me, how i can get text from serial as separate datastream?


image

#define BLYNK_TEMPLATE_ID "TM********p"
#define BLYNK_DEVICE_NAME "ESP12f 3DP"
#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
//#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
//#define USE_WEMOS_D1_MINI

#include "BlynkEdgent.h"
#include <DHT.h>
#include <SPI.h>

#define DHTPIN 1
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;

BLYNK_CONNECTED() {
   Blynk.syncAll(); 
   
   }

void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V1, h);  //V1 is for Humidity
  Blynk.virtualWrite(V2, t);  //V2 is for Temperature
}

void setup()
{
  Serial.begin(115200);
  delay(100);

  BlynkEdgent.begin();
   dht.begin();
   timer.setInterval(10000L, sendSensor);
   
   digitalWrite(12, LOW); //default state is off
   digitalWrite(5, LOW);
   digitalWrite(3, LOW);
   digitalWrite(13, LOW);
   
   pinMode(3, OUTPUT); //laser
   pinMode(5, OUTPUT); //power
   pinMode(12, OUTPUT); //filter
   pinMode(13, OUTPUT); //LEDs
}
   BLYNK_WRITE(V3) // Executes when the value of virtual pin 1 changes
{
  if(param.asInt() == 1)
  {    // execute this code if the switch widget is now ON
    digitalWrite(12,HIGH);  // Set digital pin 2 HIGH
  }   else  {
    // execute this code if the switch widget is now OFF
    digitalWrite(12,LOW);  // Set digital pin 2 LOW    
  } }
  BLYNK_WRITE(V4) // Executes when the value of virtual pin 1 changes
{
  if(param.asInt() == 1)
  {    // execute this code if the switch widget is now ON
    digitalWrite(5,HIGH);  // Set digital pin 2 HIGH
  }   else  {
    // execute this code if the switch widget is now OFF
    digitalWrite(5,LOW);  // Set digital pin 2 LOW    
  } }
BLYNK_WRITE(V5) // Executes when the value of virtual pin 1 changes
{
  if(param.asInt() == 1)
  {    // execute this code if the switch widget is now ON
    digitalWrite(3,HIGH);  // Set digital pin 2 HIGH
  }   else  {
    // execute this code if the switch widget is now OFF
    digitalWrite(3,LOW);  // Set digital pin 2 LOW    
  } }
BLYNK_WRITE(V6) // Executes when the value of virtual pin 1 changes
 {
  if(param.asInt() == 1)
  {    // execute this code if the switch widget is now ON
    digitalWrite(13,HIGH);  // Set digital pin 2 HIGH
  }   else  {
    // execute this code if the switch widget is now OFF
    digitalWrite(13,LOW);  // Set digital pin 2 LOW    
  } 
}
void loop() 
{
  BlynkEdgent.run();
   timer.run();
}

That’s a big assumption to make.

Is your device showing as Online?

What does your serial monitor show?
I’d suggest adding some serial print statements to your sendSensor function to see the readings produced by your sensor.

What are the Max values that you’ve defined for your datastreams?

You haven’t un-comment a board type, so the custom board configuration in Settings.h is being used. Have you changed these configuration settings? What is the LED attached to your BOARD_LED_PIN doing?

Pete.

as i said, everything working. except no data from DHT sensor. i will now try to check what sensor reading on serial monitor… just need to “flash by air”, cuz board kinda in box, hidden deep, deep… too deep. :smiley:
max values is 100 Celcius, if that what you asking

well… im tried to do firmware by air… but seems i forgot to add auth code… now device all time offline… now i need to get this box out. thats terrible. i made binary files with new arduino ide - its interface a bit different as i recall… im usually using VSC, except this time. so it made me 3 files - image
*.bin what i need, but what is two others?

No, you shouldn’t be specifying the auth code with Edgent, it’s allocated dynamically when you provision the device.

No idea, maybe the Arduino IDE forums will help answer that?

Pete.

than something gone wrong… :sob: