BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Compilation error while using BlynkEdgent and AsyncElegantOTA library on the same code

While compiling a simple code with BlynkEdgent and AsyncElegantOTA library an error is displayed like a conflicting declaration ‘AsyncWebServer server’

In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:62:18: error: 'HTTP_GET' conflicts with a previous declaration
   62 |   HTTP_GET     = 0b00000001,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:29: note: previous declaration 'HTTPMethod HTTP_GET'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                             ^~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:63:18: error: 'HTTP_POST' conflicts with a previous declaration
   63 |   HTTP_POST    = 0b00000010,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:50: note: previous declaration 'HTTPMethod HTTP_POST'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                  ^~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:64:18: error: 'HTTP_DELETE' conflicts with a previous declaration
   64 |   HTTP_DELETE  = 0b00000100,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:83: note: previous declaration 'HTTPMethod HTTP_DELETE'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                                                   ^~~~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:65:18: error: 'HTTP_PUT' conflicts with a previous declaration
   65 |   HTTP_PUT     = 0b00001000,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:61: note: previous declaration 'HTTPMethod HTTP_PUT'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                             ^~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:66:18: error: 'HTTP_PATCH' conflicts with a previous declaration
   66 |   HTTP_PATCH   = 0b00010000,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:71: note: previous declaration 'HTTPMethod HTTP_PATCH'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                                       ^~~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:67:18: error: 'HTTP_HEAD' conflicts with a previous declaration
   67 |   HTTP_HEAD    = 0b00100000,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:39: note: previous declaration 'HTTPMethod HTTP_HEAD'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                       ^~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:68:18: error: 'HTTP_OPTIONS' conflicts with a previous declaration
   68 |   HTTP_OPTIONS = 0b01000000,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:96: note: previous declaration 'HTTPMethod HTTP_OPTIONS'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                                                                ^~~~~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:69:18: error: 'HTTP_ANY' conflicts with a previous declaration
   69 |   HTTP_ANY     = 0b01111111,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:19: note: previous declaration 'HTTPMethod HTTP_ANY'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                   ^~~~~~~~
Edgent_ESP8266:23:16: error: conflicting declaration 'AsyncWebServer server'
   23 | AsyncWebServer server(7775);
      |                ^~~~~~
In file included from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
sketch\ConfigMode.h:60:18: note: previous declaration as 'ESP8266WebServer server'
   60 | ESP8266WebServer server(80);
      |                  ^~~~~~
exit status 1
conflicting declaration 'AsyncWebServer server'

• NodeMCU 1.0
• Using Blynk server
• Blynk Library version 1.1.0

// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID           "TMPL_zFqOJa_"
#define BLYNK_DEVICE_NAME           "Sump Motor IoT ESP8266"

#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"
#include <AsyncElegantOTA.h>

#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
AsyncWebServer server(7775);

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

  BlynkEdgent.begin();
}

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

BlynkEdgent offers over the air firmware update (OTA) It’s called Blynk.Air
May I ask you why are you using AsyncElegantOTA library ?

You’d be far better copying and pasting the compiler error message text and posting it between triple backticks rather than posting screeenshots.
The screenshots are virtually un-readable.

Pete.

Hi @John93, I have a project that was built with Blynk 1.0 now trying to migrate to Blynk 2.0 without much change. I used AsyncElegantOTA library to achieve two functionalities, OTA and display a simple web page showing all the backend variable values.

Hi @PeteKnight, sorry this is my second post

In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:62:18: error: 'HTTP_GET' conflicts with a previous declaration
   62 |   HTTP_GET     = 0b00000001,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:29: note: previous declaration 'HTTPMethod HTTP_GET'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                             ^~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:63:18: error: 'HTTP_POST' conflicts with a previous declaration
   63 |   HTTP_POST    = 0b00000010,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:50: note: previous declaration 'HTTPMethod HTTP_POST'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                  ^~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:64:18: error: 'HTTP_DELETE' conflicts with a previous declaration
   64 |   HTTP_DELETE  = 0b00000100,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:83: note: previous declaration 'HTTPMethod HTTP_DELETE'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                                                   ^~~~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:65:18: error: 'HTTP_PUT' conflicts with a previous declaration
   65 |   HTTP_PUT     = 0b00001000,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:61: note: previous declaration 'HTTPMethod HTTP_PUT'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                             ^~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:66:18: error: 'HTTP_PATCH' conflicts with a previous declaration
   66 |   HTTP_PATCH   = 0b00010000,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:71: note: previous declaration 'HTTPMethod HTTP_PATCH'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                                       ^~~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:67:18: error: 'HTTP_HEAD' conflicts with a previous declaration
   67 |   HTTP_HEAD    = 0b00100000,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:39: note: previous declaration 'HTTPMethod HTTP_HEAD'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                       ^~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:68:18: error: 'HTTP_OPTIONS' conflicts with a previous declaration
   68 |   HTTP_OPTIONS = 0b01000000,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:96: note: previous declaration 'HTTPMethod HTTP_OPTIONS'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                                                                                                ^~~~~~~~~~~~
In file included from C:\Users\Rames\OneDrive\Documents\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:21,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:20:
C:\Users\Rames\OneDrive\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:69:18: error: 'HTTP_ANY' conflicts with a previous declaration
   69 |   HTTP_ANY     = 0b01111111,
      |                  ^~~~~~~~~~
In file included from sketch\ConfigMode.h:3,
                 from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
C:\Users\Rames\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:19: note: previous declaration 'HTTPMethod HTTP_ANY'
   47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
      |                   ^~~~~~~~
Edgent_ESP8266:23:16: error: conflicting declaration 'AsyncWebServer server'
   23 | AsyncWebServer server(7775);
      |                ^~~~~~
In file included from sketch\BlynkEdgent.h:25,
                 from C:\Users\Rames\OneDrive\Documents\Arduino\Edgent_ESP8266\Edgent_ESP8266.ino:19:
sketch\ConfigMode.h:60:18: note: previous declaration as 'ESP8266WebServer server'
   60 | ESP8266WebServer server(80);
      |                  ^~~~~~
exit status 1
conflicting declaration 'AsyncWebServer server'

So why are you using Edgent?

Also, it would have been nice if you’d REPLACED your screenshots with text.

Pete.

I’d suggest using the built-in OTA functionality instead of additional libraries if you would like to use BlynkEdgent.

Is Blynk Edgent not the correct way to migrate and use Blynk 2.0 features. No specific reason just followed the Blynk docs.

If you would like to use OTA firmware update and WiFi provisioning, then BlynkEdgent is the way you should go.

Understood, will remove AsyncElegantOTA and try. Thanks!!!

Using Blynk Edgent and “the simplest way possible” are very different things.
Edgent is a very complex example program which provides dynamic provisioning of WiFi credentials and Auth tokens, as well as OTA via the Blynk.Air system.

The simplest way to migrate from Blynk Legacy to IoT is to create a template, add your datastreams, create a device from your template, then paste the provided three lines of code into the very top of your existing Legacy sketch.

You then re-compile with the with version 1.x.x of the Blynk library and test.

This approach is also explained in the docs.

Pete.

1 Like

Thanks, Pete

Just tried the “simplest way”, I made no change to the code just added TEMPLATE_ID, DEVICE_NAME, AUTH_TOKEN to the beginning and it worked.

Just curious, so it is not possible to have a custom web page using ESP8266WebServer.h while using Blynk Edgent?

Why ?
What are you trying to achieve exactly ?

I don’t know, I’ve never tried.

My approach is that Edgent is great if you want built-in provisioning and OTA and don’t want to do anything too complex that might conflict with this.

If you want to use a different OTA or provisioning system then I’d steer clear of Edgent.

Having said that, I don’t use either approach as I don’t run any Blynk code on my devices, I use MQTT and Node-Red with Blynk as my UI.

Pete.

Tried a sample have Blynk Edgent and a customer webpage running together like below and it worked fine after a reboot, instead of declaring ESP8266WebServer.h (also used by AsyncElegantOTA) again re-utilised the one that was declared under ConfigMode.h from Blynk Edgent

#define BLYNK_TEMPLATE_ID "TMPL_zFqOJa_"
#define BLYNK_DEVICE_NAME "Sump Motor IoT"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial

//#define BLYNK_DEBUG
#define APP_DEBUG

#include <ESP8266WiFi.h>
#include "BlynkEdgent.h"
#include "index.h"

void handleRoot() {
  String s = MAIN_page;
  server.send(200, "text/html", s);
}

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

  BlynkEdgent.begin();

  server.on("/", handleRoot);
  server.begin();
}

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

index.h

const char MAIN_page[] PROGMEM = R"=====(
<HTML>
	<HEAD>
			<TITLE>My first web page</TITLE>
	</HEAD>
<BODY>
	<CENTER>
			<B>Hello World.... </B>
	</CENTER>	
</BODY>
</HTML>
)=====";

Would you like to use the webpage to control your devices for example ?

No, the purpose of webpage is to display some backend values. The device is controlled through Blynk.