Connection issues with ESP32

Please i am having issues with my blank app , i uploaded a blynk sketch and av done the required editing as regards wifi name and password, also authentication token

After uploading the code , my blynk app connects and disconnect almost immediately and am not even to know what exactly is going on , kindly help out , am using an esp32 board to controll just 16 relays , opening serial monitor i see the eap32 connected with blynk server but on my blynk app , it just connect and disconnect within 1 second

@Igbasan_Taye ive moved your post to a new topic, as it is not relevant to the topic that you originally posted in.

Please provide the following information…

Before creating the topic

• Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
• Smartphone OS (iOS or Android) + Blynk app version
• Blynk server or local server
• Blynk Library version
• Add your sketch code. :point_up:Code should be formatted as example below.

Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.

```

Your sketch in here……

```

Hello , please help me out with my Blynk app , it disconnect within 1 second after connecting with my esp32 , i know the code was successfully uploaded and that the wifi , pass and authentication token was rightly placed and i only picked the blynk sketch so i didn’t mess with anything , on the blynk app also i selected the wedge gave the right value and pin number . but it connect and disconnect almost immediately , what am i doing wrong please ?

Esp32_wifi
Android + blynk version 2.27.32
Blynk server
Blynk library version 1.0.1

  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example runs directly on ESP32 chip.

  Note: This requires ESP32 support package:
    https://github.com/espressif/arduino-esp32

  Please be sure to select the right ESP32 module
  in the Tools -> Board menu!

  Change WiFi ssid, pass, and Blynk auth token to run :)
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID   "YourTemplateID"


#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "t0o66sa5Y-r8xIexNICpbBTZ4bWyPNHD";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Longman's Note 8";
char pass[] = "Longman1";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
}

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

You are using Blynk Legacy, so this should be library version 0.6.1
What does your serial monitor show?

Pete.

It shows that the wifi is connected and blink server is connected also , but after that , nothing more

Copy and paste the serial output, and use triple backticks the way you did with your sketch.

Pete.

I used my laptop to upload the codes and it still does the same thing , it connects with the blink server but on my phone , inside the blink app , it shows connected and disconnected almost instantly

Pete.

Here is what the serial monitor is displaying

0dA⸮!⸮⸮
\B⸮⸮⸮⸮@[26] Connecting to Longman's Note 8
[2634] Connected to WiFi
[2634] IP: 192.168.43.172
[2634] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on ESP32

[2709] Connecting to blynk-cloud.com:80
[3598] Ready (ping: 408ms).

And here is my code

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example runs directly on ESP32 chip.

  Note: This requires ESP32 support package:
    https://github.com/espressif/arduino-esp32

  Please be sure to select the right ESP32 module
  in the Tools -> Board menu!

  Change WiFi ssid, pass, and Blynk auth token to run :)
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "t0o66sa5Y-r8xIexNICpbBTZ4bWyPNHD";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Longman's Note 8";
char pass[] = "Longman1";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
}

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

At the back of my esp32 board , i can see Esp32_DEVK1tc_v4 but on the board selection menu , i only have esp32 dev module ,

Will this in any way affect the result of the upload ?

You have a ping at 408 ms, that is abnormal.,
You should have less than 100 ms
Check the ping with your computer and show us the results and tell us the country where you live.
About esp32 choice it doesn’t matter.

@Igbasan_Taye please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Please do the same for your serial monitor output.

Pete.

1 Like

How do i reduce the ping to 100, please help with the steps

Done sir

You never do what we told you.

How do i do check the ping ?
My country is Nigeria , why is that relevant to the code ?

Are you using your phone as a WiFi hotspot?

Pete.

Yes i am using my phone as hotspot for the setup