You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: esp32-cam-webserver.ino
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,10 @@ unsigned long imagesServed = 0; // Total image requests
144
144
// This will be displayed to identify the firmware
145
145
char myVer[] PROGMEM = __DATE__ " @ " __TIME__;
146
146
147
+
// This will be set to the sensors PID (identifier) during initialisation
148
+
//camera_pid_t sensorPID;
149
+
int sensorPID;
150
+
147
151
// Camera module bus communications frequency.
148
152
// Originally: config.xclk_freq_mhz = 20000000, but this lead to visual artifacts on many modules.
149
153
// See https://github.com/espressif/esp32-camera/issues/150#issuecomment-726473652 et al.
@@ -373,7 +377,8 @@ void StartCamera() {
373
377
sensor_t * s = esp_camera_sensor_get();
374
378
375
379
// Dump camera module, warn for unsupported modules.
376
-
switch (s->id.PID) {
380
+
sensorPID = s->id.PID;
381
+
switch (sensorPID) {
377
382
case OV9650_PID: Serial.println("WARNING: OV9650 camera module is not properly supported, will fallback to OV2640 operation"); break;
378
383
case OV7725_PID: Serial.println("WARNING: OV7725 camera module is not properly supported, will fallback to OV2640 operation"); break;
379
384
case OV2640_PID: Serial.println("OV2640 camera module detected"); break;
@@ -382,7 +387,7 @@ void StartCamera() {
382
387
}
383
388
384
389
// OV3660 initial sensors are flipped vertically and colors are a bit saturated
385
-
if (s->id.PID == OV3660_PID) {
390
+
if (sensorPID == OV3660_PID) {
386
391
s->set_vflip(s, 1); //flip it back
387
392
s->set_brightness(s, 1); //up the blightness just a bit
388
393
s->set_saturation(s, -2); //lower the saturation
@@ -720,6 +725,8 @@ void setup() {
720
725
// the unit will need rebooting to restart it, either by OTA on success, or manually by the user
721
726
Serial.println("Stopping Camera");
722
727
esp_err_t err = esp_camera_deinit();
728
+
critERR = "<h1>OTA Has been started</h1><hr><p>Camera has Halted!</p>";
729
+
critERR += "<p>Wait for OTA to finish and reboot, or <a href=\"control?var=reboot&val=0\" title=\"Reboot Now (may interrupt OTA)\">reboot manually</a> to recover</p>";
0 commit comments