Blynk.cloud:443 secure connection failed error 702

details :
• I am using a Esp32 devkit v1 over wifi using the blynk edgend for esp32 example from the blynk library
• Blynk server isnt connecting
• Blynk Library version 1.0.1

// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPL-lBE42El"
#define BLYNK_DEVICE_NAME "Quickstart Template"

#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_WROVER_BOARD
//#define USE_TTGO_T7

#include "BlynkEdgent.h"

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

  BlynkEdgent.begin();
}

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

SERIAL MONITOR:

   ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP32

[234] --------------------------
[234] Product:  Quickstart Template
[234] Firmware: 0.1.0 (build Jan 22 2022 20:00:53)
[244] Device:   ESP32 @ 240MHz
[244] MAC:      94:B9:7E:FB:56:2C
[245] Flash:    4096K
[255] ESP sdk:  v4.4-beta1-189-ga79dc75f0a
[255] Chip rev: 3
[256] Free mem: 261420
[256] --------------------------
[266] INIT => WAIT_CONFIG
[2877] AP SSID: Blynk Quickstart Template-B86C5
[2877] AP IP:   192.168.4.1
[2878] AP URL:  blynk.setup
[24418] WAIT_CONFIG => CONFIGURING
[27775] Sending board info...
[28026] Scanning networks...
[33148] Found networks: 4
[59615] Applying configuration...
[59616] WiFi SSID: Mr X Mob Pass: leg************
[59616] Blynk cloud: LGPRdF2hrrNs-AL4dXeRjT69Wpt7cGya @ blynk.cloud:443
[59630] CONFIGURING => SWITCH_TO_STA
[59634] Switching to STA...
[60794] SWITCH_TO_STA => CONNECTING_NET
[60794] Connecting to WiFi: Mr X Mob
[65441] Using Dynamic IP: 192.168.10.7
[65441] CONNECTING_NET => CONNECTING_CLOUD
[65451] Connecting to blynk.cloud:443
[66006] Secure connection failed
[70458] Connecting to blynk.cloud:443
[70921] Secure connection failed
[75461] Connecting to blynk.cloud:443
[75939] Secure connection failed
[80470] Connecting to blynk.cloud:443
[80956] Secure connection failed
[85476] Connecting to blynk.cloud:443
[85873] Secure connection failed
[90484] Connecting to blynk.cloud:443
[90889] Secure connection failed
[95450] Timeout
[95450] Last error code: 702
[95456] Configuration stored to flash
[95456] CONNECTING_CLOUD => ERROR
[105457] Restarting after error.
ets Jul 29 2019 12:21:46

Hey there,
Post your whole sketch please.

1 Like

I posted the code and serial monitor output, i didnt change any thing in the code just the example in the library

Are you connecting via a router?
Have you tried re-starting the router and any access points on your network?

You haven’t in-commented any board types, so the custom configuration in Settings.h is being used.
Do you have an LED and a switch connected to the pins that are defined in Settings.h ?

Pete.

Yes i am connecting via wifi router and have tired restart it too.
The board type is not specified in the example so i just left it as is, I’m using the ESP32 wroom module.

That’s an out-of-box code and should work. Can you try a different module if you have one? Or a non Blynk code?

The module works fine when i use this code here

/*************************************************************

  This is a simple demo of sending and receiving some data.
  Be sure to check out other examples!
 *************************************************************/

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID "TMPL-lBE42El"
#define BLYNK_DEVICE_NAME "Quickstart Template"
#define BLYNK_AUTH_TOKEN "iWWIQuPuytSSp1rXO7-8GhGeu_fNN277"

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


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

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Mr X Mob";
char pass[] = "legendaryeaglemaster";

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
  if (value == 1){
  Blynk.logEvent("button","Button is High");
}
}


// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

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);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

with this it connects to blynk.cloud:80

Can’t figure out what’s the issue with the edgent one.

[26] Connecting to Mr X Mob
[4641] Connected to WiFi
[4641] IP: 192.168.10.2
[4642] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP32

[4652] Connecting to blynk.cloud:80
[5385] Ready (ping: 307ms).

Why is your BLYNK_AUTH_TOKEN different?

The example says…

You didn’t answer my question about…

Pete.

Both are different device with the same template.

He’s using dynamic provisioning.

Pete.

yes LED is connected to GPIO 2 and the boot button is connected to GPIO 0 which is active low.

#if defined(USE_WROVER_BOARD)

  #define BOARD_BUTTON_PIN            15
  #define BOARD_BUTTON_ACTIVE_LOW     true

  #define BOARD_LED_PIN_R             0
  #define BOARD_LED_PIN_G             2
  #define BOARD_LED_PIN_B             4
  #define BOARD_LED_INVERSE           false
  #define BOARD_LED_BRIGHTNESS        128

#elif defined(USE_TTGO_T7)

  // This board does not have a built-in button
  // Connect a button to gpio0 <> GND
  #define BOARD_BUTTON_PIN            0
  #define BOARD_BUTTON_ACTIVE_LOW     true

  #define BOARD_LED_PIN               19
  #define BOARD_LED_INVERSE           false
  #define BOARD_LED_BRIGHTNESS        64

#else

  #warning "Custom board configuration is used"

  #define BOARD_BUTTON_PIN            0                     // Pin where user button is attached
  #define BOARD_BUTTON_ACTIVE_LOW     true                  // true if button is "active-low"

  #define BOARD_LED_PIN               2                     // Set LED pin - if you have a single-color LED attached
  //#define BOARD_LED_PIN_R           15                    // Set R,G,B pins - if your LED is PWM RGB
  //#define BOARD_LED_PIN_G           12
  //#define BOARD_LED_PIN_B           13
  //#define BOARD_LED_PIN_WS2812      4                     // Set if your LED is WS2812 RGB
  #define BOARD_LED_INVERSE           false                 // true if LED is common anode, false if common cathode
  #define BOARD_LED_BRIGHTNESS        128                    // 0..255 brightness control

#endif

/*
 * Advanced options
 */

#define BUTTON_HOLD_TIME_INDICATION   3000
#define BUTTON_HOLD_TIME_ACTION       10000

#define BOARD_PWM_MAX                 1023

#define BOARD_LEDC_CHANNEL_1     1
#define BOARD_LEDC_CHANNEL_2     2
#define BOARD_LEDC_CHANNEL_3     3
#define BOARD_LEDC_TIMER_BITS    10
#define BOARD_LEDC_BASE_FREQ     12000

#define CONFIG_AP_URL                 "blynk.setup"
#define CONFIG_DEFAULT_SERVER         "blynk.cloud"
#define CONFIG_DEFAULT_PORT           443

#define WIFI_NET_CONNECT_TIMEOUT      30000
#define WIFI_CLOUD_CONNECT_TIMEOUT    30000
#define WIFI_AP_IP                    IPAddress(192, 168, 4, 1)
#define WIFI_AP_Subnet                IPAddress(255, 255, 255, 0)
//#define WIFI_CAPTIVE_PORTAL_ENABLE

//#define USE_TICKER
//#define USE_TIMER_ONE
//#define USE_TIMER_THREE
//#define USE_TIMER_FIVE
#define USE_PTHREAD

#define BLYNK_NO_DEFAULT_BANNER

#if defined(APP_DEBUG)
  #define DEBUG_PRINT(...) BLYNK_LOG1(__VA_ARGS__)
#else
  #define DEBUG_PRINT(...)
#endif

Try pressing the button for 10 seconds to clear the settings and then re-provision the board.

Pete.

Still wont connect

[220062] Hold the button for 10 seconds to reset configuration...
[233825] WAIT_CONFIG => RESET_CONFIG
[233833] Resetting configuration!
[233833] Configuration stored to flash
[234143] nvs_flash_erase: Success
[234143] RESET_CONFIG => WAIT_CONFIG
[236744] AP SSID: Blynk Quickstart Template-B86C5
[236744] AP IP:   0.0.0.0
[236745] AP URL:  blynk.setup
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:12804
ho 0 tail 12 room 4
load:0x40080400,len:3032
entry 0x400805e4
[271] Using default config.

>[271] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP32

[282] --------------------------
[282] Product:  Quickstart Template
[282] Firmware: 0.1.0 (build Jan 22 2022 21:45:07)
[292] Device:   ESP32 @ 240MHz
[292] MAC:      94:B9:7E:FB:56:2C
[293] Flash:    4096K
[303] ESP sdk:  v4.4-beta1-189-ga79dc75f0a
[303] Chip rev: 3
[304] Free mem: 261492
[304] --------------------------
[314] INIT => WAIT_CONFIG
[2925] AP SSID: Blynk Quickstart Template-B86C5
[2925] AP IP:   192.168.4.1
[2926] AP URL:  blynk.setup
[8395] WAIT_CONFIG => CONFIGURING
[12982] Sending board info...
[22766] Scanning networks...
[28488] Found networks: 6
[35360] Applying configuration...
[35361] WiFi SSID: Mr X Mob Pass: legendaryeaglemaster
[35361] Blynk cloud: XQrQ9_b3tX8Ds-oSo1UmylPeNJUfrV3L @ blynk.cloud:443
[35375] CONFIGURING => SWITCH_TO_STA
[35379] Switching to STA...
[36539] SWITCH_TO_STA => CONNECTING_NET
[36539] Connecting to WiFi: Mr X Mob
[41184] Using Dynamic IP: 192.168.10.2
[41184] CONNECTING_NET => CONNECTING_CLOUD
[41194] Connecting to blynk.cloud:443
[41750] Secure connection failed
[46200] Connecting to blynk.cloud:443
[46665] Secure connection failed
[51205] Connecting to blynk.cloud:443
[51682] Secure connection failed
[56212] Connecting to blynk.cloud:443
[56701] Secure connection failed
[61221] Connecting to blynk.cloud:443
[61719] Secure connection failed
[66230] Connecting to blynk.cloud:443
[66735] Secure connection failed
[71185] Timeout
[71185] Last error code: 702
[71188] Configuration stored to flash
[71188] CONNECTING_CLOUD => ERROR
[81188] Restarting after error.
ets Jul 29 2019 12:21:46

Are you using a VPN?
If you ping blynk.cloud what IP address do you get?

Pete.

No, I am not using any VPN.
This is the ip i got.


Pinging blynk.cloud [128.199.144.129] with 32 bytes of data:
Reply from 128.199.144.129: bytes=32 time=233ms TTL=51
Reply from 128.199.144.129: bytes=32 time=251ms TTL=51
Reply from 128.199.144.129: bytes=32 time=236ms TTL=51
Reply from 128.199.144.129: bytes=32 time=236ms TTL=51

Ping statistics for 128.199.144.129:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 233ms, Maximum = 251ms, Average = 239ms

When you look at the bottom right hand corner of your Blynk web console, or the “About” section of the app, does it say “sgp1” ?

Pete.

yes, it says sgp1.blynk.cloud

Does your web console say the same thing (Region: spg1)?

Maybe your ISP is blocking traffic on port 443 to the Blynk server?

You could try changing this:

to port 80, as connections on that port seem to be working…

Pete.

yes, its the same.

Already changed that yet it still connects to 443.

#define CONFIG_AP_URL                 "blynk.setup"
#define CONFIG_DEFAULT_SERVER         "blynk.cloud"
#define CONFIG_DEFAULT_PORT           80
[56049] Connecting to WiFi: Mr X Mob
[60647] Using Dynamic IP: 192.168.10.2
[60647] CONNECTING_NET => CONNECTING_CLOUD
[60657] Connecting to blynk.cloud:443
[62132] Secure connection failed
[65663] Connecting to blynk.cloud:443
[66125] Secure connection failed
[70666] Connecting to blynk.cloud:443
[71144] Secure connection failed
[75675] Connecting to blynk.cloud:443
[76160] Secure connection failed
[80681] Connecting to blynk.cloud:443
[81182] Secure connection failed
[85682] Connecting to blynk.cloud:443
[86196] Secure connection failed
[90656] Timeout
[90656] Last error code: 702
[90657] Configuration stored to flash
[90657] CONNECTING_CLOUD => ERROR
[100659] Restarting after error.
ets Jul 29 2019 12:21:46