Comments (15)
Here is my understanding of what should happen...
(Original post edited as it was plain wrong!)
This becomes a lot clearer when you don't look at the existing code....
The OV2640 module has a PWDN and a RESET pin.
The AI Thinker ESP32-CAM board has PWDN connected to pin 32, the RESET pin is NOT connected.
So we have only so worry about the PWDN pin...
The OV2640 gets its power via the PWDN pin, so if it goes off (LOW), then the camera is off, losing all its configuration. (It is possible to toggle very quickly off and then on again without the camera noticing... but why you would want to do this is beyond me).
IMPORTANT Configure a pull-up resistor on pin 32 so it stays HIGH unless you specifically pull it LOW in your code.
from esp32-camera.
I'm having similar issues, but this from the wiki clarifies a little.
What pin number are you defining as the reset pin?
...
2. The ESP32 GPIO32 pin controls the camera power. When the camera is working, please lower the GPIO32.
3. Since IO0 is connected to the camera XCLK, please leave IO0 floating when using it, please do not connect high and low level.
...
from esp32-camera.
Sadly I don't speak (or read) Chinese.
With .pin_reset set to -1 and .pin_pwdn set to 32 everything is working fine so far.
from esp32-camera.
Google translate :)
That's what I have too. (-1 disables the use of the pin).
Mine was working until I started adding code, so I'm pretty sure the problems are in the code.
I am NOT using hardware i2c.
from esp32-camera.
You're right, although I don't tend to trust automatic translation in technical matters.
So far I have no problems with taking pictures, saving them to SD or sending them as http.
Sometimes on boot the SCCB fails, but it succeeds on second try, so I have not looked further into the issue yet.
from esp32-camera.
I've been reading about this but have not been able to reproduce it till recently. I got a hols of one board that has almost all pins mapped exactly as Wrover-Kit with the exception of power. The other issue with this is that 0x3C is actually the valid address for OV3660, so we can not treat it as error.
Overall the best action is to setup the pins properly for the given board. Maybe some sort of note needs to be left... or maybe I could just error out if 0x3C is found but SCCB fails... not sure what is the best approach to notify the user for this issue.
from esp32-camera.
Yes it's a bit tricky, but some kind of note would be nice to save other people some time, since the workaround is pretty easy, once you know what's up. Thank you for looking into it. :)
from esp32-camera.
can you point me to that information in the datasheet? I'm not sure I understand what you mean by pin32. Which IO on the camera is this connected to?
from esp32-camera.
Thanks for your contribution to the topic, Mnark!
I know this is off topic but there is something else about the esp32-cam board I had to figure out the hard way. Apparently gpio 16 is somehow internally connected. (I am new to the whole topic of microcontrollers, but I guess it has to do with the SDRAM and core selection or something like that) So if you set it to input only, e.g. to connect a PIR, it messes with your tasks and causes crashes. So there are not a lot of pins one could use for getting an input. I turned to pin 12, which would be used by the sd-card, but since one has to use the sd-card in single line mode anyway to use the flash on pin4, pin 12 should become available.
from esp32-camera.
It does appear to be connected internally, its labelled U2RXD on the datasheet, so would imply its some sort of external interrupt.
This isn't my field of expertise, but I notice that the sensor module can be left running while the ESP is in sleep mode (this functionality doesn't exist in this library), I suspect this pin should be used to wake up the ESP from deep sleep.
(Probably what you are trying to do with a PIR... I'm intending using an RF motion detector for this task, but haven't got to it yet)
from esp32-camera.
@me-no-dev The mystery of the 0x03c is at the top of the code (sccb.c), it is the default value returned when SCCB fails... it should be 0x00.
static uint8_t ESP_SLAVE_ADDR = 0x3c;
from esp32-camera.
Stumbled on this error also, with the I2C hardware mode the passed slave_addr was not used,
so for the w/a where there was SCCB_Write(0x30, (...)) it wrote to the ESP_SLAVE_ADDR
Uploaded pull request for this issue: #106
from esp32-camera.
I am suggesting this alternate code for SCCB_Probe function: (to remove this 0x3C issue)
tested.
uint8_t SCCB_Probe()
{
uint8_t slave_addr = 0;
#ifdef CONFIG_SCCB_HARDWARE_I2C
while(slave_addr < 0x7f)
{
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
i2c_master_start(cmd);
i2c_master_write_byte(cmd, ( slave_addr << 1 ) | WRITE_BIT, ACK_CHECK_EN);
i2c_master_stop(cmd);
esp_err_t ret = i2c_master_cmd_begin(SCCB_I2C_PORT, cmd, 1000 / portTICK_RATE_MS);
i2c_cmd_link_delete(cmd);
if( ret == ESP_OK)
{
return slave_addr; // got response = valid slv_addr
}
slave_addr++;
}
#else
for (uint8_t i = 0; i < 0x7F; i++)
{
if (twi_writeTo(i, &slave_addr, 1, true) == 0)
{
break;
}
if (i!=0x7E)
{
vTaskDelay(10 / portTICK_PERIOD_MS); // Necessary for OV7725 camera (not for OV2640).
}
}
#endif
if (slave_addr==0x7F) slave_addr=0; // indicate not found
return slave_addr;
}
from esp32-camera.
sorry formating got garbeled....
from esp32-camera.
This issue appears to be stale. Please close it if its no longer valid.
from esp32-camera.
Related Issues (20)
- cam_hal: insufficient queue_size in corner case. HOT 3
- Enable psram mode on ESP32S3 causes NO-SOI and then panic HOT 4
- how to handle multiple comonents calling install_gpio_isr_service/uninstall_gpio_isr_service/gpio_isr_handler_add HOT 12
- Reset button is hard to reach HOT 1
- The example code cannot run properly (LoadProhibited) HOT 13
- PowerFeather - pin configuration?
- Enable camera has big impact on networking HOT 23
- Hardcoded buffer size for JPEG is too small for low resolution settings (e.g., QQVGA) HOT 2
- Support for Higher Resolutions on gc2145 - $300 Reward HOT 2
- ESP32S3-EYE I accidentally set pin 13 (PCLK) & 14 to INPUT_PULLUP once, now my camera is not recognized anymore (0x105) HOT 1
- Captured images are stale HOT 1
- cant verify HOT 2
- Incorrect frame width and height returned by esp_camera_fb_get() when using sensor->set_res_raw() HOT 1
- ESP32 camera module get very hot - high temperature HOT 8
- OV2640 standby support HOT 2
- Add sleep/standby function to the driver API
- ESP32-S3-MINI-N4R2 HOT 2
- set_aec2 seems inversed in ov2460 HOT 2
- Incorrect handling of RGB565 images during conversion to BMP or RGB888
- If there are multiple fbs, whether the specified frame can be retrieved from the cache
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-camera.