Blynk.cloud:443 secure connection failed error 702

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

Did you press the button to clear the stored config afterwards, then re-provision?

Pete.

yes

Maybe you should use esptool to erase your ESP32 then.

Pete.

After Some reading and understanding the headers. The library in the arduino library manager was not the latest version of the library the SSL header was missing the sethandshaketimeout, now it works perfectly. Thank you for helping me.

1 Like

Got exactly same error. I tried with port 80 or 8080 but it does not work (keep connecting to port 443 even I changed it to port 8080 or 80 AND changed to #include <BlynkSimpleEsp32.h>), but my ESP8266 board is still working fine.

I tried to removed blynk library and installed a newest blynk lib. (ver. 1.0.1), but same error happened as yours:

Blynk timer triggered…
[149187] Connecting to blynk.cloud:443
[149429] Secure connection failed
Blynk timer triggered…
Blynk timer triggered…
[154189] Connecting to blynk.cloud:443
[154422] Secure connection failed

Could you explain details about how you fixed it? How did you fix the header, what is missing sethandshaketimeout?

Thanks

Thuy

@nhuythuy I’d suggest that you start a new topic and provide all of the requested information, including your code (correctly formatted of course).

Pete.

Did you installed the library from Arduino library manager?

Yes, I install from arduino lib manager for official release

I was thinking abt starting new topic but wondering how to get help from Mob since he would not following new topic

I am using just code like esp32 example. Will provide code, anyway :slight_smile:

Okay, but please do that in a new “Need help with my project” topic, and provide ALL of the information that is requested when you do that, and any other information that may be of help in diagnosing the issue.

Pete.