Question Regarding Migrating to Blynk 2.0

Hello Everyone,

Trying to migrate a project to the new Blynk and having a bit of a time understanding how to integrate Blynk.Edgent and its provisioning into my project.

I can get the example sketch working for Edgent, and I can provision it through the new Blynk App and connect it to the template, all good. What I don’t understand is where I am supposed to put my program into the Edgent example. I would like the device to come up in provisioning, be provisioned into the template and with the required network credentials and when it reboots, reboots with my sketch, including the needed add-ons to have OTA updates and all the other new goodies work through the Blynk Cloud console.

I’m not sure if I should upload my code, it is fairly long. I’ve experimented with trying to add my sketch to the .ino file of the Blynk.Edgent example but I haven’t had success yet so I figured I would reach out here and make sure I’m not missing something obvious. The documentation isn’t clear (from my point of view) on how to add your sketch to the device, the provisioning aspect is clear and straightforward.

I’m using an ESP32-CAM AI-THINKER.

Thanks in advance for your help!

That’s the way to do it.

Pete.

Thanks for the quick reply Pete.

As a quick question, my sketch in Blynk1.0 used the WiFi.h library, which requires me to have my ssid and pass as chars, but since I want dynamic provisioning I don’t want any pre-loaded stuff in the sketch. Most of my errors seem to involve this type of problem. requirements to be declared that are taken care of in provisioning but the libraries need for compiling.

Am I better off trying to re-write the sketch without using these libraries? Also, do I need to include the BlynkSimple library in my sketch or does Edgent take care of all these functions? The documentation is not clear.

Thanks again.

I’ll be away from my computer most of the day but will try and keep up to date on replies. Worst case I will post updates tonight.

I know it is long, but here is my code:

#define PHOTOCLICK V5

#define LED 4

#define DOORUP V7

#define DOORDOWN V6

#define BLYNK_HEARTBEAT 30

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_TEMPLATE_ID "xxxxx"

#define BLYNK_DEVICE_NAME "xxxxx"

#include "esp_camera.h"

#include "Arduino.h"

#include <WiFi.h>

#include <WiFiClient.h> 

#include <ESP32_FTPClient.h>

#include "soc/soc.h"           // Disable brownout problems

#include "soc/rtc_cntl_reg.h"  // Disable brownout problems

#include <BlynkSimpleEsp32.h>

#include "BlynkEdgent.h"

WidgetLED led1(V1);

WidgetLED led2(V2);

WidgetLED led3(V3);

WidgetLED led4(V4);

//#define WIFI_SSID "xxxxxx"

//#define WIFI_PASS "xxxxx"

//char auth[] = "xxxxx";  //sent by Blynk

// Pin definition for CAMERA_MODEL_AI_THINKER

#define PWDN_GPIO_NUM     32

#define RESET_GPIO_NUM    -1

#define XCLK_GPIO_NUM      0

#define SIOD_GPIO_NUM     26

#define SIOC_GPIO_NUM     27

#define Y9_GPIO_NUM       35

#define Y8_GPIO_NUM       34

#define Y7_GPIO_NUM       39

#define Y6_GPIO_NUM       36

#define Y5_GPIO_NUM       21

#define Y4_GPIO_NUM       19

#define Y3_GPIO_NUM       18

#define Y2_GPIO_NUM        5

#define VSYNC_GPIO_NUM    25

#define HREF_GPIO_NUM     23

#define PCLK_GPIO_NUM     22

char ftp_server[] = "files.000webhost.com";

char ftp_user[] = "xxxxxx";

char ftp_pass[] ="xxxxxx";

bool takePhoto = false; 

bool loading = false;

String displayImage = "https://coopcommandimages.000webhostapp.com/uploads/1.png";

String coopImageURL = "https://coopcommandimages.000webhostapp.com/uploads/1.png";

String coopImage = "coopPic.jpg";

int i = 1;

int ic = 1;

int imageFlip = 1;

char coopRx; // Info received from CoopCommand

bool newDataRx = false; //has CoopCam received new data from CoopCommand

BlynkTimer timer;

// WidgetLCD lcd(V1);

// you can pass a FTP timeout and debbug mode on the last 2 arguments

ESP32_FTPClient ftp (ftp_server,ftp_user,ftp_pass, 5000, 2);

void setup()

{

  pinMode(LED, OUTPUT);

 timer.setInterval(1000,coopCom);

 timer.setInterval(250,loadingImage);

  Blynk.setProperty(V0, "url", 1, coopImageURL);

  Blynk.virtualWrite(V0, 1); 

  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector

  

  camera_config_t config;

  config.ledc_channel = LEDC_CHANNEL_0;

  config.ledc_timer = LEDC_TIMER_0;

  config.pin_d0 = Y2_GPIO_NUM;

  config.pin_d1 = Y3_GPIO_NUM;

  config.pin_d2 = Y4_GPIO_NUM;

  config.pin_d3 = Y5_GPIO_NUM;

  config.pin_d4 = Y6_GPIO_NUM;

  config.pin_d5 = Y7_GPIO_NUM;

  config.pin_d6 = Y8_GPIO_NUM;

  config.pin_d7 = Y9_GPIO_NUM;

  config.pin_xclk = XCLK_GPIO_NUM;

  config.pin_pclk = PCLK_GPIO_NUM;

  config.pin_vsync = VSYNC_GPIO_NUM;

  config.pin_href = HREF_GPIO_NUM;

  config.pin_sscb_sda = SIOD_GPIO_NUM;

  config.pin_sscb_scl = SIOC_GPIO_NUM;

  config.pin_pwdn = PWDN_GPIO_NUM;

  config.pin_reset = RESET_GPIO_NUM;

  config.xclk_freq_hz = 20000000;

  config.pixel_format = PIXFORMAT_JPEG; 

  

  if(psramFound()){

    config.frame_size = FRAMESIZE_SVGA; // FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA

    config.jpeg_quality = 20;

    config.fb_count = 2;

  } 

  else {

    config.frame_size = FRAMESIZE_VGA;

    config.jpeg_quality = 20;

    config.fb_count = 1;

  }

  

  // Init Camera

  esp_err_t err = esp_camera_init(&config);

  if (err != ESP_OK) {

//    Serial.printf("Camera init failed with error 0x%x", err);

    return;

  }

  

  Serial.begin( 115200 );

 // WiFi.begin( WIFI_SSID, WIFI_PASS );

//  Blynk.begin(auth, WIFI_SSID, WIFI_PASS);

    BlynkEdgent.begin();

  // Serial.println("Connecting Wifi...");

  while (WiFi.status() != WL_CONNECTED) {

      delay(500);

 //     Serial.print(".");

  }

//  Serial.println("");

//  Serial.print("IP address: ");

//  Serial.println(WiFi.localIP());

}

BLYNK_CONNECTED() {

    Blynk.syncAll();

}

void loadingImage( void ) {

      if (loading) {

      displayImage= "https://coopcommandimages.000webhostapp.com/uploads/";

      displayImage+= i;

      displayImage+= ".png";

      Blynk.setProperty(V0, "url", 1, displayImage); 

      if (i <= 6) {

      i ++;

      }

      else if (i > 6) {

        i = 1;

      }

      }

      else if (!loading) {

        if (ic == 1) {

        coopImageURL = "https://coopcommandimages.000webhostapp.com/uploads/coopPic2.jpg";

        }

        else if (ic == 2) {

        coopImageURL = "https://coopcommandimages.000webhostapp.com/uploads/coopPic3.jpg";

        }

        else if (ic == 3) {

          coopImageURL = "https://coopcommandimages.000webhostapp.com/uploads/coopPic4.jpg";

        }

        Blynk.setProperty(V0, "url", 1, coopImageURL);

        Blynk.virtualWrite(V0, 1);  

        i = 1;      

      }

}

 

void sendPhoto ( void ) {

   if (takePhoto) {

   camera_fb_t * fb = NULL;

  

  // Take Picture with Camera

  fb = esp_camera_fb_get(); 

  digitalWrite(LED, LOW); 

  delay (50);

  if(!fb) {

//    Serial.println("Camera capture failed");

    ESP.restart();

    return;

  }

if (imageFlip == 1) {

  ftp.OpenConnection();

  // Create the new file and send the image

  ftp.ChangeWorkDir("/public_html/uploads/");

  ftp.InitFile("Type I");

  ftp.NewFile("coopPic2.jpg");

  ftp.WriteData( fb->buf, fb->len );

  ftp.CloseFile();

  ftp.CloseConnection();

  takePhoto = false;

  imageFlip = 2;

  ic = 1;

  esp_camera_fb_return(fb);

    Serial.print('N');

   }

else if (imageFlip == 2) {

   ftp.OpenConnection();

  // Create the new file and send the image

  ftp.ChangeWorkDir("/public_html/uploads/");

  ftp.InitFile("Type I");

  ftp.NewFile("coopPic3.jpg");

  ftp.WriteData( fb->buf, fb->len );

  ftp.CloseFile();

  ftp.CloseConnection();

  takePhoto = false;

  imageFlip = 3;

  ic = 2;

  esp_camera_fb_return(fb);

  Serial.print('N');

   }

else if (imageFlip == 3) {

   ftp.OpenConnection();

  // Create the new file and send the image

  ftp.ChangeWorkDir("/public_html/uploads/");

  ftp.InitFile("Type I");

  ftp.NewFile("coopPic4.jpg");

  ftp.WriteData( fb->buf, fb->len );

  ftp.CloseFile();

  ftp.CloseConnection();

  takePhoto = false;

  imageFlip = 1;

  ic = 3;

  esp_camera_fb_return(fb);

  Serial.print('N');

   }

}

}

void coopCom ( void ) {

  if (WiFi.status() != WL_CONNECTED) {

    timer.setTimeout(30000, []()

{ ESP.restart();

});

  }

  if (Serial.available() > 0) {

    coopRx = Serial.read();

    newDataRx = true;

  }

  if (newDataRx == true) {

    if (coopRx == 'O') { //If CoopCommand says the door is up

      led1.on();

      led2.off();

      led3.off();

      led4.off();

      newDataRx = false;

    }

    if (coopRx == 'S') { //If CoopCommand says the door is down

      led1.off();

      led2.on();

      led3.off();

      led4.off();

      newDataRx = false;

    }

    if (coopRx == 'U') { //If CoopCommand says the door is opening

      led1.off();

      led2.off();

      led3.on();

      led4.off();

      newDataRx = false;

    }

    if (coopRx == 'D') { //If CoopCommand says the door is closing

      led1.off();

      led2.off();

      led3.off();

      led4.on();

      newDataRx = false;

    }

  }

}

BLYNK_WRITE(DOORUP) {

Serial.print('U');

}

BLYNK_WRITE(DOORDOWN) {

Serial.print('D');

}

BLYNK_WRITE(V5) {

digitalWrite(LED, HIGH);

Serial.print('L'); 

takePhoto = true;

loading = true;

loadingImage();

timer.setTimeout(250, sendPhoto);

timer.setTimeout(3000, []()

{

  loading = false;

  loadingImage();

});

}

void loop()

{

  Blynk.run();

  timer.run();

  BlynkEdgent.run();

}

And here are the errors I’m getting:


In file included from C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\BlynkEdgent.h:9:0,
                 from c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:19:
c:\Users\krist\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:54:7: error: 'BlynkWifi' is not a template type
 class BlynkWifi
       ^
c:\Users\krist\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:128:25: error: conflicting declaration 'WiFiClientSecure _blynkWifiClient'
 static WiFiClientSecure _blynkWifiClient;
                         ^
In file included from c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:18:0:
c:\Users\krist\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32.h:93:19: note: previous declaration as 'WiFiClient _blynkWifiClient'
 static WiFiClient _blynkWifiClient;
                   ^
In file included from C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\BlynkEdgent.h:9:0,
                 from c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:19:
c:\Users\krist\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:129:83: error: conflicting declaration 'BlynkArduinoClientSecure<WiFiClientSecure> _blynkTransport'
 static BlynkArduinoClientSecure<WiFiClientSecure> _blynkTransport(_blynkWifiClient);
                                                                                   ^
In file included from c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:18:0:
c:\Users\krist\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32.h:94:27: note: previous declaration as 'BlynkArduinoClient _blynkTransport'
 static BlynkArduinoClient _blynkTransport(_blynkWifiClient);
                           ^
In file included from C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\BlynkEdgent.h:9:0,
                 from c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:19:
c:\Users\krist\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:130:1: error: 'BlynkWifi' is not a template
 BlynkWifi<BlynkArduinoClientSecure<WiFiClientSecure> > Blynk(_blynkTransport);
 ^
c:\Users\krist\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:130:77: error: redefinition of 'BlynkWifi Blynk'
 BlynkWifi<BlynkArduinoClientSecure<WiFiClientSecure> > Blynk(_blynkTransport);
                                                                             ^
In file included from c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:18:0:
c:\Users\krist\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32.h:95:11: note: 'BlynkWifi Blynk' previously declared here
 BlynkWifi Blynk(_blynkTransport);
           ^
In file included from C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\BlynkEdgent.h:22:0,
                 from c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:19:
C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\ConfigMode.h: In lambda function:
C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\ConfigMode.h:150:27: error: 'BLYNK_PRINT' was not declared in this scope
         Update.printError(BLYNK_PRINT);
                           ^
C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\ConfigMode.h:155:27: error: 'BLYNK_PRINT' was not declared in this scope
         Update.printError(BLYNK_PRINT);
                           ^
C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\ConfigMode.h:157:7: error: 'BLYNK_PRINT' was not declared in this scope
       BLYNK_PRINT.print(".");
       ^
C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\ConfigMode.h:159:7: error: 'BLYNK_PRINT' was not declared in this scope
       BLYNK_PRINT.println();
       ^
c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino: At global scope:
c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:66:12: error: redefinition of 'BlynkTimer timer'
 BlynkTimer timer;
            ^
In file included from c:\Users\krist\Documents\Arduino\CoopCamEdgent_ESP32\CoopCamEdgent_ESP32.ino:19:0:
C:\Users\krist\AppData\Local\Temp\arduino-sketch-CD2AB80C7F844EAA882172D71AC07DC6\sketch\BlynkEdgent.h:111:12: note: 'BlynkTimer timer' previously declared here
 BlynkTimer timer;
            ^
Compilation error: Error: 2 UNKNOWN: exit status 1


Played around with this most of the weekend, not a lot of luck.
Does anyone have an example of a program they have gotten to work while also using Blynk.Edgent?
I can’t seem to get my program to work with it and the documentation is very unclear on most of the new Blynk2.0 stuff (I get that it is new and they are still working on it but my god is it making it fun to try and get things working that aren’t super, super simple.)

First of all, if your sketch is big and complicated, it’s not mandatory to integrate with Blynk.Edgent. Especially if it’s just a single device of this type.
Just add Template ID and static Auth Token on top of your existing sketch and you’re good to go.
More on migration: Migrating to new Blynk - Blynk Documentation

Thanks for the reply!

I know its not mandatory, but ultimately I’m working on turning this project into a saleable product and the provisioning/deployment and OTA aspects of Edgent are just too tempting to ignore. I was hoping some people on here had some luck integrating it and I could browse their code and see what I was messing up.

I guess I’ll try and get it working with a static auth token first and then play with Edgent. The datastreams are also not clear to me but thats likely because I haven’t had a chance to actually use them yet.

Wanted to give another update. I managed to get my sketch to compile (still not working but baby steps) with these steps:

  • get rid of my Blynktime timer line, it is in one of the .h files and that messes it up.
  • leave all my original code in place, no commenting out of the wifi ssid, pass, auth, etc.

Now the problem I have is the device seems to boot straight into my code, not the Blynk Provisioning section but also refuses to connect to the cloud. I can get the example code, and other randome Blynk examples to connect to the cloud, but using the same auth token my device will not.

I’m also unsure what I am doing wrong that is causing it to skip the provisioning process.

Remove Blynk.run from loop. Its taken care by BlynkEdgent.run

I can see in the setup part, the serial.begin is at the ending of setup(). So you cannot see whats (errors) happening on the serial monitor before this is called.

And also blynk functions in setup before the wifi setup protocol is called in.

So i suggest you to clean up the code a bit. Keep a proper flow of the code. This may not solve the problem yet. But we can get an idea where n whats going wrong.

Thanks Madhukesh, I “think” I’m making some progress here.

I’m getting fewer and fewer compile errors, but still having issues, I’m at work right now but I’ve made some changes, done some cleanup and will repost with my current issues tonight!

So I have narrowed down the source of my compile errors.
There seems to be some sort of conflict or issue using the including #esp_camera.h in your program. As soon as I include it I get a whole host of errors, which I have included in a code block below.
Specifically, the errors seem to all point towards driver/ledc.h other than a weird closing bracket error. Anyways, all these errors vanish if I comment out the #esp_camera.h

Errors:

In file included from C:\Users\krist\AppData\Local\Temp\arduino-sketch-00F2B8DA123702C27AF693FB7351D3AA\sketch\BlynkEdgent.h:8:0,
                 from c:\Users\krist\AppData\Local\Temp\.arduinoIDE-unsaved202165-30612-1d4d815.rufwi\Edgent_ESP32\Edgent_ESP32.ino:18:
C:\Users\krist\AppData\Local\Temp\arduino-sketch-00F2B8DA123702C27AF693FB7351D3AA\sketch\Settings.h:49:28: error: expected identifier before numeric constant
 #define LEDC_CHANNEL_1     1
                            ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:64:5: note: in expansion of macro 'LEDC_CHANNEL_1'
     LEDC_CHANNEL_1,     /*!< LEDC channel 1 */
     ^
C:\Users\krist\AppData\Local\Temp\arduino-sketch-00F2B8DA123702C27AF693FB7351D3AA\sketch\Settings.h:49:28: error: expected '}' before numeric constant
 #define LEDC_CHANNEL_1     1
                            ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:64:5: note: in expansion of macro 'LEDC_CHANNEL_1'
     LEDC_CHANNEL_1,     /*!< LEDC channel 1 */
     ^
C:\Users\krist\AppData\Local\Temp\arduino-sketch-00F2B8DA123702C27AF693FB7351D3AA\sketch\Settings.h:49:28: error: expected unqualified-id before numeric constant
 #define LEDC_CHANNEL_1     1
                            ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:64:5: note: in expansion of macro 'LEDC_CHANNEL_1'
     LEDC_CHANNEL_1,     /*!< LEDC channel 1 */
     ^
In file included from C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/esp32-camera/esp_camera.h:69:0,
                 from c:\Users\krist\AppData\Local\Temp\.arduinoIDE-unsaved202165-30612-1d4d815.rufwi\Edgent_ESP32\Edgent_ESP32.ino:19:
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:72:3: error: 'ledc_channel_t' does not name a type
 } ledc_channel_t;
   ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:110:5: error: 'ledc_channel_t' does not name a type
     ledc_channel_t channel;         /*!< LEDC channel (0 - 7) */
     ^
In file included from C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/esp32-camera/esp_camera.h:69:0,
                 from c:\Users\krist\AppData\Local\Temp\.arduinoIDE-unsaved202165-30612-1d4d815.rufwi\Edgent_ESP32\Edgent_ESP32.ino:19:
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:172:52: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_update_duty(ledc_mode_t speed_mode, ledc_channel_t channel);
                                                    ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:185:62: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_pin(int gpio_num, ledc_mode_t speed_mode, ledc_channel_t ledc_channel);
                                                              ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:199:45: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_stop(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t idle_level);
                                             ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:244:61: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_duty_with_hpoint(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, uint32_t hpoint);
                                                             ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:255:45: error: 'ledc_channel_t' has not been declared
 int ledc_get_hpoint(ledc_mode_t speed_mode, ledc_channel_t channel);
                                             ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:274:49: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_duty(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty);
                                                 ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:286:48: error: 'ledc_channel_t' has not been declared
 uint32_t ledc_get_duty(ledc_mode_t speed_mode, ledc_channel_t channel);
                                                ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:305:49: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, ledc_duty_direction_t fade_direction,
                                                 ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:412:59: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t scale, uint32_t cycle_num);
                                                           ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:434:59: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade_with_time(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, int max_fade_time_ms);
                                                           ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:468:51: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_fade_start(ledc_mode_t speed_mode, ledc_channel_t channel, ledc_fade_mode_t fade_mode);
                                                   ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:481:60: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_duty_and_update(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, uint32_t hpoint);
                                                            ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:499:64: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade_time_and_start(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t max_fade_time_ms, ledc_fade_mode_t fade_mode);
                                                                ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:518:64: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade_step_and_start(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t scale, uint32_t cycle_num, ledc_fade_mode_t fade_mode);
                                                                ^
C:\Users\krist\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:520:1: error: expected declaration before '}' token
 }
 ^
Compilation error: Error: 2 UNKNOWN: exit status 1

Test Code:


// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "xxxxx"
#define BLYNK_DEVICE_NAME "xxxxxx"
#define PHOTOCLICK V5
#define LED 4
#define DOORUP V7
#define DOORDOWN V6
#define BLYNK_HEARTBEAT 30
#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

#include "BlynkEdgent.h"
#include "esp_camera.h"
#include <BlynkSimpleEsp32.h>
#include "Arduino.h"
#include <WiFi.h>
#include <WiFiClient.h> 
#include <ESP32_FTPClient.h>
#include "soc/soc.h"           // Disable brownout problems
#include "soc/rtc_cntl_reg.h"  // Disable brownout problems

WidgetLED led1(V1);
WidgetLED led2(V2);
WidgetLED led3(V3);
WidgetLED led4(V4);





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

  BlynkEdgent.begin();
}


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

Sorry, as one more additional add-on. This issue impacts Blynk 2.0 regardless of if you use Edgent, but the program will compile without Edgent, it will just never connect to the cloud. I have had a device connected with a simple example sketch, uploaded a working sketch on Blynk1.0, added in my template data and device name, it will upload the code successfully, connect to the internet but never connect to the Blynk server.

Was your previous code working with Blynk 1.0 ?
I feel there is conflict between the pins used. Cross check your pins used in the code and settings.h file. Try to compile with different ESP32 board selected (WROVER) and see if that works. And also see if the ESP32 core is updated / changed which was working with 1.0…. BTW you should be using the Blynk 2.0’s 1.x.x not beta versions.

Maybe posting your esp_camera.h code would be a good start, as without it the compiler messages mean nothing.

Pete.

Hi Madhukesh, code worked perfect with Blynk 1.0, no issues.

Here is functioning code on Blynk 1.0:


#define PHOTOCLICK V5
#define LED 4
#define DOORUP V7
#define DOORDOWN V6
#define BLYNK_HEARTBEAT 30
#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#include "esp_camera.h"
#include "Arduino.h"
#include <WiFi.h>
#include <WiFiClient.h> 
#include <ESP32_FTPClient.h>
#include "soc/soc.h"           // Disable brownout problems
#include "soc/rtc_cntl_reg.h"  // Disable brownout problems
#include <BlynkSimpleEsp32.h>
WidgetLED led1(V1);
WidgetLED led2(V2);
WidgetLED led3(V3);
WidgetLED led4(V4);


#define WIFI_SSID "xxxx"
#define WIFI_PASS "xxxx"
char auth[] = "xxxxxxxx";  //sent by Blynk 1.0


// Pin definition for CAMERA_MODEL_AI_THINKER
#define PWDN_GPIO_NUM     32
#define RESET_GPIO_NUM    -1
#define XCLK_GPIO_NUM      0
#define SIOD_GPIO_NUM     26
#define SIOC_GPIO_NUM     27

#define Y9_GPIO_NUM       35
#define Y8_GPIO_NUM       34
#define Y7_GPIO_NUM       39
#define Y6_GPIO_NUM       36
#define Y5_GPIO_NUM       21
#define Y4_GPIO_NUM       19
#define Y3_GPIO_NUM       18
#define Y2_GPIO_NUM        5
#define VSYNC_GPIO_NUM    25
#define HREF_GPIO_NUM     23
#define PCLK_GPIO_NUM     22


char ftp_server[] = "files.000webhost.com";
char ftp_user[] = "xxxxx";
char ftp_pass[] ="xxxxx";

bool takePhoto = false; 
bool loading = false;
String displayImage = "https://coopcommandimages.000webhostapp.com/uploads/1.png";
String coopImageURL = "https://coopcommandimages.000webhostapp.com/uploads/1.png";
String coopImage = "coopPic.jpg";
int i = 1;
int ic = 1;
int imageFlip = 1;
char coopRx; // Info received from CoopCommand
bool newDataRx = false; //has CoopCam received new data from CoopCommand


BlynkTimer timer;
// WidgetLCD lcd(V1);

// you can pass a FTP timeout and debbug mode on the last 2 arguments
ESP32_FTPClient ftp (ftp_server,ftp_user,ftp_pass, 5000, 2);

void setup()
{
 pinMode(LED, OUTPUT);
 timer.setInterval(1000,coopCom);
 timer.setInterval(250,loadingImage);
  Blynk.setProperty(V0, "url", 1, coopImageURL);
  Blynk.virtualWrite(V0, 1); 
  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
  
  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG; 
  
  if(psramFound()){
    config.frame_size = FRAMESIZE_SVGA; // FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA
    config.jpeg_quality = 20;
    config.fb_count = 2;
  } 
  else {
    config.frame_size = FRAMESIZE_VGA;
    config.jpeg_quality = 20;
    config.fb_count = 1;
  }
  
  // Init Camera
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
//    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }
  
  Serial.begin( 115200 );

  Blynk.begin(auth, WIFI_SSID, WIFI_PASS);
}

BLYNK_CONNECTED() {
    Blynk.syncAll();
}



void loadingImage( void ) {
      if (loading) {
      displayImage= "https://coopcommandimages.000webhostapp.com/uploads/";
      displayImage+= i;
      displayImage+= ".png";
      Blynk.setProperty(V0, "url", 1, displayImage); 
      if (i <= 6) {
      i ++;
      }
      else if (i > 6) {
        i = 1;
      }
      }
      else if (!loading) {
        if (ic == 1) {
        coopImageURL = "https://coopcommandimages.000webhostapp.com/uploads/coopPic2.jpg";
        }
        else if (ic == 2) {
        coopImageURL = "https://coopcommandimages.000webhostapp.com/uploads/coopPic3.jpg";
        }
        else if (ic == 3) {
          coopImageURL = "https://coopcommandimages.000webhostapp.com/uploads/coopPic4.jpg";
        }
        Blynk.setProperty(V0, "url", 1, coopImageURL);
        Blynk.virtualWrite(V0, 1);  
        i = 1;      
      }

}

 
void sendPhoto ( void ) {
   if (takePhoto) {

   camera_fb_t * fb = NULL;
  
  // Take Picture with Camera
  fb = esp_camera_fb_get(); 
  digitalWrite(LED, LOW); 
  delay (50);
  if(!fb) {
//    Serial.println("Camera capture failed");
    ESP.restart();
    return;
  }

if (imageFlip == 1) {
  ftp.OpenConnection();
  // Create the new file and send the image
  ftp.ChangeWorkDir("/public_html/uploads/");
  ftp.InitFile("Type I");
  ftp.NewFile("coopPic2.jpg");
  ftp.WriteData( fb->buf, fb->len );
  ftp.CloseFile();
  ftp.CloseConnection();
  takePhoto = false;
  imageFlip = 2;
  ic = 1;
  esp_camera_fb_return(fb);
    Serial.print('N');
   }
else if (imageFlip == 2) {
   ftp.OpenConnection();
  // Create the new file and send the image
  ftp.ChangeWorkDir("/public_html/uploads/");
  ftp.InitFile("Type I");
  ftp.NewFile("coopPic3.jpg");
  ftp.WriteData( fb->buf, fb->len );
  ftp.CloseFile();
  ftp.CloseConnection();
  takePhoto = false;
  imageFlip = 3;
  ic = 2;
  esp_camera_fb_return(fb);
  Serial.print('N');
   }
else if (imageFlip == 3) {
   ftp.OpenConnection();
  // Create the new file and send the image
  ftp.ChangeWorkDir("/public_html/uploads/");
  ftp.InitFile("Type I");
  ftp.NewFile("coopPic4.jpg");
  ftp.WriteData( fb->buf, fb->len );
  ftp.CloseFile();
  ftp.CloseConnection();
  takePhoto = false;
  imageFlip = 1;
  ic = 3;
  esp_camera_fb_return(fb);
  Serial.print('N');
   }
}
}

void coopCom ( void ) {

  if (Serial.available() > 0) {
    coopRx = Serial.read();
    newDataRx = true;
  }
  if (newDataRx == true) {
    if (coopRx == 'O') { //If CoopCommand says the door is up
      led1.on();
      led2.off();
      led3.off();
      led4.off();
      newDataRx = false;
    }
    if (coopRx == 'S') { //If CoopCommand says the door is down

      led1.off();
      led2.on();
      led3.off();
      led4.off();
      newDataRx = false;
    }
    if (coopRx == 'U') { //If CoopCommand says the door is opening
      led1.off();
      led2.off();
      led3.on();
      led4.off();
      newDataRx = false;
    }
    if (coopRx == 'D') { //If CoopCommand says the door is closing
      led1.off();
      led2.off();
      led3.off();
      led4.on();
      newDataRx = false;
    }
  }
}

BLYNK_WRITE(DOORUP) {
Serial.print('U');
}

BLYNK_WRITE(DOORDOWN) {
Serial.print('D');
}

BLYNK_WRITE(V5) {
digitalWrite(LED, HIGH);
Serial.print('L'); 
takePhoto = true;
loading = true;
loadingImage();
timer.setTimeout(250, sendPhoto);
timer.setTimeout(3000, []()
{
  loading = false;
  loadingImage();
});
}

void loop()
{
  Blynk.run();
  timer.run();
}

This compiles and works fine with no errors. However, if I add in a Blynk 2.0 template ID and device name along with a manual auth token for Blynk 2.0 it will not connect to the new server. It doesn’t give any compile errors, and the serial monitor shows Blynk cloud connection failure.

Hey Pete,
The camera code is directly from Espressif and included in the ESP32 library, I haven’t modified it at all and it works fine with Blynk 1.0:

Bare code:

// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
 * Example Use
 *
    static camera_config_t camera_example_config = {
        .pin_pwdn       = PIN_PWDN,
        .pin_reset      = PIN_RESET,
        .pin_xclk       = PIN_XCLK,
        .pin_sscb_sda   = PIN_SIOD,
        .pin_sscb_scl   = PIN_SIOC,
        .pin_d7         = PIN_D7,
        .pin_d6         = PIN_D6,
        .pin_d5         = PIN_D5,
        .pin_d4         = PIN_D4,
        .pin_d3         = PIN_D3,
        .pin_d2         = PIN_D2,
        .pin_d1         = PIN_D1,
        .pin_d0         = PIN_D0,
        .pin_vsync      = PIN_VSYNC,
        .pin_href       = PIN_HREF,
        .pin_pclk       = PIN_PCLK,
        .xclk_freq_hz   = 20000000,
        .ledc_timer     = LEDC_TIMER_0,
        .ledc_channel   = LEDC_CHANNEL_0,
        .pixel_format   = PIXFORMAT_JPEG,
        .frame_size     = FRAMESIZE_SVGA,
        .jpeg_quality   = 10,
        .fb_count       = 2,
        .grab_mode      = CAMERA_GRAB_WHEN_EMPTY
    };
    esp_err_t camera_example_init(){
        return esp_camera_init(&camera_example_config);
    }
    esp_err_t camera_example_capture(){
        //capture a frame
        camera_fb_t * fb = esp_camera_fb_get();
        if (!fb) {
            ESP_LOGE(TAG, "Frame buffer could not be acquired");
            return ESP_FAIL;
        }
        //replace this with your own function
        display_image(fb->width, fb->height, fb->pixformat, fb->buf, fb->len);
        //return the frame buffer back to be reused
        esp_camera_fb_return(fb);
        return ESP_OK;
    }
*/

#pragma once

#include "esp_err.h"
#include "driver/ledc.h"
#include "sensor.h"
#include "sys/time.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief Configuration structure for camera initialization
 */
typedef enum {
    CAMERA_GRAB_WHEN_EMPTY,         /*!< Fills buffers when they are empty. Less resources but first 'fb_count' frames might be old */
    CAMERA_GRAB_LATEST              /*!< Except when 1 frame buffer is used, queue will always contain the last 'fb_count' frames */
} camera_grab_mode_t;

/**
 * @brief Configuration structure for camera initialization
 */
typedef struct {
    int pin_pwdn;                   /*!< GPIO pin for camera power down line */
    int pin_reset;                  /*!< GPIO pin for camera reset line */
    int pin_xclk;                   /*!< GPIO pin for camera XCLK line */
    int pin_sscb_sda;               /*!< GPIO pin for camera SDA line */
    int pin_sscb_scl;               /*!< GPIO pin for camera SCL line */
    int pin_d7;                     /*!< GPIO pin for camera D7 line */
    int pin_d6;                     /*!< GPIO pin for camera D6 line */
    int pin_d5;                     /*!< GPIO pin for camera D5 line */
    int pin_d4;                     /*!< GPIO pin for camera D4 line */
    int pin_d3;                     /*!< GPIO pin for camera D3 line */
    int pin_d2;                     /*!< GPIO pin for camera D2 line */
    int pin_d1;                     /*!< GPIO pin for camera D1 line */
    int pin_d0;                     /*!< GPIO pin for camera D0 line */
    int pin_vsync;                  /*!< GPIO pin for camera VSYNC line */
    int pin_href;                   /*!< GPIO pin for camera HREF line */
    int pin_pclk;                   /*!< GPIO pin for camera PCLK line */

    int xclk_freq_hz;               /*!< Frequency of XCLK signal, in Hz. EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode */

    ledc_timer_t ledc_timer;        /*!< LEDC timer to be used for generating XCLK  */
    ledc_channel_t ledc_channel;    /*!< LEDC channel to be used for generating XCLK  */

    pixformat_t pixel_format;       /*!< Format of the pixel data: PIXFORMAT_ + YUV422|GRAYSCALE|RGB565|JPEG  */
    framesize_t frame_size;         /*!< Size of the output image: FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA  */

    int jpeg_quality;               /*!< Quality of JPEG output. 0-63 lower means higher quality  */
    size_t fb_count;                /*!< Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed)  */
    camera_grab_mode_t grab_mode;   /*!< When buffers should be filled */
} camera_config_t;

/**
 * @brief Data structure of camera frame buffer
 */
typedef struct {
    uint8_t * buf;              /*!< Pointer to the pixel data */
    size_t len;                 /*!< Length of the buffer in bytes */
    size_t width;               /*!< Width of the buffer in pixels */
    size_t height;              /*!< Height of the buffer in pixels */
    pixformat_t format;         /*!< Format of the pixel data */
    struct timeval timestamp;   /*!< Timestamp since boot of the first DMA buffer of the frame */
} camera_fb_t;

#define ESP_ERR_CAMERA_BASE 0x20000
#define ESP_ERR_CAMERA_NOT_DETECTED             (ESP_ERR_CAMERA_BASE + 1)
#define ESP_ERR_CAMERA_FAILED_TO_SET_FRAME_SIZE (ESP_ERR_CAMERA_BASE + 2)
#define ESP_ERR_CAMERA_FAILED_TO_SET_OUT_FORMAT (ESP_ERR_CAMERA_BASE + 3)
#define ESP_ERR_CAMERA_NOT_SUPPORTED            (ESP_ERR_CAMERA_BASE + 4)

/**
 * @brief Initialize the camera driver
 *
 * @note call camera_probe before calling this function
 *
 * This function detects and configures camera over I2C interface,
 * allocates framebuffer and DMA buffers,
 * initializes parallel I2S input, and sets up DMA descriptors.
 *
 * Currently this function can only be called once and there is
 * no way to de-initialize this module.
 *
 * @param config  Camera configuration parameters
 *
 * @return ESP_OK on success
 */
esp_err_t esp_camera_init(const camera_config_t* config);

/**
 * @brief Deinitialize the camera driver
 *
 * @return
 *      - ESP_OK on success
 *      - ESP_ERR_INVALID_STATE if the driver hasn't been initialized yet
 */
esp_err_t esp_camera_deinit();

/**
 * @brief Obtain pointer to a frame buffer.
 *
 * @return pointer to the frame buffer
 */
camera_fb_t* esp_camera_fb_get();

/**
 * @brief Return the frame buffer to be reused again.
 *
 * @param fb    Pointer to the frame buffer
 */
void esp_camera_fb_return(camera_fb_t * fb);

/**
 * @brief Get a pointer to the image sensor control structure
 *
 * @return pointer to the sensor
 */
sensor_t * esp_camera_sensor_get();

/**
 * @brief Save camera settings to non-volatile-storage (NVS)
 * 
 * @param key   A unique nvs key name for the camera settings 
 */
esp_err_t esp_camera_save_to_nvs(const char *key);

/**
 * @brief Load camera settings from non-volatile-storage (NVS)
 * 
 * @param key   A unique nvs key name for the camera settings 
 */
esp_err_t esp_camera_load_from_nvs(const char *key);

#ifdef __cplusplus
}
#endif

#include "img_converters.h"

Did you try reinstalling the Blynk lib ? I had same issues when i updated the Blynk lib. Later when i deleted the lib folder and installed a fresh copy !! The errors went away and started to work as it should. This may not be the route cause ! But i suspect this.

I’ll try again.
I re-installed the library once after it seemed to get itself messed up when I first started playing with Edgent and it wouldn’t even compile the example.

I’ll delete and re-add again and see if maybe that works.

Thanks!

Nope, definite conflict somewhere in there.
I’m at work right now, and put my code into a completely fresh install of the Arduino IDE with fresh installs of the Blynk library.
As a test, I compiled the Edgent example for ESP32, no errors, compiles fine.
Then, I added just the line

#include "esp_camera.h"

and it gives me these errors:

In file included from c:\Users\COREY~1.HOT\AppData\Local\Temp\.arduinoIDE-unsaved202167-13968-r5encq.i0jcs\Edgent_ESP32\BlynkEdgent.h:8:0,
                 from c:\Users\COREY~1.HOT\AppData\Local\Temp\.arduinoIDE-unsaved202167-13968-r5encq.i0jcs\Edgent_ESP32\Edgent_ESP32.ino:16:
c:\Users\COREY~1.HOT\AppData\Local\Temp\.arduinoIDE-unsaved202167-13968-r5encq.i0jcs\Edgent_ESP32\Settings.h:49:28: error: expected identifier before numeric constant
 #define LEDC_CHANNEL_1     1
                            ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:64:5: note: in expansion of macro 'LEDC_CHANNEL_1'
     LEDC_CHANNEL_1,     /*!< LEDC channel 1 */
     ^
c:\Users\COREY~1.HOT\AppData\Local\Temp\.arduinoIDE-unsaved202167-13968-r5encq.i0jcs\Edgent_ESP32\Settings.h:49:28: error: expected '}' before numeric constant
 #define LEDC_CHANNEL_1     1
                            ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:64:5: note: in expansion of macro 'LEDC_CHANNEL_1'
     LEDC_CHANNEL_1,     /*!< LEDC channel 1 */
     ^
c:\Users\COREY~1.HOT\AppData\Local\Temp\.arduinoIDE-unsaved202167-13968-r5encq.i0jcs\Edgent_ESP32\Settings.h:49:28: error: expected unqualified-id before numeric constant
 #define LEDC_CHANNEL_1     1
                            ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:64:5: note: in expansion of macro 'LEDC_CHANNEL_1'
     LEDC_CHANNEL_1,     /*!< LEDC channel 1 */
     ^
In file included from C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/esp32-camera/esp_camera.h:69:0,
                 from c:\Users\COREY~1.HOT\AppData\Local\Temp\.arduinoIDE-unsaved202167-13968-r5encq.i0jcs\Edgent_ESP32\Edgent_ESP32.ino:17:
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:72:3: error: 'ledc_channel_t' does not name a type
 } ledc_channel_t;
   ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:110:5: error: 'ledc_channel_t' does not name a type
     ledc_channel_t channel;         /*!< LEDC channel (0 - 7) */
     ^
In file included from C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/esp32-camera/esp_camera.h:69:0,
                 from c:\Users\COREY~1.HOT\AppData\Local\Temp\.arduinoIDE-unsaved202167-13968-r5encq.i0jcs\Edgent_ESP32\Edgent_ESP32.ino:17:
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:172:52: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_update_duty(ledc_mode_t speed_mode, ledc_channel_t channel);
                                                    ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:185:62: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_pin(int gpio_num, ledc_mode_t speed_mode, ledc_channel_t ledc_channel);
                                                              ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:199:45: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_stop(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t idle_level);
                                             ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:244:61: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_duty_with_hpoint(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, uint32_t hpoint);
                                                             ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:255:45: error: 'ledc_channel_t' has not been declared
 int ledc_get_hpoint(ledc_mode_t speed_mode, ledc_channel_t channel);
                                             ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:274:49: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_duty(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty);
                                                 ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:286:48: error: 'ledc_channel_t' has not been declared
 uint32_t ledc_get_duty(ledc_mode_t speed_mode, ledc_channel_t channel);
                                                ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:305:49: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, ledc_duty_direction_t fade_direction,
                                                 ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:412:59: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t scale, uint32_t cycle_num);
                                                           ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:434:59: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade_with_time(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, int max_fade_time_ms);
                                                           ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:468:51: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_fade_start(ledc_mode_t speed_mode, ledc_channel_t channel, ledc_fade_mode_t fade_mode);
                                                   ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:481:60: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_duty_and_update(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, uint32_t hpoint);
                                                            ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:499:64: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade_time_and_start(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t max_fade_time_ms, ledc_fade_mode_t fade_mode);
                                                                ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:518:64: error: 'ledc_channel_t' has not been declared
 esp_err_t ledc_set_fade_step_and_start(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t scale, uint32_t cycle_num, ledc_fade_mode_t fade_mode);
                                                                ^
C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/driver/driver/ledc.h:520:1: error: expected declaration before '}' token
 }
 ^
Multiple libraries were found for "WiFi.h"
 Used: C:\Users\Corey.HOTCHSDC\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
 Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
Compilation error: Error: 2 UNKNOWN: exit status 1

Can anyone else give it a try on their end and see if they can re-produce my error? This library works fine with Blynk 1.0, my entire program works fine and is stable. However, like I mention above, if I try and add this working program statically to Blynk2.0 by adding the required template and device data along with a Blynk2.0 auth token it will not connect to the Blynk server. Also, as seen above, the Edgent example will not compile if you have

#include "esp_camera.h"

in your program.