help with esp connection to blynk io

hello i am a student doing an iot project for the first time (ive done a few arduino projects). i want to make an environmental monitoring system with dht11 and soil moisture sensors. ive been watching online tutorials and im using a source code from a youtube video, however, ive run into the problem where the code can be uploaded, but my blynk io interface is still offline. im using my iphone hotspot for the wifi ssid, (ive turned on maximise compatibility) and i think that could be the main problem, since its like kinda stuck after writing trying to connect to my hotspot in the serial monitor. any help would be greatly appreciated!

this is the source code:

//Tech Trends Shameer

#define BLYNK_TEMPLATE_ID "TMPLIAjddf20T5"
#define BLYNK_DEVICE_NAME "Temperature and Humidity Monitor"
#define BLYNK_AUTH_TOKEN "122RywymdfdddgGfMd1jkZ0STNhRQecR12ayq"

#define BLYNK_PRINT Serial
#include <WiFi.h>
//#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp32.h>

#include <DHT.h>

char auth[] = BLYNK_AUTH_TOKEN;

char ssid[] = "";  // type your wifi name
char pass[] = "";  // type your wifi password

BlynkTimer timer;

#define DHTPIN 27 //Connect Out pin to D2 in NODE MCU
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

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(V0, t);
Blynk.virtualWrite(V1, h);
Serial.print("Temperature : ");
Serial.print(t);
Serial.print("    Humidity : ");
Serial.println(h);
}
void setup()
{

Serial.begin(115200);

Blynk.begin(auth, ssid, pass);
dht.begin();
timer.setInterval(100L, sendSensor);

}

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

Have you redacted this info, or simply not populated it in your sketch?

There is really no point in hiding the SSID and password you’re using, as it’s of no use to anyone that isn’t within a few feet of your phone.
However, publishing your Blynk Auth token gives anyone in the world access to your Blynk project.
To avoid confusion, it’s a good idea to replace sensitive information with the word “REDACTED”.

You appear to be using an ESP32. Is that correct? (You are prompted to share this info when you create your topic).

What does your serial monitor show? (Use Tripp,e backticks when posting serial monitor output, and this time place them on a separate line rather than inline with your first and last lines of code).

Pete.

hi pete. sorry, i didnt include the hotspot ssid and password on purpose. the hotspot ssid is: Aisyah’s iPhone and password: 123456. i am using an esp32 node mcu.

there was one instance my serial monitor showed this: (mistakenly, this was at 9600 baud, so i changed it afterwards)

ets: Jul 29 2019 12:21:46

rst : [10] Connecting to Aisyah's iPhoets: Jul 29 2019 12:21:46

after i changed the baud to 115200, it only showed


rst:

but now, when i upload the code, the serial monitor shows nothing. i definitely think its because it cannot connect to my mobile hotspot, but what do you think and how could i fix iti? many thanks.

Your serial monitor should be showing data as your device boots and tries to connect to your hotspot and Blynk.
You need to change baud rates in your serial monitor until you can see these messages, then change your serial.begin statement to match this baud rate.
If you see no messages at all then remove all connections from your ESP32 (except for the USB cable) then try again.

Pete.