Hi all,
I am brand spanking new to all this, and it is entirely possible this has been answered in a place i have been unable to locate, if that is so, my apologies.
My issue, as it stands, is that i cannot seem to get my ESP32 to connect to my network.
I have spent the better part of 2 days now searching through every article i can find, and it appears i am doing things correctly, but all i ever get is the statement âwifi:set status to INITâ and it doesnât appear to connect.
What makes this more frustrating, is that in the early hours i was messing around with it and actually had it connected and showing up on my blynk dashboard. but now i cant replicate that feat.
What i am hoping for is any advice on where my code has gone wrong, or what other issues may lead to this problem that arenât code related.
Again my apologies if this has been covered, point me in the right direction and ill delete the thread.
details below;
⢠Hardware model + communication type. ESP32-WROOM-32
⢠iPhone XR
⢠Blynk server
Code below is basically straight from the sample codes. all private info has been replaced with **
#define BLYNK_TEMPLATE_ID "*******"
#define BLYNK_DEVICE_NAME "*******"
#define BLYNK_AUTH_TOKEN "*******"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "*******";
char pass[] = "*******";
#define DHTPIN 21
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
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, h);
Blynk.virtualWrite(V6, t);
}
void setup()
{
// Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
dht.begin();
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}
void loop()
{
Blynk.run();
timer.run();
}