In my case, I used the AI-THINKER module so uncommented #define CAMERA_MODEL_AI_THINKER
The functionality of face recognition did not work for me. The comment in the article was helpful. It seems that face recognition is no longer working (at least with the example program) when using the 1.02 ESP core. Rolling back to the 1.01 core and using the example program belonging to that core, will 'fix' it
Having rolled back to the previous version of library 1.01 everything worked.
I have a pair of I2C 128x64 and TFT SPI 128x128 displays
Article OV7670 with FIFO how to connect the camera to the display if you do not have a CAM module. Support OV2640 and OV7670 cameras
At the time of writing, the following worked for me
ESP32 camera + Wifi Server + I2C Display (AdaFruit) ESP32 camera + SPI Display 1.44 "TFT 128x128 v1.1 (AdaFruit) ESP32 camera + SPI Display 1.8 "TFT 128 * 160 (Espressif library)
The WiFi driver conflicts with the SPI bus. Possible solution to use a different library. The problem arose at the time of the initialization of the WiFi module.
The main problem is that the ESP32-CAM module has a limited number of free legs. Part of the ports is used for the camera, part in parallel with the sd-card. The sd-card connector is installed on the board. Another conclusion (IO4) is the LED flashlight.
I2C Display B / W is not of particular interest for real use with the image received from the camera. TFT color and high resolution. On it you can already see the face. On such a display or a little higher resolution, you can make the Door Eye
I will say right away that the library from AdaFruit is not the fastest. I managed to display a couple of frames per second. It is more promising to use libraries that work at a low level. But I was not able to get an ESP32_TFT_library with my display 1.44 "128x128 SPI V1.1. Maybe ILI9163 is not supported. I took 1.8" 128 * 160 SPI TFT and I managed to squeeze about 12 FPS! Link
There are a couple of libraries that work faster. But some are not ported for esp-32 ( link ):
When using two ports, one of the HSPI or VSPI hardware ports on the microcontroller and display with the ILI9341 driver can receive 30 frames per second ( link ).
But as I said earlier in the ESP32-CAM module, only one SPI is free. It is displayed on the following PINS:
IO2 - DC (A0) IO14 - CLK IO15 - CS IO13 - MOSI (SDA) IO12 - MISO (Input. Not Used)
// Configuration for other boards, set the correct values for the display used //---------------------------------------------------------------------------- #define DISP_COLOR_BITS_24 0x66 //#define DISP_COLOR_BITS_16 0x55 // Do not use! // ############################################# // ### Set to 1 for some displays, ### // for example the one on ESP-WROWER-KIT ### // ############################################# #define TFT_INVERT_ROTATION 0 #define TFT_INVERT_ROTATION1 0 // ################################################ // ### SET TO 0X00 FOR DISPLAYS WITH RGB MATRIX ### // ### SET TO 0X08 FOR DISPLAYS WITH BGR MATRIX ### // ### For ESP-WROWER-KIT set to 0x00 ### // ################################################ #define TFT_RGB_BGR 0x08 // ############################################################## // ### Define ESP32 SPI pins to which the display is attached ### // ############################################################## // The pins configured here are the native spi pins for HSPI interface // Any other valid pin combination can be used #define PIN_NUM_MISO 12 // SPI MISO #define PIN_NUM_MOSI 13 // SPI MOSI #define PIN_NUM_CLK 14 // SPI CLOCK pin #define PIN_NUM_CS 15 // Display CS pin #define PIN_NUM_DC 2 // Display command/data pin #define PIN_NUM_TCS 0 // Touch screen CS pin (NOT used if USE_TOUCH=0) // -------------------------------------------------------------- // ** Set Reset and Backlight pins to 0 if not used ! // ** If you want to use them, set them to some valid GPIO number #define PIN_NUM_RST 0 // GPIO used for RESET control #define PIN_NUM_BCKL 0 // GPIO used for backlight control #define PIN_BCKL_ON 0 // GPIO value for backlight ON #define PIN_BCKL_OFF 1 // GPIO value for backlight OFF // -------------------------------------------------------------- // ####################################################### // Set this to 1 if you want to use touch screen functions // ####################################################### #define USE_TOUCH TOUCH_TYPE_NONE // ####################################################### // ####################################################################### // Default display width (smaller dimension) and height (larger dimension) // ####################################################################### #define DEFAULT_TFT_DISPLAY_WIDTH 128 #define DEFAULT_TFT_DISPLAY_HEIGHT 160 // ####################################################################### #define DEFAULT_GAMMA_CURVE 0 #define DEFAULT_SPI_CLOCK 32000000 #define DEFAULT_DISP_TYPE DISP_TYPE_ST7735B //---------------------------------------------------------------------------- #define TFT_INVERT_ROTATION 0 #define TFT_INVERT_ROTATION1 1 #define TFT_INVERT_ROTATION2 0
Install the environment and development environment from Espressif . Detailed instructions on how to do this .
Install the library . Two corrections need to be made to assemble the library.
Allow access for the USB port for firmware and monitoring:
#sudo chmod 777 / dev / ttyUSB0
We collect and fill:
#make -j4 && make flash
12FPS is achieved through packet writing using the send_data method. Recording is not pixel by pixel, but a whole line equal to the width of the screen:
FRAME_WIDTH is the frame width of 320 pixels for QVGA
config.frame_size = FRAMESIZE_QVGA; // 320x240
In fact, we see a 128 * 160 window from the full frame on the display
Log for configuration with a single camera buffer (config.fb_count = 1) Capture camera time: 32 ms Send buffer time: 47 ms Capture frame ok.
Result 1000 / (32 + 47) = 12.65 FPS
Log for configuration with two camcorder buffers (config.fb_count = 2)
Capture camera time: 39 ms
Send buffer time: 63 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 59 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 34 ms
Capture frame ok. Capture camera time: 40 ms
Send buffer time: 64 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 59 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 34 ms
Capture frame ok. Capture camera time: 40 ms
Send buffer time: 63 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 60 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 34 ms
Capture frame ok. Capture camera time: 39 ms
Send buffer time: 63 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 60 ms
Capture frame ok. Capture camera time: 1 ms
Send buffer time: 34 ms
Capture frame ok. Capture camera time: 40 ms
Send buffer time: 63 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 60 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 34 ms
Capture frame ok. Capture camera time: 40 ms
Send buffer time: 63 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 59 ms
Capture frame ok. Capture camera time: 0 ms
Send buffer time: 35 ms
Capture frame ok.
By using the second buffer of the camcorder, the buffer in some cycles is obtained instantly. At first, the complete cycle is obtained using less than one buffer, but then this time βruns onβ. The interval between cycles is floating.
Several times I caught in the logs "Brownout detector was triggered" so I turned off the detector. Because at first I fed the backlight display from the 3.3V output of the ESP32-CAM
ESP32 low-cost functional module. There is a catastrophic lack of conclusions for implemented ports in the CAM version of the board, so choose the CAM version if you really need a camera.