Problems provisioning board when using Edgent

Hello guys and girls:-)
First, sorry for my english im not nativ english speaker:-)

I have trouble with new Blynk IOT, my ESP8266 work like charm but ESP32-DevKitC V4 making trouble.
So, lets explain what going on. Im create new template, then copy ID and Name to sketch, uploaded to board and problem started. After connecting to wifi network created by board i want to connect to 192.168.4.1 but on page it shows “not found:/”, then i try connect over app and in log :

19:22:23.753 → [79315] Connecting to WiFi: dd-wrt
19:22:27.691 → [83240] Using Dynamic IP: 10.201.20.166
19:22:27.691 → [83240] CONNECTING_NET => CONNECTING_CLOUD
19:22:27.958 → 2buttonleft: 0
19:22:27.958 → 2Status L: 4
19:22:27.958 → 4buttonright: 0
19:22:27.958 → LampOFF
19:22:27.958 → [83521] Connecting to blynk.cloud:443
19:22:28.161 → [83737] Secure connection failed
19:22:32.986 → [88528] Connecting to blynk.cloud:443
19:22:33.187 → [88732] Secure connection failed
19:22:37.978 → [93533] Connecting to blynk.cloud:443
19:22:38.186 → [93738] Secure connection failed
19:22:42.979 → [98540] Connecting to blynk.cloud:443
19:22:43.179 → [98747] Secure connection failed
19:22:47.991 → [103547] Connecting to blynk.cloud:443
19:22:48.175 → [103749] Secure connection failed
19:22:53.015 → [108549] Connecting to blynk.cloud:443
19:22:53.213 → [108759] Secure connection failed
19:22:57.959 → [113519] Timeout
19:22:57.959 → [113519] Last error code: 702
19:22:57.959 → [113522] Configuration stored to flash
19:22:57.959 → [113522] CONNECTING_CLOUD => ERROR

button for reset settings work ok so i hope that board pins are ok:
19:13:09.549 → [46414] Hold the button for 10 seconds to reset configuration…

This board dont have user LED only one, it should be for power indication.So im using custom settings for board.
I try same steps on ESP8266 node MCU and all was ok, on 192.168.4.1 page i chose network, pass, Token and board conect to cloud without any isssues, but ESP32-DevKitC V4 with same steps dont work, any ideas whoat can be wrong.Same scenario hapend when i open new empty sketch EDGENT_ESP32 and change only ID and Name and token or without token .
.
Anyway im using latest arduino IDE 1.8.19,ESP board 2.0.2 chosed in IDE like Node32s (usualy I use this selection and its work ok), blynk lib 1.0.1.

If you have any question ask, I will be happy for any response and any help.
Manny thanks

@Milan_Kanalik I’ve moved your post to its own topic, as it seems totally unrelated to the topic that you posted in.

When using Edgent, you are meant to provision the board with WiFi credentials via the app, not via the captive portal at 192.168.4.1

Clearly, you aren’t using the standard Edgent template, as you have some stuff happening here…

which could well be interfering with the provisioning process.

You havent posted your modifications to the Edgent example sketch, or to the custom board section of Settings.h
You really need an LED connected to your board (with a suitable current limiting resistor) to use the Edgent provisioning process correctly.

Please post the .ino code from your sketch, plus the code from your Settings.h tab

Whenyoiu post code to the forum, it must have triple backtichs on a seperate line before and after the sketch.
Triple backticks look like this:
```

Please copy and paste these if you are in any doubt about which keyboard characters to use to create the triple backticks.
Incorrectly formatted code will be deleted.

You should also use triple backticks when posting serial monitor output.

You may find this tutorial useful…

Pete.

Hi Pete,
yes that sketch was from my project but same think happend with empty sketch look here, this is from new empty one and i use app:

20:34:57.978 -> >[222] 
20:34:57.978 ->     ___  __          __
20:34:57.978 ->    / _ )/ /_ _____  / /__
20:34:57.978 ->   / _  / / // / _ \/  '_/
20:34:57.978 ->  /____/_/\_, /_//_/_/\_\
20:34:57.978 ->         /___/ v1.0.1 on ESP32
20:34:57.978 -> 
20:34:57.978 -> [232] --------------------------
20:34:57.978 -> [233] Product:  GarazIOT
20:34:57.978 -> [233] Firmware: 0.1.0 (build Apr 26 2022 20:34:22)
20:34:57.978 -> [243] Device:   ESP32 @ 240MHz
20:34:58.018 -> [243] MAC:      F0:08:D1:D8:05:68
20:34:58.018 -> [244] Flash:    4096K
20:34:58.018 -> [244] ESP sdk:  v4.4-beta1-189-ga79dc75f0a
20:34:58.018 -> [254] Chip rev: 1
20:34:58.018 -> [255] Free mem: 261388
20:34:58.018 -> [255] --------------------------
20:34:58.018 -> [255] INIT => WAIT_CONFIG
20:35:00.609 -> [2865] AP SSID: Blynk GarazIOT-6C068
20:35:00.609 -> [2865] AP IP:   192.168.4.1
20:35:00.609 -> [2866] AP URL:  blynk.setup
20:35:08.851 -> [11118] WAIT_CONFIG => CONFIGURING
20:35:43.383 -> [45618] Sending board info...
20:35:46.617 -> [48859] Scanning networks...
20:35:51.548 -> [53781] Found networks: 6
20:35:52.706 -> [54946] Scanning networks...
20:35:57.631 -> [59867] Found networks: 6
20:36:08.712 -> [70961] Applying configuration...
20:36:08.712 -> [70961] WiFi SSID: zahrada Pass: **"I deleted password from here"**
20:36:08.712 -> [70961] Blynk cloud: Spm8PnKsr_soFfIEdMvWNT7SCwg_gQ9I @ blynk.cloud:443
20:36:08.748 -> [70976] CONFIGURING => SWITCH_TO_STA
20:36:08.748 -> [70978] Switching to STA...
20:36:09.914 -> [72168] SWITCH_TO_STA => CONNECTING_NET
20:36:09.914 -> [72168] Connecting to WiFi: zahrada
20:36:13.352 -> [75596] Using Dynamic IP: 10.201.20.166
20:36:13.352 -> [75596] CONNECTING_NET => CONNECTING_CLOUD
20:36:13.352 -> [75606] Connecting to blynk.cloud:443
20:36:14.176 -> [76428] Secure connection failed
20:36:18.349 -> [80608] Connecting to blynk.cloud:443
20:36:18.556 -> [80818] Secure connection failed
20:36:23.367 -> [85618] Connecting to blynk.cloud:443
20:36:23.580 -> [85833] Secure connection failed
20:36:28.388 -> [90624] Connecting to blynk.cloud:443
20:36:28.573 -> [90832] Secure connection failed
20:36:33.371 -> [95633] Connecting to blynk.cloud:443
20:36:33.576 -> [95835] Secure connection failed
20:36:38.378 -> [100637] Connecting to blynk.cloud:443
20:36:38.592 -> [100842] Secure connection failed
20:36:43.376 -> [105602] Timeout
20:36:43.376 -> [105602] Last error code: 702
20:36:43.376 -> [105608] Configuration stored to flash
20:36:43.376 -> [105608] CONNECTING_CLOUD => ERROR
20:36:53.383 -> [115609] Restarting after error.
20:36:53.418 -> ets Jun  8 2016 00:22:57

Here its sketch, im not uncomment any boards, if I understand correctly in this case custom settings should be used automaticaly:

// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPLHlpi9yHn"
#define BLYNK_DEVICE_NAME "GarazIOT"

#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();
}

I do not any changes in Settings.h tab, this is my settings:

  #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               4                     // 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        64                    // 0..255 brightness control

If there is not custom LED on board can I use any free digital output pin and connect there some LED with resistor and then set this pin to Settings.h tab? It looks that bard pin its ok because when I push it for 10 second it reset saved settings, so this one should be ok.
Thanks

Is this a domestic network, or a corporate/educational establishment?

It looks like the secure protocol is being blocked by the firewall.

Pete.

Its home network, ok, im going to switch of firewall in my router and will see what happend. But im not shoore if that help, because ESP8266 work on same port 443 without problems, but im going to try it.
Will inform you.

After switching off firewall without change:

21:43:11.500 -> [39959] WiFi SSID: dd-wrt Pass: Kikusiatko88
21:43:11.500 -> [39959] Blynk cloud: Spm8PnKsr_soFfIEdMvWNT7SCwg_gQ9I @ blynk.cloud:443
21:43:11.500 -> [39973] CONFIGURING => SWITCH_TO_STA
21:43:11.500 -> [39976] Switching to STA...
21:43:12.597 -> [41085] SWITCH_TO_STA => CONNECTING_NET
21:43:12.597 -> [41085] Connecting to WiFi: dd-wrt
21:43:16.290 -> [44760] Using Dynamic IP: 10.201.20.166
21:43:16.290 -> [44760] CONNECTING_NET => CONNECTING_CLOUD
21:43:16.290 -> [44770] Connecting to blynk.cloud:443
21:43:16.489 -> [44984] Secure connection failed
21:43:21.295 -> [49775] Connecting to blynk.cloud:443
21:43:21.500 -> [49980] Secure connection failed
21:43:26.289 -> [54780] Connecting to blynk.cloud:443
21:43:26.490 -> [54981] Secure connection failed
21:43:31.306 -> [59782] Connecting to blynk.cloud:443
21:43:31.500 -> [59986] Secure connection failed
21:43:36.303 -> [64786] Connecting to blynk.cloud:443
21:43:36.513 -> [64995] Secure connection failed
21:43:41.320 -> [69796] Connecting to blynk.cloud:443
21:43:41.515 -> [70001] Secure connection failed
21:43:46.301 -> [74761] Timeout
21:43:46.301 -> [74761] Last error code: 702
21:43:46.301 -> [74763] Configuration stored to flash
21:43:46.301 -> [74764] CONNECTING_CLOUD => ERROR
21:43:56.298 -> [84764] Restarting after error.
21:43:56.345 -> ets Jun  8 2016 00:22:57

What happens if you find this line in Settings.h…

#define CONFIG_DEFAULT_PORT           443

and change the port to either 80 or 81 ?

Pete.

I already try that yesterday, i change it to 80 but after saving and uploadig, in serial console it show still 443, it looks that you can put there any walue and its not taken??
Now its set to 80:

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

and result

22:20:13.399 -> [33440] SWITCH_TO_STA => CONNECTING_NET
22:20:13.399 -> [33440] Connecting to WiFi: dd-wrt
22:20:17.242 -> [37278] Using Dynamic IP: 10.201.20.166
22:20:17.242 -> [37278] CONNECTING_NET => CONNECTING_CLOUD
22:20:17.242 -> [37288] Connecting to blynk.cloud:443
22:20:17.479 -> [37496] Secure connection failed
22:20:22.259 -> [42296] Connecting to blynk.cloud:443
22:20:22.466 -> [42498] Secure connection failed
22:20:27.266 -> [47299] Connecting to blynk.cloud:443
22:20:27.478 -> [47506] Secure connection failed

Im going to try 81

81 = same result like before

Have you pressed the button for 10 seconds to clear the stored value?

Pete.

Yes please, almost every time when i upladed sketch i push that button

22:28:46.180 -> [92855] Hold the button for 10 seconds to reset configuration...
22:29:06.353 -> [113002] ERROR => RESET_CONFIG
22:29:06.353 -> [113008] Resetting configuration!
22:29:06.353 -> [113014] Configuration stored to flash
22:29:06.595 -> [113246] nvs_flash_erase: Success
22:29:06.595 -> [113246] RESET_CONFIG => WAIT_CONFIG
22:29:09.221 -> [115881] AP SSID: Blynk GarazIOT-6C068
22:29:09.221 -> [115881] AP IP:   0.0.0.0
22:29:09.221 -> [115882] AP URL:  blynk.setup

then reset button

22:30:58.229 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
22:30:58.229 -> configsip: 0, SPIWP:0xee
22:30:58.262 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
22:30:58.262 -> mode:DIO, clock div:1
22:30:58.262 -> load:0x3fff0030,len:1184
22:30:58.262 -> load:0x40078000,len:12804
22:30:58.262 -> ho 0 tail 12 room 4
22:30:58.262 -> load:0x40080400,len:3032
22:30:58.262 -> entry 0x400805e4
22:30:58.837 -> [266] Using default config.
22:30:58.837 -> 
22:30:58.837 -> >[266] 
22:30:58.837 ->     ___  __          __
22:30:58.837 ->    / _ )/ /_ _____  / /__
22:30:58.837 ->   / _  / / // / _ \/  '_/
22:30:58.837 ->  /____/_/\_, /_//_/_/\_\
22:30:58.837 ->         /___/ v1.0.1 on ESP32
22:30:58.837 -> 
22:30:58.837 -> [277] --------------------------
22:30:58.837 -> [277] Product:  GarazIOT
22:30:58.837 -> [277] Firmware: 0.1.0 (build Apr 26 2022 22:26:52)
22:30:58.873 -> [287] Device:   ESP32 @ 240MHz
22:30:58.873 -> [287] MAC:      F0:08:D1:D8:05:68
22:30:58.873 -> [288] Flash:    4096K
22:30:58.873 -> [288] ESP sdk:  v4.4-beta1-189-ga79dc75f0a
22:30:58.873 -> [298] Chip rev: 1
22:30:58.873 -> [299] Free mem: 261472
22:30:58.873 -> [299] --------------------------
22:30:58.873 -> [299] INIT => WAIT_CONFIG
22:31:01.504 -> [2920] AP SSID: Blynk GarazIOT-6C068
22:31:01.504 -> [2920] AP IP:   192.168.4.1
22:31:01.504 -> [2921] AP URL:  blynk.setup

and on the end connection from app

22:31:43.741 -> [45185] WAIT_CONFIG => CONFIGURING
22:31:46.663 -> [48090] Sending board info...
22:31:48.362 -> [49792] Scanning networks...
22:31:53.271 -> [54714] Found networks: 6
22:32:02.982 -> [64411] Applying configuration...
22:32:02.982 -> [64412] WiFi SSID: zahrada Pass: Kikusiatko88
22:32:02.982 -> [64412] Blynk cloud: MPds2dqkb7w7QYpv6s4U81tPIJHCjwMi @ blynk.cloud:443
22:32:02.982 -> [64426] CONFIGURING => SWITCH_TO_STA
22:32:03.034 -> [64431] Switching to STA...
22:32:04.105 -> [65540] SWITCH_TO_STA => CONNECTING_NET
22:32:04.105 -> [65540] Connecting to WiFi: zahrada
22:32:07.149 -> [68595] Using Dynamic IP: 10.201.20.166
22:32:07.187 -> [68595] CONNECTING_NET => CONNECTING_CLOUD
22:32:07.187 -> [68605] Connecting to blynk.cloud:443
22:32:07.906 -> [69325] Secure connection failed
22:32:12.183 -> [73615] Connecting to blynk.cloud:443
22:32:12.405 -> [73820] Secure connection failed
22:32:17.198 -> [78621] Connecting to blynk.cloud:443
22:32:17.409 -> [78822] Secure connection failed
22:32:22.205 -> [83624] Connecting to blynk.cloud:443
22:32:22.412 -> [83829] Secure connection failed
22:32:27.226 -> [88630] Connecting to blynk.cloud:443
22:32:27.408 -> [88836] Secure connection failed
22:32:32.202 -> [93636] Connecting to blynk.cloud:443
22:32:32.414 -> [93843] Secure connection failed
22:32:37.162 -> [98603] Timeout
22:32:37.162 -> [98603] Last error code: 702
22:32:37.162 -> [98605] Configuration stored to flash
22:32:37.204 -> [98606] CONNECTING_CLOUD => ERROR

and again same result :frowning:

And I already try second board, both boards are new.

I already connected on pin 16 LED and set this BOARD_LED_PIN 16 in Settings.h. Diode flashing, with diferent speed but still trouble to connect to blynk cloud.

I gues its some problem with this librrary <BlynkSimpleEsp32_SSL.h>, when I try example sketch ESP32_WIFI all its ok then I try ESP32_WIFI_SSL I get error Secure connection failed. Its there option how to use BlynkEdgent without SSL?

Maybe you should try re-installing the Blynk library.

Pete.

Also, it might be worth you reading this…

Pete.

Interesting that this has not yet been addressed anywhere between Blynk and Espressif.
Since I am using the ESP32-S2, I am also using the ESP32 2.0.2 package, and have Blynk on UNsecure no-SSL connections until this gets addressed. Ugly. Still on SSL with ESP8266 - that works fine.

Frankly, I’d forgotten about this until I saw these posts. Hey Blynk, any ideas here? We can’t be the only ones running into SSL issues with ESP32 2.0.2.

Hy Pete
Thanks for felp, that solution what you mention in post above working ok. So thumb up and one more time manny thkanks for you time and your help.

1 Like

The GitHub issue that @vshymanskyy raised is awaiting testing in v2.0.3-rc1, so maybe you should give that a try?

Pete.

Thank you @PeteKnight . Will check this out 2.0.3 RC1 next few days.

Question I should know the answer to: how do I install this beta? Arduino IDE does not see it.
I see the release on Github, looking for simple installation recipe. Thanks in advance.