Where do you call that void ?
Maybe you should start from the beginning.
Post your proper code, details of your board, which pins youâre using to connect your sensor, details of what youâve set-up in your app project, copy and paste your serial output and explain in words what problems youâre experiencing, what things youâve tried, and what results youâve observed.
Pete.
1 Like
#define BLYNK_PRINT Serial
#include <BlynkSimpleEsp32.h>
#include <DHT.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "8ydYe91_SqXfyPmWjiGALbQTCIXT1CKy";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "eduroam-2G";
char pass[] = "*******";
#define DHTPIN 13 // Connect DHT sensor to GPIO 13
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21 // DHT 21, AM2301
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
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(V5, t);
Blynk.virtualWrite(V6, h);
}
void setup()
{
// Debug console
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
int wifi_ctr = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected");
Serial.println("Setup done");
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(172,18,91,37), 8080);
dht.begin();
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}
void loop()
{
Blynk.run();
timer.run();
}
This is my latest code and the error is such as belowâŚ
Are you sure that your ESP32 is ok ?
Guru Meditation Error: Core 0 panicâed, not Blynk related .
Try to disconnect all pin of DHT11 (VCC included ) and see what happens.
I donât think youâve understood what Iâve asked.
Iâm taking a step back from this thread.
Best of luck with resolving your issue.
Pete.
2 Likes