Coder Social home page Coder Social logo

arducam_esp32s_uno_psram's Introduction

ArduCAM_ESP32S_UNO_PSRAM

Development Status

Most of the framework is implemented. Most noticeable is the missing analogWrite. While analogWrite is on it's way, there are a few other options that you can use:

  • 16 channels LEDC which is PWM
  • 8 channels SigmaDelta which uses SigmaDelta modulation
  • 2 channels DAC which gives real analog output

ArduCAM_ESP32S_UNO_PSRAM Board PINMAP

Pin Functions

Installation Instructions

Installation instructions using Arduino IDE Boards Manager

Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).

  • Install the current upstream Arduino IDE at the 1.8 level or later. The current version is at the Arduino website.
  • Start Arduino and open Preferences window. open Preferences window
  • Enter https://www.arducam.com/downloads/esp32_uno_psram/package_ArduCAM_ESP32_PSRAM_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas. open Preferences window
  • Open Boards Manager from Tools > Board menu and install esp32 platform (and don't forget to select your ESP32 board from Tools > Board menu after installation). open Preferences window open Preferences window

Quickly run the demo

  • Choose the ArduCAM_ESP32S_UNO_PSRAM board. board
  • Choose the right port. port
  • Choose one example. exm
  • Compile and upload the demo. upload
  • Open the serial port to check the debug message. serial
  • Connect the arducam esp32s camera hotspot and test the demo test

Demo Test

upload

Issue/Bug report template

Before reporting an issue, make sure you've searched for similar one that was already created. Also make sure to go through all the issues labelled as for reference.

Finally, if you're sure no one else had the issue, follow the ISSUE_TEMPLATE while reporting any issue.

Hint

Sometimes to program ESP32 via serial you must keep GPIO0 LOW during the programming process

arducam_esp32s_uno_psram's People

Contributors

arducam avatar ljp-while avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

arducam_esp32s_uno_psram's Issues

FaceDetection example code has 2x Serial.begin() statements

Hardware:

Board: ArduCAM_ESP32S_UNO_PSRAM
Core Installation/update date: 9/15/2021
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: IDK?
Upload Speed: 921600
Computer OS: Privacy retained

Description:

The "face detection" example freezes right after "camera init success" when using ap mode. The fix is simple, and the title of this PR should be a good hint. Otherwise, the example seems to be working as expected with my limited testing. I think a little testing after the copy/paste action would prevent such a thing.

Sketch:

// ArduCAM ESP32S UNO PSRAM demo
// Web: http://www.ArduCAM.com
// This program is a demo of how to use most of the functions
// of the library with esp32 camera, and can run on any Arduino platform.
//
// This demo needs to be used in combination with PC software.
// It can operation face detection and face recognition,the image through the web page to view,
// and send commands through the web page to adjust resolution,brightness, exposure time and other parameters.
// This program requires Arduino IDE 1.8.1 compiler or above

#include "arducam_esp32s_camera.h"
#include <WiFi.h>

/*  OV2640 : PIXFORMAT_JPEG
 *  OV7725 : PIXFORMAT_RGB565
 *  OV7670 : PIXFORMAT_RGB565
 */
 

const char* ssid = "YOUR SSID";
const char* password = "YOUR PASSWORD";

const char* ap_ssid = "arducam_esp32s_camera";
const char* ap_password = "";

void startCameraServer();
uint8_t wifi_mode = 0;   //1:station mode, 0:access point mode

void setup() {
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  Serial.println();

  // camera init
  esp_err_t err = arducam_camera_init(PIXFORMAT_JPEG);
  if (err != ESP_OK) {
      Serial.printf("Camera init failed with error 0x%x", err);
      return;
  }
  else
      Serial.printf("Camera init success");
  //set frame size 
  //arducam_set_resolution(FRAMESIZE_QVGA);
    sensor_t * s = arducam_camera_sensor_get();
    s->set_framesize(s, FRAMESIZE_QVGA);
  if(wifi_mode){
    WiFi.begin(ssid, password);
  
    while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
    }
    Serial.println("");
    Serial.println("WiFi connected");
  
    startCameraServer();
  
    Serial.print("Camera Ready! Use 'http://");
    Serial.print(WiFi.localIP());
    Serial.println("' to connect");
  }
  else{
    Serial.begin(115200);
    Serial.println();
    Serial.println("Configuring access point...");
  
    // You can remove the password parameter if you want the AP to be open.
    WiFi.softAP(ap_ssid, ap_password);
    IPAddress myIP = WiFi.softAPIP();
    Serial.print("AP IP address: ");
    Serial.println(myIP);
    startCameraServer();
    
    Serial.println("Server started");
    }
}

void loop() {

}

Debug Messages:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x12 (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:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10088
load:0x40080400,len:6380
entry 0x400806a4

Camera init success

Picture noise video stream

Hardware:

Board: ESP32-WROVER-IE (ESP32-DevKitC- VIE 8MB Flash 8MB PSRAM) and ArduCam 2MP OV2640 1/4” CMOS (UC-265, 20 pins)
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: yes
Upload Speed: 921600
Computer OS: Windows 10

Description:

Hi,
I have a problem with video image. On the picture are black blinking pixels and horizontal lines.
video
I used this example in Arduino IDE (ESP32 → camera → camerawebserwer) https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer.
I tried to reduce XCLK frequency with 20MHz to 6 MHz. Image is better but doesn't fully solve the problem.
I used external antenna and charger 2A but didn't help. I used to connect camera arduino jumper wires, maybe that's the problem?
Second problem is resolution, max is SVGA. Higher resolutions show error in console.
zdj1
I need a solution how to improve the video image. I’m new in ArduCam world. Thanks for help.

Sketch: (https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer)

//Camera setup 
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_VGA;
    config.jpeg_quality = 10;
    config.fb_count = 2;
  } else {
    config.frame_size = FRAMESIZE_SVGA;
    config.jpeg_quality = 12;
    config.fb_count = 1;
    config.fb_location = CAMERA_FB_IN_DRAM;
  }

//Camera pinout
#define PWDN_GPIO_NUM    -1
#define RESET_GPIO_NUM   -1
#define XCLK_GPIO_NUM    21
#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      19
#define Y4_GPIO_NUM      18
#define Y3_GPIO_NUM       5
#define Y2_GPIO_NUM       4
#define VSYNC_GPIO_NUM   25
#define HREF_GPIO_NUM    23
#define PCLK_GPIO_NUM    22

Debug Messages:

rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)configsip: 0, SPIWP:0xeeclk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00mode:DIO, clock div:1load:0x3fff0030,len:1324ho 0 tail 12 room 4load:0x40078000,len:13508load:0x40080400,len:3604entry 0x400805f0.....WiFi connectedCamera Ready! Use 'http://192.168.43.86' to connect

ArduCam ESP32 UNO PSRAM - Compile Issue

Hardware:

Board: ArduCam ESP32 UNO PSRAM
Core Installation/update date: I don't know. I am using ArduCAM version 1.0.0 using board manager
IDE name: Arduino
Flash Frequency: 80
PSRAM enabled: I don't know how to check for this
Upload Speed: 921600
Computer OS: Windows 10

Description:

Hello. I am getting a compile error when attempting to run ArduCAM_ESP32_PSRAM_OV2640_Capture2SD. No changes made to this sketch. I followed the installation instructions precisely from this page prior to running the sketch: https://github.com/arducam/arducam_esp32s_uno_psram

Please see debug message in designated section below. It looks like a *.h dependency is missing, but not sure where to get this file and how to resolve it. Thanks for your help!

Sketch: (leave the backquotes for code formatting)

//Change the code below by your sketch
// ArduCAM demo (C)2019 Lee
// Web: http://www.ArduCAM.com
// This program is a demo of how to use most of the functions
// of the library with a OV2640 digital camera, and can run on ArduCAM ESP32S UNO PSRAM platform.
// This demo will run the OV2640 digital camera on ArduCAM ESP32S UNO PSRAM platform, provide both JPEG capture
// and store it to SD card
// This demo sketch will do the following tasks:
// 1. Set the sensor to JPEG mode.
// 2. Capture every 5 seconds 
// 3. Store the image to Micro SD/TF card with JPEG format in sequential.
// 4. Resolution can be changed by config.frame_size.
// This program requires Arduino IDE 1.8.1 compiler or above

/*the config.frame_size can be set:
    FRAMESIZE_QQVGA,    // 160x120
    FRAMESIZE_QVGA,     // 320x240
    FRAMESIZE_VGA,      // 640x480
    FRAMESIZE_SVGA,     // 800x600
    FRAMESIZE_SXGA,     // 1280x1024
    FRAMESIZE_UXGA,     // 1600x1200
*/ 
#include "SD_MMC.h"
#include "arducam_esp32s_camera.h"

int i = 0;
char path[30];  //array for file path
    
void setup(){
    Serial.begin(115200);
    Serial.println("ArduCAM Start");
    // camera init
    esp_err_t err = arducam_camera_init(PIXFORMAT_JPEG);
    if (err != ESP_OK) {
        Serial.printf("Camera init failed with error 0x%x", err);
        return;
    }
    else
        Serial.printf("Camera init success");
    /*drop down frame size for higher initial frame rate*/
    sensor_t * s = arducam_camera_sensor_get();
    s->set_framesize(s, FRAMESIZE_QVGA);  
    /*SD Card init*/
    if(!SD_MMC.begin()){
          Serial.println("Card Mount Failed");
          return;
      }
    else{
          Serial.println("Card Mount success");
        }
      uint8_t cardType = SD_MMC.cardType();
    if(cardType == CARD_NONE){
          Serial.println("No SD_MMC card attached");
          return;
      }
    Serial.print("SD_MMC Card Type: ");
    if(cardType == CARD_MMC){
        Serial.println("MMC");
      } else if(cardType == CARD_SD){
          Serial.println("SDSC");
      } else if(cardType == CARD_SDHC){
          Serial.println("SDHC");
      } else {
          Serial.println("UNKNOWN");
      }
    uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024);
    Serial.printf("SD_MMC Card Size: %lluMB\n", cardSize);
    //Create ArduCAM folder
    sprintf(path, "/ArduCAM");
    Serial.printf("Creating Dir: %s\n", path);
    if(SD_MMC.mkdir(path)){
        Serial.println("Dir created");
      } 
    else {
        Serial.println("mkdir failed");
      }   
 }

void loop() {
    /*capture to SD card every 5 seconds*/
    Capture2SD();
    delay(5000);
}

static esp_err_t Capture2SD(){
    camera_fb_t * fb = NULL;  
    esp_err_t res = ESP_OK;
    size_t fb_len = 0;
    uint8_t *fb_buf;
    int64_t fr_start = esp_timer_get_time();
    /*start capture*/
    Serial.println("\ncamera start capture");
    fb = arducam_camera_fb_get(); //obtain pointer to a frame buffer 
    if (!fb) {
        Serial.println("Camera capture failed");
        return ESP_FAIL;
    }
    else{
        Serial.println("Camera capture done");
      }
    fb_len = fb->len; //frame buffer length
    fb_buf = fb->buf; //pointer to frame buffer
    /*write data to SD*/
    sprintf(path, "/ArduCAM/%d.jpg", ++i);
    File f = SD_MMC.open(path, "w");
    if(!f){
      Serial.println("Failed to open file for writing");
      }
      f.write(fb_buf, fb_len);
      f.close();
    strcat(path, " written");
    Serial.printf("%s\r\n", path);
    arducam_camera_fb_return(fb); //return the frame buffer to be reused
    int64_t fr_end = esp_timer_get_time();
    Serial.printf("%d.JPG:%uByte %ums\r\n", i, (uint32_t)(fb_len), (uint32_t)((fr_end - fr_start)/1000));
    return res;
}

Debug Messages:

In file included from c:\...\onedrive\documents\arduinodata\packages\arducam_esp32s\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:60:0,
                 from C:\...\OneDrive\Documents\ArduinoData\packages\ArduCAM_ESP32S\hardware\esp32\1.0.0\cores\esp32/Arduino.h:148,
                 from sketch\ArduCAM_ESP32_PSRAM_OV2640_Capture2SD.ino.cpp:1:
c:\...\onedrive\documents\arduinodata\packages\arducam_esp32s\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\utility:68:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board ArduCAM ESP32S UNO PSRAM.

One instruction missing from your example to enable wifi connection

One instruction missing. Here is the default line from example face recognition:

uint8_t wifi_mode = 0; //1:station mode, 0:access point mode

In your instructions, make sure to ask user to change mode to 1, like this:

uint8_t wifi_mode = 1; //1:station mode, 0:access point mode

ArduCAM ESP32S UNO PSRAM Hangs after Camera Init

Hardware:

Board: ArduCAM ESP32S UNO PSRAM
Core Installation/update date: Arducam ESP32S_PSRAM_v1.0.0 - 17/02/2022
IDE name: Arduino IDE
Computer OS: Windows 10

Description:

ArduCAM ESP32S UNO PSRAM hangs after uploading and monitoring the serial COM. All it says is :

Camera init success

Then hangs forever. I've let it sit in this state for half an hour and no change.
I've tried several times reseating the camera cable to see if it would change anything, but it didn't.
I might have just gotten a bad camera or board.

Sketch: (leave the backquotes for code formatting)

//Change the code below by your sketch
// ArduCAM ESP32S UNO PSRAM demo
// Web: http://www.ArduCAM.com
// This program is a demo of how to use most of the functions
// of the library with esp32 camera, and can run on any Arduino platform.
//
// This demo needs to be used in combination with PC software.
// It can operation face detection and face recognition,the image through the web page to view,
// and send commands through the web page to adjust resolution,brightness, exposure time and other parameters.
// This program requires Arduino IDE 1.8.1 compiler or above

#include "arducam_esp32s_camera.h"
#include <WiFi.h>

/*  OV2640 : PIXFORMAT_JPEG
 *  OV7725 : PIXFORMAT_RGB565
 *  OV7670 : PIXFORMAT_RGB565
 */
 

const char* ssid = "YOUR SSID";
const char* password = "YOUR PASSWORD";

const char* ap_ssid = "arducam_esp32s_camera";
const char* ap_password = "";

void startCameraServer();
uint8_t wifi_mode = 0;   //1:station mode, 0:access point mode

void setup() {
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  Serial.println();

  // camera init
  esp_err_t err = arducam_camera_init(PIXFORMAT_JPEG);
  if (err != ESP_OK) {
      Serial.printf("Camera init failed with error 0x%x", err);
      return;
  }
  else
      Serial.printf("Camera init success");
  //set frame size 
  //arducam_set_resolution(FRAMESIZE_QVGA);
    sensor_t * s = arducam_camera_sensor_get();
    s->set_framesize(s, FRAMESIZE_QVGA);
  if(wifi_mode){
    WiFi.begin(ssid, password);
  
    while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
    }
    Serial.println("");
    Serial.println("WiFi connected");
  
    startCameraServer();
  
    Serial.print("Camera Ready! Use 'http://");
    Serial.print(WiFi.localIP());
    Serial.println("' to connect");
  }
  else{
    Serial.begin(115200);
    Serial.println();
    Serial.println("Configuring access point...");
  
    // You can remove the password parameter if you want the AP to be open.
    WiFi.softAP(ap_ssid, ap_password);
    IPAddress myIP = WiFi.softAPIP();
    Serial.print("AP IP address: ");
    Serial.println(myIP);
    startCameraServer();
    
    Serial.println("Server started");
    }
}

void loop() {

}

Debug Messages:

[D][esp32-hal-psram.c:47] psramInit(): PSRAM enabled

Camera init success

ArduCAM_ESP32_Capture2SD example for spi sd card mount fails

Trying to run the ARDUCAM SPI_CAMERA EXAMPLE but I get failure with SDcard. Messages log:
<<<<<<<<<<<<<<<<< start of log output >>>>>>>>>>>>>>>>>>>>>>
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x12 (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:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10088
load:0x40080400,len:6380
entry 0x400806a4
ArduCAM Start!
SD Card Mount Failed
Star Capture
<<<<<<<<<<<<<<< end of serial log print out >>>>>>>>>>>>>>>>>>>>>>
My research points to the fact that the "ESP32_CAMERA" examples are using SD_MMC.h whereas the SPI example is using
SD.h. I have run both sketches on the same board with the same SD card and the SPI version fails to mount the sd card but the version using SD.h (SPI version) fails to mount the SD card. This failure is occurring before I have hooked up the UC-474 SPI camera to the board.

Hardware:

Board: esp32 uno psram
Core Installation/update date: ?
IDE name: Arduino
Flash Frequency: 80
PSRAM enabled: yes
Upload Speed: 115200
Computer OS: Windows 11

Description:

ARDUCAM SPI EXAMPLES FAIL TO MOUNT SD CARD;

Sketch: (leave the backquotes for code formatting)

Look at your example code. The non-spi version of the capture2SD uses SD_MMC.h whereas the SPI version uses SD.h; The SPI version fails to mount the SD card.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.