Is it possibly to use the ESP32 CAM and Blynk Edgent together?

I have quickly tried to get it to work but I got this loooong list of errors:

In file included from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\BlynkEdgent.h:8,
                 from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:43:
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h: In member function 'void BlynkWifi<Transport>::connectWiFi(const char*, const char*)':
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:67:9: error: 'WiFi' was not declared in this scope
   67 |         WiFi.mode(WIFI_STA);
      |         ^~~~
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:67:19: error: 'WIFI_STA' was not declared in this scope
   67 |         WiFi.mode(WIFI_STA);
      |                   ^~~~~~~~
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:67:19: note: the macro 'WIFI_STA' had not yet been defined
In file included from C:\Users\Asus ROG\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\libraries\WiFi\src/WiFi.h:32,
                 from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\OTA.h:2,
                 from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\BlynkEdgent.h:45:
C:\Users\Asus ROG\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\libraries\WiFi\src/WiFiType.h:34: note: it was later defined here
   34 | #define WIFI_STA    WIFI_MODE_STA
      | 
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:73:33: error: 'WL_CONNECTED' was not declared in this scope; did you mean 'BLYNK_CONNECTED'?
   73 |         while (WiFi.status() != WL_CONNECTED) {
      |                                 ^~~~~~~~~~~~
      |                                 BLYNK_CONNECTED
In file included from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\BlynkEdgent.h:43:
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In function 'String getWiFiMacAddress()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:147:10: error: 'WiFi' was not declared in this scope
  147 |   return WiFi.macAddress();
      |          ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In function 'String getWiFiApBSSID()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:152:10: error: 'WiFi' was not declared in this scope
  152 |   return WiFi.softAPmacAddress();
      |          ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In function 'String getWiFiNetworkSSID()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:157:10: error: 'WiFi' was not declared in this scope
  157 |   return WiFi.SSID();
      |          ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In function 'String getWiFiNetworkBSSID()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:162:10: error: 'WiFi' was not declared in this scope
  162 |   return WiFi.BSSIDstr();
      |          ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In function 'void enterConfigMode()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: error: 'WiFi' was not declared in this scope
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:13: error: 'WIFI_OFF' was not declared in this scope
  167 |   WiFi.mode(WIFI_OFF);
      |             ^~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:13: note: the macro 'WIFI_OFF' had not yet been defined
C:\Users\Asus ROG\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\libraries\WiFi\src/WiFiType.h:33: note: it was later defined here
   33 | #define WIFI_OFF    WIFI_MODE_NULL
      | 
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:169:13: error: 'WIFI_AP' was not declared in this scope
  169 |   WiFi.mode(WIFI_AP);
      |             ^~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:169:13: note: the macro 'WIFI_AP' had not yet been defined
C:\Users\Asus ROG\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\libraries\WiFi\src/WiFiType.h:35: note: it was later defined here
   35 | #define WIFI_AP     WIFI_MODE_AP
      | 
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In lambda function:
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:332:21: error: 'WiFi' is not captured
  332 |     int wifi_nets = WiFi.scanNetworks(true, true);
      |                     ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:338:19: error: 'WiFi' is not captured
  338 |       wifi_nets = WiFi.scanComplete();
      |                   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:350:15: error: 'WiFi' is not captured
  350 |           if (WiFi.RSSI(indices[j]) > WiFi.RSSI(indices[i])) {
      |               ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:350:39: error: 'WiFi' is not captured
  350 |           if (WiFi.RSSI(indices[j]) > WiFi.RSSI(indices[i])) {
      |                                       ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:367:11: error: 'WiFi' is not captured
  367 |           WiFi.SSID(id).c_str(),
      |           ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:368:11: error: 'WiFi' is not captured
  368 |           WiFi.BSSIDstr(id).c_str(),
      |           ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:369:11: error: 'WiFi' is not captured
  369 |           WiFi.RSSI(id),
      |           ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:370:24: error: 'WiFi' is not captured
  370 |           wifiSecToStr(WiFi.encryptionType(id)),
      |                        ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:371:11: error: 'WiFi' is not captured
  371 |           WiFi.channel(id)
      |           ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:377:7: error: 'WiFi' is not captured
  377 |       WiFi.scanDelete();
      |       ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:330:33: note: the lambda has no capture-default
  330 |   server.on("/wifi_scan.json", []() {
      |                                 ^
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:167:3: note: '<typeprefixerror>WiFi' declared here
  167 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In function 'void enterConnectNet()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:417:3: error: 'WiFi' was not declared in this scope
  417 |   WiFi.enableSTA(false);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:440:54: error: 'WL_CONNECTED' was not declared in this scope; did you mean 'BLYNK_CONNECTED'?
  440 |   while ((timeoutMs > millis()) && (WiFi.status() != WL_CONNECTED))
      |                                                      ^~~~~~~~~~~~
      |                                                      BLYNK_CONNECTED
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:451:24: error: 'WL_CONNECTED' was not declared in this scope; did you mean 'BLYNK_CONNECTED'?
  451 |   if (WiFi.status() == WL_CONNECTED) {
      |                        ^~~~~~~~~~~~
      |                        BLYNK_CONNECTED
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In function 'void enterConnectCloud()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:475:10: error: 'WiFi' was not declared in this scope
  475 |         (WiFi.status() == WL_CONNECTED) &&
      |          ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:475:27: error: 'WL_CONNECTED' was not declared in this scope; did you mean 'BLYNK_CONNECTED'?
  475 |         (WiFi.status() == WL_CONNECTED) &&
      |                           ^~~~~~~~~~~~
      |                           BLYNK_CONNECTED
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:495:14: error: 'WiFi' was not declared in this scope
  495 |   } else if (WiFi.status() != WL_CONNECTED) {
      |              ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:495:31: error: 'WL_CONNECTED' was not declared in this scope; did you mean 'BLYNK_CONNECTED'?
  495 |   } else if (WiFi.status() != WL_CONNECTED) {
      |                               ^~~~~~~~~~~~
      |                               BLYNK_CONNECTED
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h: In function 'void enterSwitchToSTA()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:520:3: error: 'WiFi' was not declared in this scope
  520 |   WiFi.mode(WIFI_OFF);
      |   ^~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:520:13: error: 'WIFI_OFF' was not declared in this scope
  520 |   WiFi.mode(WIFI_OFF);
      |             ^~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:520:13: note: the macro 'WIFI_OFF' had not yet been defined
C:\Users\Asus ROG\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\libraries\WiFi\src/WiFiType.h:33: note: it was later defined here
   33 | #define WIFI_OFF    WIFI_MODE_NULL
      | 
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:522:13: error: 'WIFI_STA' was not declared in this scope
  522 |   WiFi.mode(WIFI_STA);
      |             ^~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\ConfigMode.h:522:13: note: the macro 'WIFI_STA' had not yet been defined
C:\Users\Asus ROG\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\libraries\WiFi\src/WiFiType.h:34: note: it was later defined here
   34 | #define WIFI_STA    WIFI_MODE_STA
      | 
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino: In function 'void setup()':
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:57:19: error: 'Y2_GPIO_NUM' was not declared in this scope
   57 |   config.pin_d0 = Y2_GPIO_NUM;
      |                   ^~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:58:19: error: 'Y3_GPIO_NUM' was not declared in this scope
   58 |   config.pin_d1 = Y3_GPIO_NUM;
      |                   ^~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:59:19: error: 'Y4_GPIO_NUM' was not declared in this scope
   59 |   config.pin_d2 = Y4_GPIO_NUM;
      |                   ^~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:60:19: error: 'Y5_GPIO_NUM' was not declared in this scope
   60 |   config.pin_d3 = Y5_GPIO_NUM;
      |                   ^~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:61:19: error: 'Y6_GPIO_NUM' was not declared in this scope
   61 |   config.pin_d4 = Y6_GPIO_NUM;
      |                   ^~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:62:19: error: 'Y7_GPIO_NUM' was not declared in this scope
   62 |   config.pin_d5 = Y7_GPIO_NUM;
      |                   ^~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:63:19: error: 'Y8_GPIO_NUM' was not declared in this scope
   63 |   config.pin_d6 = Y8_GPIO_NUM;
      |                   ^~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:64:19: error: 'Y9_GPIO_NUM' was not declared in this scope
   64 |   config.pin_d7 = Y9_GPIO_NUM;
      |                   ^~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:65:21: error: 'XCLK_GPIO_NUM' was not declared in this scope
   65 |   config.pin_xclk = XCLK_GPIO_NUM;
      |                     ^~~~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:66:21: error: 'PCLK_GPIO_NUM' was not declared in this scope
   66 |   config.pin_pclk = PCLK_GPIO_NUM;
      |                     ^~~~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:67:22: error: 'VSYNC_GPIO_NUM' was not declared in this scope
   67 |   config.pin_vsync = VSYNC_GPIO_NUM;
      |                      ^~~~~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:68:21: error: 'HREF_GPIO_NUM' was not declared in this scope
   68 |   config.pin_href = HREF_GPIO_NUM;
      |                     ^~~~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:69:25: error: 'SIOD_GPIO_NUM' was not declared in this scope
   69 |   config.pin_sscb_sda = SIOD_GPIO_NUM;
      |                         ^~~~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:70:25: error: 'SIOC_GPIO_NUM' was not declared in this scope; did you mean 'SOC_I2C_NUM'?
   70 |   config.pin_sscb_scl = SIOC_GPIO_NUM;
      |                         ^~~~~~~~~~~~~
      |                         SOC_I2C_NUM
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:71:21: error: 'PWDN_GPIO_NUM' was not declared in this scope
   71 |   config.pin_pwdn = PWDN_GPIO_NUM;
      |                     ^~~~~~~~~~~~~
C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202456-24400-1xfh1wx.dcdf\Edgent_ESP32\Edgent_ESP32.ino:72:22: error: 'RESET_GPIO_NUM' was not declared in this scope
   72 |   config.pin_reset = RESET_GPIO_NUM;
      |                      ^~~~~~~~~~~~~~

exit status 1

Compilation error: 'WiFi' was not declared in this scope

Here is my sketch:


/* Fill in information from your Blynk Template here */
/* Read more: https://bit.ly/BlynkInject */
#define BLYNK_TEMPLATE_ID           "TMPL5s-dGSebs"
#define BLYNK_TEMPLATE_NAME         "Webcam"

#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_ESP32_DEV_MODULE
//#define USE_ESP32C3_DEV_MODULE
//#define USE_ESP32S2_DEV_KIT
#define USE_WROVER_BOARD
//#define USE_TTGO_T7
//#define USE_TTGO_T_OI

#include "BlynkEdgent.h"
#include "esp_camera.h"

// Opsætning af kameraet
camera_config_t config;

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

  // Initialiser kameraet
  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;

  // Initialiser kameraet med konfigurationen
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Kamera initialiseringsfejl med fejlkode 0x%x", err);
    return;
  }

  // Start BlynkEdgent
  BlynkEdgent.begin();
}

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

I have tested with the ESP CameraWebServer sketch first to make sure I could get the camera working, and it did succeed.

My plan is to have a video livestream of plants and hooking up a soil moister sensor and a DHT11 sensor.

I already got a working project with a “normal” ESP32 with the sensors mentioned above. Not I just want to move it to an ESP32 CAM and use the camera at the same time.

It might not be necessary to get the video stream working on the internet, locally would be fine, but having it online would be best.
The sensors however should still be working online.

I have access to my router, so port forwarding is possible if its necessary.

The error message you’re receive is is caused by ESP32 core v 3.x.x

The v3 version of the core now requires your sketch to contain:
#include <WiFi.h>
as well as #include <WiFiClient.h>

Previously, just having #include <WiFi.h> was sufficient, but now both are required.

The url for your video stream needs to be publicly resolvable for the Blynk app to be able to display it, so if you don’t have a static public IP address then you’ll need to use a DDNS service and run a DDNS updater on your local network, as well as opening the appropriate ports on your router and forwarding the inbound traffic to your ESP32CAM (which will need a static local IP address).

Pete.

Is that it? Nothing else I need to change?

Sounds bit like a hassle.

Could I combine the BlynkEdgent sketch and ESP CameraWebServer sketch so I just use Blynk with the sensors and when I’m home I just use my web browser to access the Webcam through it’s local IP address or would it give conflicts?

As I said, that’s the cause of the compiler error.

It won’t “give conflicts” it just won’t work unless the video stream is publicly resolvable. It doesn’t matter if your phone/tablet is connected to the same network as your ESP32, the app won’t be able to resolve the stream.

Pete.

I think you misunderstood.
So the sensors work with blynk as normal.

Then when I get home I connect to my WiFi, open my webbrowser, type 192.168.1.5 which is the esp32 ipadress to see the stream.

So it would work like two devices by running both the blynk sketch and the CameraWebServer sketch.

Because if I should be able to access it externally I should go to my router, find port forwarding, make a new rule, type 192.168.1.5 for the device, set it to TCP, use something like port 80.

Then I should be able to access it by typing something like http://11.222.333.4:80/

Am I completely wrong?

I assumed that you were talking about viewing the video stream in Blynk, via the video streaming widget.

If you’re wanting to run Blynk and a webserver on the same device then I’d probably avoid using the Blynk Edgent example.

Pete.

Yeah.
But now that I’m looking into it, it doesn’t seem that intimidating to set up to get the blynk video widget working.

Okay I tried added the two “includes” and I still get the same error. Also I don’t understand why that should fix all the GPIO errors I also have?

You don’t need to add two #includes as one is there already.
Where you add #include <WiFi.h> is important.

Pete.

okay I added only #include <WiFi.h>.

now I have this error:

In file included from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202457-12084-1dptpo3.lkmv\Edgent_ESP32\BlynkEdgent.h:8,
                 from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202457-12084-1dptpo3.lkmv\Edgent_ESP32\Edgent_ESP32.ino:42:
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h: In member function 'void BlynkWifi<Transport>::connectWiFi(const char*, const char*)':
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:67:9: error: 'WiFi' was not declared in this scope
   67 |         WiFi.mode(WIFI_STA);
      |         ^~~~
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:67:19: error: 'WIFI_STA' was not declared in this scope
   67 |         WiFi.mode(WIFI_STA);
      |                   ^~~~~~~~
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:67:19: note: the macro 'WIFI_STA' had not yet been defined
In file included from C:\Users\Asus ROG\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\libraries\WiFi\src/WiFi.h:32,
                 from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202457-12084-1dptpo3.lkmv\Edgent_ESP32\ConfigMode.h:1,
                 from C:\Users\Asus ROG\AppData\Local\Temp\.arduinoIDE-unsaved202457-12084-1dptpo3.lkmv\Edgent_ESP32\BlynkEdgent.h:43:
C:\Users\Asus ROG\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.1\libraries\WiFi\src/WiFiType.h:34: note: it was later defined here
   34 | #define WIFI_STA    WIFI_MODE_STA
      | 
c:\Users\Asus ROG\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:73:33: error: 'WL_CONNECTED' was not declared in this scope; did you mean 'BLYNK_CONNECTED'?
   73 |         while (WiFi.status() != WL_CONNECTED) {
      |                                 ^~~~~~~~~~~~
      |                                 BLYNK_CONNECTED

exit status 1

Compilation error: exit status 1

To be 100% clear, your Edgent sketch ALREADY contained #include <WiFiClient.h> and you needed to add #include <WiFi.h> next to it.

Making a post that says “I added it” without saying WHERE you added it is of no use whatsoever when it comes to helping you resolve the problem.

You need to post your updated ConfigMode.h file if you want assistance with this issue.

Pete.

I added it above the line with #include <WiFiClient.h>

In the ConfigMode.h

If I roll back the ESP core version to before 3.0 it works fine without needed to add anything to the example sketch.

Okay if we skip that part for a moment. I got it working by rolling back to an early version.

I have a hard time understanding how to get the cam and BlynkEdgent sketch to work simultaneously.
Because when I first to copy paste the different elements from the CameraWebServer sketch into the BlynkEdgent sketch and adding the different “.h” files I just ending up with a sketch that is too big error.

So instead of having the whole CameraWebServer sketch merged into the blynk sketch, I want the absolute bare minimum to get a stream from the camera.

What functionality are you looking for with Blynk other than viewing the video stream via the Blynk video streaming widget?

The simplest solution is to have no Blynk code running on your ESP32 CAM at all, and configure it to provide a suitable video stream on the port of your choice.
Open the necessary ports and do the necessary port forwarding, and configure a DDNS service if needed, then point your Blynk widget at the video streams url.

Pete.

My wish is to use the ESB32 CAM as a weather station which also monitors soil humidity.
The reason I want to use BlynkEdgent is because I might need to change some values later on because its going to control a irrigation system, so its nice to have blynk Air available.
The camera is going to be used to monitor the progress and if the test is successful then use it to monitor if there is bugs in the flower.

I’d recommend getting one part working at a time before trying to combine everything into one sketch.

Pete.

Yeah I try to shave down the camera sketch. The blynk sketch is already working, so its just the camera.

I meant that I’d get a non-Blynk video sketch working, to stream the video to the Blynk video streaming widget.

Pete.

Okay after a lot of research and failed attempts I the camera plus “normal” blynk working:


 //Board: AI-Thinker ESP32-CAM



char auth[] = BLYNK_AUTH_TOKEN;
const char* ssid = "****";
const char* password = "****";

#define BLYNK_TEMPLATE_ID "TMPL5s-dGSebs"
#define BLYNK_TEMPLATE_NAME "Webcam"
#define BLYNK_AUTH_TOKEN "lXuIlcR_gSDyWSdg4KO8FRF9huqjVlWv"

#define BLYNK_PRINT Serial


#include <WiFi.h>
#include <WebServer.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>



#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



#ifndef OV2640_H_
#define OV2640_H_

#include <Arduino.h>
#include <pgmspace.h>
#include <stdio.h>
#include "esp_log.h"
#include "esp_attr.h"
#include "esp_camera.h"

extern camera_config_t esp32cam_config, esp32cam_aithinker_config, esp32cam_ttgo_t_config;

class OV2640
{
public:
    OV2640(){
        fb = NULL;
    };
    ~OV2640(){
    };
    esp_err_t init(camera_config_t config);
    void run(void);
    size_t getSize(void);
    uint8_t *getfb(void);
    int getWidth(void);
    int getHeight(void);
    framesize_t getFrameSize(void);
    pixformat_t getPixelFormat(void);

    void setFrameSize(framesize_t size);
    void setPixelFormat(pixformat_t format);

private:
    void runIfNeeded(); // grab a frame if we don't already have one

    // camera_framesize_t _frame_size;
    // camera_pixelformat_t _pixel_format;
    camera_config_t _cam_config;

    camera_fb_t *fb;
};

#endif //OV2640_H_


#define TAG "OV2640"

// definitions appropriate for the ESP32-CAM devboard (and most clones)
camera_config_t esp32cam_config{

    .pin_pwdn = -1, // FIXME: on the TTGO T-Journal I think this is GPIO 0
    .pin_reset = 15,

    .pin_xclk = 27,

    .pin_sscb_sda = 25,
    .pin_sscb_scl = 23,

    .pin_d7 = 19,
    .pin_d6 = 36,
    .pin_d5 = 18,
    .pin_d4 = 39,
    .pin_d3 = 5,
    .pin_d2 = 34,
    .pin_d1 = 35,
    .pin_d0 = 17,
    .pin_vsync = 22,
    .pin_href = 26,
    .pin_pclk = 21,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_0,
    .ledc_channel = LEDC_CHANNEL_0,
    .pixel_format = PIXFORMAT_JPEG,
    // .frame_size = FRAMESIZE_UXGA, // needs 234K of framebuffer space
    // .frame_size = FRAMESIZE_SXGA, // needs 160K for framebuffer
    // .frame_size = FRAMESIZE_XGA, // needs 96K or even smaller FRAMESIZE_SVGA - can work if using only 1 fb
    .frame_size = FRAMESIZE_SVGA,
    .jpeg_quality = 12, //0-63 lower numbers are higher quality
    .fb_count = 2       // if more than one i2s runs in continous mode.  Use only with jpeg
};

camera_config_t esp32cam_aithinker_config{

    .pin_pwdn = 32,
    .pin_reset = -1,

    .pin_xclk = 0,

    .pin_sscb_sda = 26,
    .pin_sscb_scl = 27,

    // Note: LED GPIO is apparently 4 not sure where that goes
    // per https://github.com/donny681/ESP32_CAMERA_QR/blob/e4ef44549876457cd841f33a0892c82a71f35358/main/led.c
    .pin_d7 = 35,
    .pin_d6 = 34,
    .pin_d5 = 39,
    .pin_d4 = 36,
    .pin_d3 = 21,
    .pin_d2 = 19,
    .pin_d1 = 18,
    .pin_d0 = 5,
    .pin_vsync = 25,
    .pin_href = 23,
    .pin_pclk = 22,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_1,
    .ledc_channel = LEDC_CHANNEL_1,
    .pixel_format = PIXFORMAT_JPEG,
    // .frame_size = FRAMESIZE_UXGA, // needs 234K of framebuffer space
    // .frame_size = FRAMESIZE_SXGA, // needs 160K for framebuffer
    // .frame_size = FRAMESIZE_XGA, // needs 96K or even smaller FRAMESIZE_SVGA - can work if using only 1 fb
    .frame_size = FRAMESIZE_SVGA,
    .jpeg_quality = 12, //0-63 lower numbers are higher quality
    .fb_count = 2       // if more than one i2s runs in continous mode.  Use only with jpeg
};

camera_config_t esp32cam_ttgo_t_config{

    .pin_pwdn = 26,
    .pin_reset = -1,

    .pin_xclk = 32,

    .pin_sscb_sda = 13,
    .pin_sscb_scl = 12,

    .pin_d7 = 39,
    .pin_d6 = 36,
    .pin_d5 = 23,
    .pin_d4 = 18,
    .pin_d3 = 15,
    .pin_d2 = 4,
    .pin_d1 = 14,
    .pin_d0 = 5,
    .pin_vsync = 27,
    .pin_href = 25,
    .pin_pclk = 19,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_0,
    .ledc_channel = LEDC_CHANNEL_0,
    .pixel_format = PIXFORMAT_JPEG,
    .frame_size = FRAMESIZE_SVGA,
    .jpeg_quality = 12, //0-63 lower numbers are higher quality
    .fb_count = 2       // if more than one i2s runs in continous mode.  Use only with jpeg
};

void OV2640::run(void)
{
    if (fb)
        //return the frame buffer back to the driver for reuse
        esp_camera_fb_return(fb);

    fb = esp_camera_fb_get();
}

void OV2640::runIfNeeded(void)
{
    if (!fb)
        run();
}

int OV2640::getWidth(void)
{
    runIfNeeded();
    return fb->width;
}

int OV2640::getHeight(void)
{
    runIfNeeded();
    return fb->height;
}

size_t OV2640::getSize(void)
{
    runIfNeeded();
    if (!fb)
        return 0; // FIXME - this shouldn't be possible but apparently the new cam board returns null sometimes?
    return fb->len;
}

uint8_t *OV2640::getfb(void)
{
    runIfNeeded();
    if (!fb)
        return NULL; // FIXME - this shouldn't be possible but apparently the new cam board returns null sometimes?

    return fb->buf;
}

framesize_t OV2640::getFrameSize(void)
{
    return _cam_config.frame_size;
}

void OV2640::setFrameSize(framesize_t size)
{
    _cam_config.frame_size = size;
}

pixformat_t OV2640::getPixelFormat(void)
{
    return _cam_config.pixel_format;
}

void OV2640::setPixelFormat(pixformat_t format)
{
    switch (format)
    {
    case PIXFORMAT_RGB565:
    case PIXFORMAT_YUV422:
    case PIXFORMAT_GRAYSCALE:
    case PIXFORMAT_JPEG:
        _cam_config.pixel_format = format;
        break;
    default:
        _cam_config.pixel_format = PIXFORMAT_GRAYSCALE;
        break;
    }
}

esp_err_t OV2640::init(camera_config_t config)
{
    memset(&_cam_config, 0, sizeof(_cam_config));
    memcpy(&_cam_config, &config, sizeof(config));

    esp_err_t err = esp_camera_init(&_cam_config);
    if (err != ESP_OK)
    {
        printf("Camera probe failed with error 0x%x", err);
        return err;
    }
    // ESP_ERROR_CHECK(gpio_install_isr_service(0));

    return ESP_OK;
}


/*
Next one is an include with wifi credentials.
This is what you need to do:

1. Create a file called "home_wifi_multi.h" in the same folder   OR   under a separate subfolder of the "libraries" folder of Arduino IDE. (You are creating a "fake" library really - I called it "MySettings"). 
2. Place the following text in the file:
#define SSID1 "replace with your wifi ssid"
#define PWD1 "replace your wifi password"
3. Save.

Should work then
*/
//#include "home_wifi_multi.h"

OV2640 cam;

WebServer server(80);

const char HEADER[] = "HTTP/1.1 200 OK\r\n" \
                      "Access-Control-Allow-Origin: *\r\n" \
                      "Content-Type: multipart/x-mixed-replace; boundary=123456789000000000000987654321\r\n";
const char BOUNDARY[] = "\r\n--123456789000000000000987654321\r\n";
const char CTNTTYPE[] = "Content-Type: image/jpeg\r\nContent-Length: ";
const int hdrLen = strlen(HEADER);
const int bdrLen = strlen(BOUNDARY);
const int cntLen = strlen(CTNTTYPE);

void handle_jpg_stream(void)
{
  char buf[32];
  int s;

  WiFiClient client = server.client();

  client.write(HEADER, hdrLen);
  client.write(BOUNDARY, bdrLen);

  while (true)
  {
    if (!client.connected()) break;
    cam.run();
    s = cam.getSize();
    client.write(CTNTTYPE, cntLen);
    sprintf( buf, "%d\r\n\r\n", s );
    client.write(buf, strlen(buf));
    client.write((char *)cam.getfb(), s);
    client.write(BOUNDARY, bdrLen);
  }
}

const char JHEADER[] = "HTTP/1.1 200 OK\r\n" \
                       "Content-disposition: inline; filename=capture.jpg\r\n" \
                       "Content-type: image/jpeg\r\n\r\n";
const int jhdLen = strlen(JHEADER);

void handle_jpg(void)
{
  WiFiClient client = server.client();

  cam.run();
  if (!client.connected()) return;

  client.write(JHEADER, jhdLen);
  client.write((char *)cam.getfb(), cam.getSize());
}

void handleNotFound()
{
  String message = "Server is running!\n\n";
  message += "URI: ";
  message += server.uri();
  message += "\nMethod: ";
  message += (server.method() == HTTP_GET) ? "GET" : "POST";
  message += "\nArguments: ";
  message += server.args();
  message += "\n";
  server.send(200, "text / plain", message);
}

void setup()
{

  Serial.begin(115200);
  //while (!Serial);            //wait for serial connection.

  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;

  // Frame parameters
  //  config.frame_size = FRAMESIZE_UXGA;
  config.frame_size = FRAMESIZE_QVGA;
  config.jpeg_quality = 12;
  config.fb_count = 2;

#if defined(CAMERA_MODEL_ESP_EYE)
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
#endif

  cam.init(config);

  IPAddress ip;

  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(F("."));
  }
  ip = WiFi.localIP();
  Serial.println(F("WiFi connected"));
  Serial.println("");
    // Configure Blynk
  Blynk.config(auth);
  Serial.println("Connecting to Blynk");
  while (Blynk.connect() == false) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nConnected to Blynk");

  
  Serial.println(ip);
  Serial.print("Stream Link: http://");
  Serial.print(ip);
  Serial.println("/mjpeg/1");
  server.on("/mjpeg/1", HTTP_GET, handle_jpg_stream);
  server.on("/jpg", HTTP_GET, handle_jpg);
  server.onNotFound(handleNotFound);
  server.begin();
}

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

|
|
|
|
|
|
|
|
Now I want to make it work with Blynk Edgent, but until now it has failed. I have at least mannaged to get it compile and upload, but the ESP32 will get stuck in a bootloop.

#include "BlynkEdgent.h"
#include <WiFi.h>
#include <WebServer.h>
#include <WiFiClient.h>
//#include <BlynkSimpleEsp32.h>

#define BLYNK_TEMPLATE_ID "TMPL5s-dGSebs"
#define BLYNK_TEMPLATE_NAME "Webcam"

#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



#ifndef OV2640_H_
#define OV2640_H_

#include <Arduino.h>
#include <pgmspace.h>
#include <stdio.h>
#include "esp_log.h"
#include "esp_attr.h"
#include "esp_camera.h"

extern camera_config_t esp32cam_config, esp32cam_aithinker_config, esp32cam_ttgo_t_config;

class OV2640
{
public:
    OV2640(){
        fb = NULL;
    };
    ~OV2640(){
    };
    esp_err_t init(camera_config_t config);
    void run(void);
    size_t getSize(void);
    uint8_t *getfb(void);
    int getWidth(void);
    int getHeight(void);
    framesize_t getFrameSize(void);
    pixformat_t getPixelFormat(void);

    void setFrameSize(framesize_t size);
    void setPixelFormat(pixformat_t format);

private:
    void runIfNeeded(); // grab a frame if we don't already have one

    // camera_framesize_t _frame_size;
    // camera_pixelformat_t _pixel_format;
    camera_config_t _cam_config;

    camera_fb_t *fb;
};

#endif //OV2640_H_


#define TAG "OV2640"

// definitions appropriate for the ESP32-CAM devboard (and most clones)
camera_config_t esp32cam_config{

    .pin_pwdn = -1, // FIXME: on the TTGO T-Journal I think this is GPIO 0
    .pin_reset = 15,

    .pin_xclk = 27,

    .pin_sscb_sda = 25,
    .pin_sscb_scl = 23,

    .pin_d7 = 19,
    .pin_d6 = 36,
    .pin_d5 = 18,
    .pin_d4 = 39,
    .pin_d3 = 5,
    .pin_d2 = 34,
    .pin_d1 = 35,
    .pin_d0 = 17,
    .pin_vsync = 22,
    .pin_href = 26,
    .pin_pclk = 21,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_0,
    .ledc_channel = LEDC_CHANNEL_0,
    .pixel_format = PIXFORMAT_JPEG,
    // .frame_size = FRAMESIZE_UXGA, // needs 234K of framebuffer space
    // .frame_size = FRAMESIZE_SXGA, // needs 160K for framebuffer
    // .frame_size = FRAMESIZE_XGA, // needs 96K or even smaller FRAMESIZE_SVGA - can work if using only 1 fb
    .frame_size = FRAMESIZE_SVGA,
    .jpeg_quality = 12, //0-63 lower numbers are higher quality
    .fb_count = 2       // if more than one i2s runs in continous mode.  Use only with jpeg
};

camera_config_t esp32cam_aithinker_config{

    .pin_pwdn = 32,
    .pin_reset = -1,

    .pin_xclk = 0,

    .pin_sscb_sda = 26,
    .pin_sscb_scl = 27,

    // Note: LED GPIO is apparently 4 not sure where that goes
    // per https://github.com/donny681/ESP32_CAMERA_QR/blob/e4ef44549876457cd841f33a0892c82a71f35358/main/led.c
    .pin_d7 = 35,
    .pin_d6 = 34,
    .pin_d5 = 39,
    .pin_d4 = 36,
    .pin_d3 = 21,
    .pin_d2 = 19,
    .pin_d1 = 18,
    .pin_d0 = 5,
    .pin_vsync = 25,
    .pin_href = 23,
    .pin_pclk = 22,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_1,
    .ledc_channel = LEDC_CHANNEL_1,
    .pixel_format = PIXFORMAT_JPEG,
    // .frame_size = FRAMESIZE_UXGA, // needs 234K of framebuffer space
    // .frame_size = FRAMESIZE_SXGA, // needs 160K for framebuffer
    // .frame_size = FRAMESIZE_XGA, // needs 96K or even smaller FRAMESIZE_SVGA - can work if using only 1 fb
    .frame_size = FRAMESIZE_SVGA,
    .jpeg_quality = 12, //0-63 lower numbers are higher quality
    .fb_count = 2       // if more than one i2s runs in continous mode.  Use only with jpeg
};

camera_config_t esp32cam_ttgo_t_config{

    .pin_pwdn = 26,
    .pin_reset = -1,

    .pin_xclk = 32,

    .pin_sscb_sda = 13,
    .pin_sscb_scl = 12,

    .pin_d7 = 39,
    .pin_d6 = 36,
    .pin_d5 = 23,
    .pin_d4 = 18,
    .pin_d3 = 15,
    .pin_d2 = 4,
    .pin_d1 = 14,
    .pin_d0 = 5,
    .pin_vsync = 27,
    .pin_href = 25,
    .pin_pclk = 19,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_0,
    .ledc_channel = LEDC_CHANNEL_0,
    .pixel_format = PIXFORMAT_JPEG,
    .frame_size = FRAMESIZE_SVGA,
    .jpeg_quality = 12, //0-63 lower numbers are higher quality
    .fb_count = 2       // if more than one i2s runs in continous mode.  Use only with jpeg
};

void OV2640::run(void)
{
    if (fb)
        //return the frame buffer back to the driver for reuse
        esp_camera_fb_return(fb);

    fb = esp_camera_fb_get();
}

void OV2640::runIfNeeded(void)
{
    if (!fb)
        run();
}

int OV2640::getWidth(void)
{
    runIfNeeded();
    return fb->width;
}

int OV2640::getHeight(void)
{
    runIfNeeded();
    return fb->height;
}

size_t OV2640::getSize(void)
{
    runIfNeeded();
    if (!fb)
        return 0; // FIXME - this shouldn't be possible but apparently the new cam board returns null sometimes?
    return fb->len;
}

uint8_t *OV2640::getfb(void)
{
    runIfNeeded();
    if (!fb)
        return NULL; // FIXME - this shouldn't be possible but apparently the new cam board returns null sometimes?

    return fb->buf;
}

framesize_t OV2640::getFrameSize(void)
{
    return _cam_config.frame_size;
}

void OV2640::setFrameSize(framesize_t size)
{
    _cam_config.frame_size = size;
}

pixformat_t OV2640::getPixelFormat(void)
{
    return _cam_config.pixel_format;
}

void OV2640::setPixelFormat(pixformat_t format)
{
    switch (format)
    {
    case PIXFORMAT_RGB565:
    case PIXFORMAT_YUV422:
    case PIXFORMAT_GRAYSCALE:
    case PIXFORMAT_JPEG:
        _cam_config.pixel_format = format;
        break;
    default:
        _cam_config.pixel_format = PIXFORMAT_GRAYSCALE;
        break;
    }
}

esp_err_t OV2640::init(camera_config_t config)
{
    memset(&_cam_config, 0, sizeof(_cam_config));
    memcpy(&_cam_config, &config, sizeof(config));

    esp_err_t err = esp_camera_init(&_cam_config);
    if (err != ESP_OK)
    {
        printf("Camera probe failed with error 0x%x", err);
        return err;
    }
    // ESP_ERROR_CHECK(gpio_install_isr_service(0));

    return ESP_OK;
}


OV2640 cam;

//WebServer server(80);

const char HEADER[] = "HTTP/1.1 200 OK\r\n" \
                      "Access-Control-Allow-Origin: *\r\n" \
                      "Content-Type: multipart/x-mixed-replace; boundary=123456789000000000000987654321\r\n";
const char BOUNDARY[] = "\r\n--123456789000000000000987654321\r\n";
const char CTNTTYPE[] = "Content-Type: image/jpeg\r\nContent-Length: ";
const int hdrLen = strlen(HEADER);
const int bdrLen = strlen(BOUNDARY);
const int cntLen = strlen(CTNTTYPE);

void handle_jpg_stream(void)
{
  char buf[32];
  int s;

  WiFiClient client = server.client();

  client.write(HEADER, hdrLen);
  client.write(BOUNDARY, bdrLen);

  while (true)
  {
    if (!client.connected()) break;
    cam.run();
    s = cam.getSize();
    client.write(CTNTTYPE, cntLen);
    sprintf( buf, "%d\r\n\r\n", s );
    client.write(buf, strlen(buf));
    client.write((char *)cam.getfb(), s);
    client.write(BOUNDARY, bdrLen);
  }
}

const char JHEADER[] = "HTTP/1.1 200 OK\r\n" \
                       "Content-disposition: inline; filename=capture.jpg\r\n" \
                       "Content-type: image/jpeg\r\n\r\n";
const int jhdLen = strlen(JHEADER);

void handle_jpg(void)
{
  WiFiClient client = server.client();

  cam.run();
  if (!client.connected()) return;

  client.write(JHEADER, jhdLen);
  client.write((char *)cam.getfb(), cam.getSize());
}

void handleNotFound()
{
  String message = "Server is running!\n\n";
  message += "URI: ";
  message += server.uri();
  message += "\nMethod: ";
  message += (server.method() == HTTP_GET) ? "GET" : "POST";
  message += "\nArguments: ";
  message += server.args();
  message += "\n";
  server.send(200, "text / plain", message);
}

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

  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;

  // Frame parameters
  //  config.frame_size = FRAMESIZE_UXGA;
  config.frame_size = FRAMESIZE_QVGA;
  config.jpeg_quality = 12;
  config.fb_count = 2;

#if defined(CAMERA_MODEL_ESP_EYE)
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
#endif

  cam.init(config);

  IPAddress ip;

  WiFi.mode(WIFI_STA);
  //WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(F("."));
  }
  ip = WiFi.localIP();
  Serial.println(F("WiFi connected"));
  Serial.println("");
    // Configure Blynk
  //Blynk.config(auth);
  Serial.println("Connecting to Blynk");
  while (Blynk.connect() == false) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nConnected to Blynk");

  
  Serial.println(ip);
  Serial.print("Stream Link: http://");
  Serial.print(ip);
  Serial.println("/mjpeg/1");
  server.on("/mjpeg/1", HTTP_GET, handle_jpg_stream);
  server.on("/jpg", HTTP_GET, handle_jpg);
  server.onNotFound(handleNotFound);
  server.begin();
}

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

|
|
|
|
|
|
|
|
In the serial monitor it write this:

   v1.3.2 on ESP32

 #StandWithUkraine    https://bit.ly/swua


----------------------------------------------------
 Device:    Blynk Webcam-P3RA
 Firmware:  0.1.0 (build Jun  9 2024 23:49:20)
 Platform:  ESP32 @ 240MHz
 Chip rev:  3
 SDK:       v4.4.7-dirty
 Flash:     4096K
 Free mem:  224464
----------------------------------------------------

>[482] INIT => WAIT_CONFIG
E (469) gpio: gpio_install_isr_service(450): GPIO isr service already installed
[493] Hold the button for 1Guru Meditation Error: Core  1 panic'ed (Interrupt wdt timeout on CPU1). 

Core  1 register dump:
PC      : 0x40092ffa  PS      : 0x00060735  A0      : 0x8009199a  A1      : 0x3ffbf40c  
A2      : 0x3ffb896c  A3      : 0x3ffb81a4  A4      : 0x00000004  A5      : 0x00060723  
A6      : 0x00060723  A7      : 0x00000001  A8      : 0x3ffb81a4  A9      : 0x00000018  
A10     : 0x3ffb81a4  A11     : 0x00000018  A12     : 0x3ffc75fc  A13     : 0x00060723  
A14     : 0x007bf638  A15     : 0x003fffff  SAR     : 0x0000000a  EXCCAUSE: 0x00000006  
EXCVADDR: 0x00000000  LBEG    : 0x4008ca71  LEND    : 0x4008ca81  LCOUNT  : 0xfffffff1  
Core  1 was running in ISR context:

EPC1    : 0x400eff07  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x00000000


Backtrace: 0x40092ff7:0x3ffbf40c |<-CORRUPTED


Core  0 register dump:
PC      : 0x40093197  PS      : 0x00060035  A0      : 0x800915c3  A1      : 0x3ffbed5c  
A2      : 0x3ffbf638  A3      : 0xb33fffff  A4      : 0x0000abab  A5      : 0x00060023  
A6      : 0x00060021  A7      : 0x0000cdcd  A8      : 0x0000abab  A9      : 0xffffffff  
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x3ffc6524  A13     : 0x00000007  
A14     : 0x007bf638  A15     : 0x003fffff  SAR     : 0x0000001d  EXCCAUSE: 0x00000006  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  


Backtrace: 0x40093194:0x3ffbed5c |<-CORRUPTED




ELF file SHA256: e43add9d924a3d6d

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0

|
|
|
|
|
|
**What I suspect to be wrong:

  1. WiFi.h, WebServer.h and WiFiClient is already implemented in Edgent inside ConfigMode.h.
  2. In the void Setup() there is something called cam.init(config); if I disabled that code I ESP32 will not get into bootloop, and will work with Blynk Edgent, but the webcam will not work.

Hopefully someone can figure out what my problem is.**