Edgent provisioning

Hello firstly I am new to Blynk and Arduino. I have made the connection between my project and Blynk and it worked well until my wifi dropped out then my project became blocked.

To overcome this after several weeks of trial and error and zero sucess I have decided to try edgent. I made one successful connection then after wifi restart I am now not able to connect. below is the debug log and the sketch. I would appreciate any help.

My hardware is is Mega 2560 and esp01. The sketch is loaded on the esp01

[394] --------------------------
[397] Product:  RVWifi
[399] Firmware: 0.1.0 (build Jun 27 2022 20:10:37)
[404] Device:   ESP8266 @ 80MHz
[407] MAC:      BC:FF:4D:19:BD:E4
[410] Flash:    1024K
[412] ESP core: 3.0.2
[414] ESP SDK:  2.2.2-dev(38a443e)
[417] Boot Ver: 31
[419] Boot Mode:1
[420] FW info:  471904/487424, MD5:62f71889a345c863e7bb61f71ddc5926
[636] Free mem: 30520
[636] --------------------------

>[636] INIT => WAIT_CONFIG
fpm close 3 
mode : sta(bc:ff:4d:19:bd:e4) + softAP(be:ff:4d:19:bd:e4)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
[APConfig] local_ip: 192.168.4.1 gateway: 192.wifi evt: 8
168.4.1 subnet: 255.255.255.0
[APConfig] DHCP IP start: 192.168.4.100
[APConfig] DHCP IP end: 192.168.4.200
bcn 0
del if1
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
[1268] AP SSID: Blynk RVWifi-B85F0
[1268] AP IP:   192.168.4.1
[1269] AP URL:  blynk.setup
wifi evt: 7
wifi evt: 7
wifi evt: 7
add 1
aid 1
station: 94:b8:6d:8a:ee:18 join, AID = 1
wifi evt: 5
wifi evt: 9
wifi evt: 9
wifi evt: 7
wifi evt: 9
wifi evt: 9
wifi evt: 7
[46824] Applying configuration...
[46825] WiFi SSID: ThomasGuest Pass: 
[46825] Blynk cloud: KwVDoj9D5PHCtgmX-PMspvtuInfzuP4B @ blynk.cloud:443
[46828] WAIT_CONFIG => SWITCH_TO_STA
[46830] Switching to STA...
wifi evt: 7
wifi evt: 7
station: 94:b8:6d:8a:ee:18 leave, AID = 1
rm 1
bcn 0
del if1
del if0
usl
mode : null
wifi evt: 6
wifi evt: 8
mode : sta(bc:ff:4d:19:bd:e4)
add if0
[47935] SWITCH_TO_STA => CONNECTING_NET
wifi evt: 8
[47936] Connecting to WiFi: ThomasGuest
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 25

connected with ThomasGuest, channel 7
dhcp client start...
cnt 
wifi evt: 0
pm open,type:2 0
[97944] Last error code: 701
[97944] Configuration stored to flash
[97944] CONNECTING_NET => ERROR
[107948] Restarting after error.

 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 3460, room 16 
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4 
tail 4
chksum 0xc9
csum 0xc9
v00073360
~ld
SDK:2.2.2-dev(38a443e)/Core:3.0.2=30002000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635
[389] 



// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID           "TMPLiZjduO_j"
#define BLYNK_DEVICE_NAME           "RVWifi"

#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_SPARKFUN_BLYNK_BOARD
#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
//#define USE_WEMOS_D1_MINI

#include "BlynkEdgent.h"

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

  BlynkEdgent.begin();
}

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

@davethomas 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:
```

I’d also suggest that you add triple backticks at the beginning and end of your serial monitor text too.

Pete.

Hello Pete, thank you for the response and instruction. Edit complete.

Wrong character, triple backticks look like this ```

Do you know how to copy and paste?
That’s why I gave you the correct triple backtick characters.

Pete.

Thanks John93, Pete.

Just to be sure, you’re using this board


Right ?

Yes that is the board

What role does the Arduino Mega play in this setup?
Have you edited your Settings.h file to reflect the actual pins used by the ESP-01 rather than the NodeMCU that you’ve chosen for your board type?
Note that the ESP-01S in the image is different to the ESP-01 as fas as the onboard LED GPIO pin is concerned.

Normally an ESP-01 would be used as a WiFi modem for a Mega, with the ESP-01 running the factory AT firmware, and your Blynk sketch running on the Mega. But, with that configuration you can’t use the Edgent sketch.

Pete.

Very bad choice.
I’d suggest using esp32 or nodemcu instead.

The mega Is simply part of the hardware chain. My 01 test adapter uses the same pins as the Node MCU. in other words the button and LED work as intended.

as I stated I am able to get Blynk working using the 01 as a modem but since the connection code is part of the Mega code it blocks the processing when the wifi drops out. I tried for three weeks to resolve that issue with no success. unless you can suggest another option then I am relinquished to using the 01 as a pass through device to connect to wifi.

John, I also tried using an NodeMCU with the same result as the 01.

in other testing using an older version of wifi manager I had to lengthen the connection time and number of attempts to get a connection.

I applied those same settings to the edgent sketch but was not able to get the connection.

Thank you both for your assistance.

It doesn’t matter which hardware you’re using, if you use Blynk.begin it’s a blocking command and code processing will halt if there is no WiFi or Blynk connection.

The solution is to manage the WiFi connection manually (don’t leave it up to Blynk) use Blynk.config and Blynk.connect in your sketch.
However, doing this with a NodeMCU or ESP32 is much easier than with an ESP-01 and Arduino combination.

Trying to run any code on the ESP-01 is problematic, because of the lack of available pins.

Pete.

OK I switched over to the NodeMCU, I checked my router and the device is showing up as a connected device however I am still getting error 701. it does the same thing on the ESP01.

It looks like I am not receiving the 'connected to network" signal from my router to the Nodemcu.

I also tried another Wifi manager library with the same result.

Do you mean you used a WiFiManager sketch instead of Edgent, or something else?

What happens if you turn off debugging in the IDE ?

Do you have a regular internet connection, or are you using a 3/4G router?
Have you tried connecting via a hotspot on your phone, using GSM data?

Pete.

I tried another wifi manager,
<WiFiManager.h> // https://github.com/tzapu/WiFiManager

I am using a regular wifi connection as guest no password.

Debugging is off in the IDE

I did try to configure with my phone, same network as the ESP with the same result.

The WiFi event codes that are in the serial output of your first post look like they are coming from having a debug level other than “none” selected in the IDE.

Your other comments don’t really answer my questions.

It could be that your ISP is blocking the Blynk protocol, hence my question…

Your answer of…

appears to say that it’s not something you’ve tried.

Pete.

[quote=“PeteKnight, post:14, topic:61624”]

Do you have a regular internet connection, or are you using a 3/4G router? Regular
Have you tried connecting via a hotspot on your phone, using GSM data ?no

I was able to get it working temporarily… I reflashed the Node mcu with the esgent sketch and the option to erase all Flash contents. selected. My system showed “online” on my phone.

when I cycled power to the nodemcu I returned to my original problem.

I tried to duplicate the flash process, it did not solve the problem.

What does your serial monitor show when you boot your NodeMCU?

Pete.

‘’’
[612] Using default config.
[612]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v1.1.0 on ESP8266

#StandWithUkraine StandWithUkraine | #StandWithUkraine banner and related documents

[621] --------------------------
[624] Product: RVWifi
[626] Firmware: 0.1.0 (build Jun 28 2022 11:41:49)
[630] Device: ESP8266 @ 80MHz
[633] MAC: C4:5B:BE:49:4C:33
[636] Flash: 4096K
[638] ESP core: 3.0.2
[640] ESP SDK: 2.2.2-dev(38a443e)
[643] Boot Ver: 31
[645] Boot Mode:1
[647] FW info: 468816/1626112, MD5:9a75169faf8093c70ff99a52f0c0055f
[854] Free mem: 31000
[854] --------------------------

[854] INIT => WAIT_CONFIG
[1465] AP SSID: Blynk RVWifi-E258B
[1465] AP IP: 192.168.4.1
[1466] AP URL: blynk.setup

‘’’

Triple backticks look like this:
```

Have you been through the provisioning process (+ Add device) in the app?

When you do that, what does the serial monitor show?

Pete.