I am using an ESP32-CAM AI-Thinker board to take an image every four seconds and upload it to Adafruit Dashboard using MQTT.
When I start the board up it connects to my Wifi, and connects to my io.Adafruit account.
The camera takes a picture and publishes it to my account.
If the camera is inside it takes pictures and publishes them every four seconds as expected. However when I place it outside where I want it to be permanently, the first picture is often almost all white during daylight hours.
Most of the time when this happens, that is the only image that is uploaded. Sometimes, but not often, more images follow at about every four seconds and their quality is just fine.
If I hang something like a piece of cloth over the camera the first image is not bleached out and the other images are uploaded.
I have tried modifying the white balance and exposure setting on the camera to the following and it works a little better. Not as washed out but still doesn't work all the time.
sensor_t * s = esp_camera_sensor_get();
s->set_whitebal(s, 1); // 0 = disable , 1 = enable
s->set_awb_gain(s, 1); // 0 = disable , 1 = enable
s->set_wb_mode(s, 1); // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
s->set_exposure_ctrl(s, 1); // 0 = disable , 1 = enable
s->set_aec2(s, 1); // 0 = disable , 1 = enable
s->set_ae_level(s, -2); // -2 to 2
s->set_aec_value(s, 300); // 0 to 1200
Here are two photos. The first is the bleached out one taken with the above settings, the second it the next image uploaded. After that they are all like the second one.
Can someone tell me why this would happen given these conditions and how to address it.
Thanks for your help in advance.