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
@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.
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.
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.
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.
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.
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.
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.