Question about ESP UNO Boards

Hey there,

Recently I have been working on a project where I used a ESP8266 UNO board with an Arducam OV2640. I wanted to continuously get a photo to my PC through the local server, but it turns out the entire process took about 2.5 seconds, which is way too slow for my project.

I wonder if a better camera module such as Arducam OV5642 would work better, or a better board such as ESP32 UNO board would work better. I expect a response within 1 second.

Please let me know your suggestions as soon as possible. I will start order around soon. Thank you!

Best regards,
Ken

Hello @Ken_Shi and welcome to the community,

A better camera module won’t really help, in fact, it will do the opposite because a better quality image will have a bigger size so it will take longer to upload. I also don’t think you need to use a new board, because the solution is probably in the code. For this reason I invite you to share your code, you could create a new topic in the forum so that other members of the community can help you or benefit from the solution. I also suggest you visit the following link https://github.com/esp8266/Arduino/issues/1853 maybe it could help you.

Regards,
Geraldine

1 Like

Thank you for reaching out! In fact, the arduino codes I used are all provided when I purchased the component. Here is the one I used for my ESP8266 UNO:

// ArduCAM Mini demo (C)2017 Lee
// Web: http://www.ArduCAM.com
// This program is a demo of how to use most of the functions
// of the library with ArduCAM ESP8266 2MP/5MP camera.
// This demo was made for ArduCAM ESP8266 2MP/5MP Camera.
// It can take photo and send to the Web.
// It can take photo continuously as video streaming and send to the Web.
// The demo sketch will do the following tasks:
// 1. Set the camera to JPEG output mode.
// 2. if server.on("/capture", HTTP_GET, serverCapture),it can take photo and send to the Web.
// 3.if server.on("/stream", HTTP_GET, serverStream),it can take photo continuously as video
//streaming and send to the Web.

// This program requires the ArduCAM V4.0.0 (or later) library and ArduCAM ESP8266 2MP/5MP camera
// and use Arduino IDE 1.6.8 compiler or above

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <Wire.h>
#include <ArduCAM.h>
#include <SPI.h>
#include "memorysaver.h"
#if !(defined ESP8266 )
#error Please select the ArduCAM ESP8266 UNO board in the Tools/Board
#endif

//This demo can only work on OV2640_MINI_2MP or ARDUCAM_SHIELD_V2 platform.
#if !(defined (OV2640_MINI_2MP)||defined (OV5640_MINI_5MP_PLUS) || defined (OV5642_MINI_5MP_PLUS) \
    || defined (OV5642_MINI_5MP) || defined (OV5642_MINI_5MP_BIT_ROTATION_FIXED) \
    ||(defined (ARDUCAM_SHIELD_V2) && (defined (OV2640_CAM) || defined (OV5640_CAM) || defined (OV5642_CAM))))
#error Please select the hardware platform and camera module in the ../libraries/ArduCAM/memorysaver.h file
#endif
// set GPIO16 as the slave select :
const int CS = 16;


//you can change the value of wifiType to select Station or AP mode.
//Default is AP mode.
int wifiType = 1; // 0:Station  1:AP

//AP mode configuration
//Default is arducam_esp8266.If you want,you can change the AP_aaid  to your favorite name
const char *AP_ssid = "arducam_esp8266";
//Default is no password.If you want to set password,put your password here
const char *AP_password = "";

//Station mode you should put your ssid and password
const char *ssid = "SSID"; // Put your SSID here
const char *password = "PASSWORD"; // Put your PASSWORD here

static const size_t bufferSize = 4096;
static uint8_t buffer[bufferSize] = {0xFF};
uint8_t temp = 0, temp_last = 0;
int i = 0;
bool is_header = false;

ESP8266WebServer server(80);
#if defined (OV2640_MINI_2MP) || defined (OV2640_CAM)
ArduCAM myCAM(OV2640, CS);
#elif defined (OV5640_MINI_5MP_PLUS) || defined (OV5640_CAM)
ArduCAM myCAM(OV5640, CS);
#elif defined (OV5642_MINI_5MP_PLUS) || defined (OV5642_MINI_5MP) || defined (OV5642_MINI_5MP_BIT_ROTATION_FIXED) ||(defined (OV5642_CAM))
ArduCAM myCAM(OV5642, CS);
#endif


void start_capture() {
  myCAM.clear_fifo_flag();
  myCAM.start_capture();
}

void camCapture(ArduCAM myCAM) {
  WiFiClient client = server.client();
  uint32_t len  = myCAM.read_fifo_length();
  if (len >= MAX_FIFO_SIZE) //8M
  {
    Serial.println(F("Over size."));
  }
  if (len == 0 ) //0 kb
  {
    Serial.println(F("Size is 0."));
  }
  myCAM.CS_LOW();
  myCAM.set_fifo_burst();
  if (!client.connected()) return;
  String response = "HTTP/1.1 200 OK\r\n";
  response += "Content-Type: image/jpeg\r\n";
  response += "Content-len: " + String(len) + "\r\n\r\n";
  server.sendContent(response);
  i = 0;
  while ( len-- )
  {
    temp_last = temp;
    temp =  SPI.transfer(0x00);
    //Read JPEG data from FIFO
    if ( (temp == 0xD9) && (temp_last == 0xFF) ) //If find the end ,break while,
    {
      buffer[i++] = temp;  //save the last  0XD9
      //Write the remain bytes in the buffer
      if (!client.connected()) break;
      client.write(&buffer[0], i);
      is_header = false;
      i = 0;
      myCAM.CS_HIGH();
      break;
    }
    if (is_header == true)
    {
      //Write image data to buffer if not full
      if (i < bufferSize)
        buffer[i++] = temp;
      else
      {
        //Write bufferSize bytes image data to file
        if (!client.connected()) break;
        client.write(&buffer[0], bufferSize);
        i = 0;
        buffer[i++] = temp;
      }
    }
    else if ((temp == 0xD8) & (temp_last == 0xFF))
    {
      is_header = true;
      buffer[i++] = temp_last;
      buffer[i++] = temp;
    }
  }
}

void serverCapture() {
  myCAM.flush_fifo();
  myCAM.clear_fifo_flag();
  start_capture();
  Serial.println(F("CAM Capturing"));
  int total_time = 0;
  total_time = millis();
  while (!myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK));
  total_time = millis() - total_time;
  Serial.print(F("capture total_time used (in miliseconds):"));
  Serial.println(total_time, DEC);
  total_time = 0;
  Serial.println(F("CAM Capture Done."));
  total_time = millis();
  camCapture(myCAM);
  total_time = millis() - total_time;
  Serial.print(F("send total_time used (in miliseconds):"));
  Serial.println(total_time, DEC);
  Serial.println(F("CAM send Done."));
}

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

  String response = "HTTP/1.1 200 OK\r\n";
  response += "Content-Type: multipart/x-mixed-replace; boundary=frame\r\n\r\n";
  server.sendContent(response);

  while (1) {
    start_capture();
    while (!myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK));
    size_t len = myCAM.read_fifo_length();
    if (len >= MAX_FIFO_SIZE) //8M
    {
      Serial.println(F("Over size."));
      continue;
    }
    if (len == 0 ) //0 kb
    {
      Serial.println(F("Size is 0."));
      continue;
    }
    myCAM.CS_LOW();
    myCAM.set_fifo_burst();
    if (!client.connected()) {
      Serial.println("break"); break;
    }
    response = "--frame\r\n";
    response += "Content-Type: image/jpeg\r\n\r\n";
    server.sendContent(response);
    while ( len-- )
    {
      temp_last = temp;
      temp =  SPI.transfer(0x00);

      //Read JPEG data from FIFO
      if ( (temp == 0xD9) && (temp_last == 0xFF) ) //If find the end ,break while,
      {
        buffer[i++] = temp;  //save the last  0XD9
        //Write the remain bytes in the buffer
        myCAM.CS_HIGH();;
        if (!client.connected()) {
          client.stop(); is_header = false; break;
        }
        client.write(&buffer[0], i);
        is_header = false;
        i = 0;
      }
      if (is_header == true)
      {
        //Write image data to buffer if not full
        if (i < bufferSize)
          buffer[i++] = temp;
        else
        {
          //Write bufferSize bytes image data to file
          myCAM.CS_HIGH();
          if (!client.connected()) {
            client.stop(); is_header = false; break;
          }
          client.write(&buffer[0], bufferSize);
          i = 0;
          buffer[i++] = temp;
          myCAM.CS_LOW();
          myCAM.set_fifo_burst();
        }
      }
      else if ((temp == 0xD8) & (temp_last == 0xFF))
      {
        is_header = true;
        buffer[i++] = temp_last;
        buffer[i++] = temp;
      }
    }
    if (!client.connected()) {
      client.stop(); is_header = false; break;
    }
  }
}

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);

  if (server.hasArg("ql")) {
    int ql = server.arg("ql").toInt();
#if defined (OV2640_MINI_2MP) || defined (OV2640_CAM)
    myCAM.OV2640_set_JPEG_size(ql);
#elif defined (OV5640_MINI_5MP_PLUS) || defined (OV5640_CAM)
    myCAM.OV5640_set_JPEG_size(ql);
#elif defined (OV5642_MINI_5MP_PLUS) || defined (OV5642_MINI_5MP_BIT_ROTATION_FIXED) ||(defined (OV5642_CAM))
    myCAM.OV5642_set_JPEG_size(ql);
#endif
    delay(1000);
    Serial.println("QL change to: " + server.arg("ql"));
  }
}
void setup() {
  uint8_t vid, pid;
  uint8_t temp;
#if defined(__SAM3X8E__)
  Wire1.begin();
#else
  Wire.begin();
#endif
  Serial.begin(115200);
  Serial.println(F("ArduCAM Start!"));
  // set the CS as an output:
  pinMode(CS, OUTPUT);
  // initialize SPI:
  SPI.begin();
  SPI.setFrequency(4000000); //4MHz
  //Check if the ArduCAM SPI bus is OK
  myCAM.write_reg(ARDUCHIP_TEST1, 0x55);
  temp = myCAM.read_reg(ARDUCHIP_TEST1);
  if (temp != 0x55) {
    Serial.println(F("SPI1 interface Error!"));
    while (1);
  }
#if defined (OV2640_MINI_2MP) || defined (OV2640_CAM)
  //Check if the camera module type is OV2640
  myCAM.wrSensorReg8_8(0xff, 0x01);
  myCAM.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);
  myCAM.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);
  if ((vid != 0x26 ) && (( pid != 0x41 ) || ( pid != 0x42 )))
    Serial.println(F("Can't find OV2640 module!"));
  else
    Serial.println(F("OV2640 detected."));
#elif defined (OV5640_MINI_5MP_PLUS) || defined (OV5640_CAM)
  //Check if the camera module type is OV5640
  myCAM.wrSensorReg16_8(0xff, 0x01);
  myCAM.rdSensorReg16_8(OV5640_CHIPID_HIGH, &vid);
  myCAM.rdSensorReg16_8(OV5640_CHIPID_LOW, &pid);
  if ((vid != 0x56) || (pid != 0x40))
    Serial.println(F("Can't find OV5640 module!"));
  else
    Serial.println(F("OV5640 detected."));
#elif defined (OV5642_MINI_5MP_PLUS) || defined (OV5642_MINI_5MP) || defined (OV5642_MINI_5MP_BIT_ROTATION_FIXED) ||(defined (OV5642_CAM))
  //Check if the camera module type is OV5642
  myCAM.wrSensorReg16_8(0xff, 0x01);
  myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid);
  myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);
  if ((vid != 0x56) || (pid != 0x42)) {
    Serial.println(F("Can't find OV5642 module!"));
  }
  else
    Serial.println(F("OV5642 detected."));
#endif


  //Change to JPEG capture mode and initialize the OV2640 module
  myCAM.set_format(JPEG);
  myCAM.InitCAM();
#if defined (OV2640_MINI_2MP) || defined (OV2640_CAM)
  myCAM.OV2640_set_JPEG_size(OV2640_320x240);
#elif defined (OV5640_MINI_5MP_PLUS) || defined (OV5640_CAM)
  myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);   //VSYNC is active HIGH
  myCAM.OV5640_set_JPEG_size(OV5640_320x240);
#elif defined (OV5642_MINI_5MP_PLUS) || defined (OV5642_MINI_5MP) || defined (OV5642_MINI_5MP_BIT_ROTATION_FIXED) ||(defined (OV5642_CAM))
  myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);   //VSYNC is active HIGH
  myCAM.OV5640_set_JPEG_size(OV5642_320x240);
#endif

  myCAM.clear_fifo_flag();
  if (wifiType == 0) {
    if (!strcmp(ssid, "SSID")) {
      Serial.println(F("Please set your SSID"));
      while (1);
    }
    if (!strcmp(password, "PASSWORD")) {
      Serial.println(F("Please set your PASSWORD"));
      while (1);
    }
    // Connect to WiFi network
    Serial.println();
    Serial.println();
    Serial.print(F("Connecting to "));
    Serial.println(ssid);

    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(F("."));
    }
    Serial.println(F("WiFi connected"));
    Serial.println("");
    Serial.println(WiFi.localIP());
  } else if (wifiType == 1) {
    Serial.println();
    Serial.println();
    Serial.print(F("Share AP: "));
    Serial.println(AP_ssid);
    Serial.print(F("The password is: "));
    Serial.println(AP_password);

    WiFi.mode(WIFI_AP);
    WiFi.softAP(AP_ssid, AP_password);
    Serial.println("");
    Serial.println(WiFi.softAPIP());
  }

  // Start the server
  server.on("/capture", HTTP_GET, serverCapture);
  server.on("/stream", HTTP_GET, serverStream);
  server.onNotFound(handleNotFound);
  server.begin();
  Serial.println(F("Server started"));
}

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

and I used the following python code to get my data:

import urllib.request
import datetime

f = open('test.jpg', 'wb')
print('Writing images...\n')
a = datetime.datetime.now()
f.write(urllib.request.urlopen('http://192.168.4.1/capture').read())
b = datetime.datetime.now()
print('Done! The process took ' + str((b - a).seconds) + '.' + str((b - a).microseconds) + ' seconds')
f.close()

I used OV2640 as my camera module, so maybe you can disregard the rest modules such as OV5640 ish
I hope I can hear back from you soon! Thanks in advance!

Best,
Ken

Hello again Ken,

Thanks for sharing the code! Do you mind if I make this topic public? This way other members of the community could help you or benefit if you find a solution.

I’m not sure how much it can help but I read some blogs that indicate that adding

client.setNoDelay(1);

after

WiFiClient client = server.client();

can increase the uploading speed. You could try that and let us know if it helped.

Thank you Geraldine, please make this public (I did not know this when I posted this, I am pretty new to the community)

One thing I noticed in the recent debugging of my device is, in fact, taking picture and upload did not cost too much time, they took around 300 microseconds, which is pretty reasonable. The problem might have been, the “url” I gave to my python code was not really an “url”, but more like a triggering command. I think the server had a hard time processing this in general, which took some time.

I believe the fix is in both pieces of codes I posted here, but I am not good enough to find out how to make this work
 I need some help here. Please let me know if there’s any suggestions from anyone, greatly appreciated!

Best,
Ken

1 Like

Try this:

import urllib.request
import datetime
 
a = datetime.datetime.now()
urllib.request.urlretrieve("http://192.168.4.1/capture", "test.jpeg")
b = datetime.datetime.now()
print('Done! The process took ' + str((b - a).seconds) + '.' + str((b - a).microseconds) + ' seconds')
2 Likes

Hey Geraldine,

Thank you for helping. After several trials of work, I think I made it. Right now the frame rate is about 0.2 sec/image, which is far better than before. Although there is still occasional lag, I believe we cannot do much better than this


The changes I made to get it working:

  1. client.setNoDelay(1) helped. It makes the stream far more continuous.

  2. retrieve did not work, because the nature of the device makes the picture weird. After inspection, I figured that open the url as request is the major source of time. On average, it took 2 seconds to process this. Therefore, I decided to do streaming.

  3. The part where I fixed the stream took a long time, but mostly they are calibrations, nothing fancy was involved.

Anyways, I think I’m good with my case. I also ordered a piece of ESP32 UNO, I may replace this one for the sake of even better performance. Thank you again for the helps, wish you all the best.

Best,
Ken

2 Likes

Hi Ken!

After several trials of work, I think I made it. Right now the frame rate is about 0.2 sec/image, which is far better than before.

That’s great!

Thank you for listing the changes you made! I will now share this publicly so it can help others who have a similar problem. Or maybe someone else can give you some good advice.

Best,
Geraldine

3 Likes

I am a Mac User - High Sierra - Purchased the OV5642 and Arducam ESP32 UNO

Have been trying to get it going for days

Have more error messages than i have ever seen before

I believe i have the board setup in the arduino IDE because I can upload other simpler sketches

But the ESP 32 Capture sketch will not compile

here is memorysaver.h and errors

Can you help please

#ifndef MEMORYSAVER
#define MEMORYSAVER

//Only when using raspberry,enable it
//#define RASPBERRY_PI

//There are two steps you need to modify in this file before normal compilation
//Only ArduCAM Shield series platform need to select camera module, ArduCAM-Mini series platform doesn’t

//Step 1: select the hardware platform, only one at a time
//#define OV2640_MINI_2MP
//#define OV3640_MINI_3MP
//#define OV5642_MINI_5MP
//#define OV5642_MINI_5MP_BIT_ROTATION_FIXED
#define OV5642_MINI_5MP_PLUS
//#define OV5640_MINI_5MP_PLUS

//#define ARDUCAM_SHIELD_REVC
//#define ARDUCAM_SHIELD_V2

//Step 2: Select one of the camera module, only one at a time
//#if (defined(ARDUCAM_SHIELD_REVC) || defined(ARDUCAM_SHIELD_V2))
//#define OV7660_CAM
//#define OV7725_CAM
//#define OV7670_CAM
//#define OV7675_CAM
//#define OV2640_CAM
//#define OV3640_CAM
//#define OV5642_CAM
//#define OV5640_CAM

//#define MT9D111A_CAM
//#define MT9D111B_CAM
//#define MT9M112_CAM
//#define MT9V111_CAM	
//#define MT9M001_CAM	
//#define MT9V034_CAM
//#define MT9T112_CAM
//#define MT9D112_CAM

#endif

//#endif //MEMORYSAVER


Arduino: 1.8.12 (Mac OS X), Board: “ArduCAM ESP32S UNO, Disabled, Default, QIO, 80MHz, 4MB (32Mb), 921600, None”

/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/WiFi/src/WiFiClient.cpp: In member function ‘virtual uint8_t WiFiClient::connected()’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/WiFi/src/WiFiClient.cpp:440:13: warning: unused variable ‘res’ [-Wunused-variable]
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
^
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/WiFi/src/WiFiSTA.cpp: In static member function ‘static void WiFiSTAClass::_smartConfigCallback(uint32_t, void*)’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/WiFi/src/WiFiSTA.cpp:686:30: warning: unused variable ‘type’ [-Wunused-variable]
smartconfig_type_t * type = (smartconfig_type_t *)result;
^
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/WiFi/src/WiFiSTA.cpp:697:26: warning: unused variable ‘ip’ [-Wunused-variable]
ip4_addr_t * ip = (ip4_addr_t )result;
^
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/WiFi/src/WiFiMulti.cpp: In member function ‘uint8_t WiFiMulti::run(uint32_t)’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/WiFi/src/WiFiMulti.cpp:129:27: warning: variable ‘mac’ set but not used [-Wunused-but-set-variable]
uint8_t * mac;
^
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp: In member function 'int ArduCAM::wrSensorRegs8_8(const sensor_reg
)’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp:945:7: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int err = 0;

   ^

/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp: In member function ‘int ArduCAM::wrSensorRegs8_16(const sensor_reg*)’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp:969:7: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int err = 0;

   ^

/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp: In member function ‘int ArduCAM::wrSensorRegs16_8(const sensor_reg*)’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp:1000:7: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int err = 0;

   ^

/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp: In member function ‘int ArduCAM::wrSensorRegs16_16(const sensor_reg*)’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp:1032:8: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int err = 0;

    ^

/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp: In member function ‘int ArduCAM::wrSensorRegs8_16(const sensor_reg*)’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp:973:4: error: ‘reg_val’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
while ((reg_addr != 0xff) | (reg_val != 0xffff))

^

/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp:973:4: error: ‘reg_addr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp: In member function ‘int ArduCAM::wrSensorRegs16_8(const sensor_reg*)’:
/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp:1005:4: error: ‘reg_val’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
while ((reg_addr != 0xffff) | (reg_val != 0xff))

^

/Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/ArduCAM/ArduCAM.cpp:1005:4: error: ‘reg_addr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
cc1plus: some warnings being treated as errors
Multiple libraries were found for “WiFi.h”
Used: /Users/admin/Library/Arduino15/packages/ArduCAM_ESP32S_UNO/hardware/esp32/2.0.0/libraries/WiFi
Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
exit status 1
Error compiling for board ArduCAM ESP32S UNO.
Invalid library found in /Arduino Sketches/libraries/ArduCAM_ESP32S_UNO: no headers files (.h) found in /Arduino Sketches/libraries/ArduCAM_ESP32S_UNO
Invalid library found in /Arduino Sketches/libraries/ArduCAM_ESP32S_UNO: no headers files (.h) found in /Arduino Sketches/libraries/ArduCAM_ESP32S_UNO

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

the youtube tutorial is too quick for me

Hello @rdc123 and welcome to the forum,

It seems that the errors are due to uninitialized variables.

Find the reg_addr and reg_val definitions on the ArduCAM.cpp and add this:

unsigned int reg_addr = 0x00;
unsigned int reg_val = 0x00;

Let us know how it goes :slightly_smiling_face:

1 Like