diff --git a/TimeLapse/TimeLapse.ino b/TimeLapse/TimeLapse.ino index 7d3f1fb..d2789b8 100644 --- a/TimeLapse/TimeLapse.ino +++ b/TimeLapse/TimeLapse.ino @@ -15,7 +15,12 @@ void setup() Serial.println(); initFileSystem(); initCamera(); - + + + + // startLapse(); -------- IF YOU WANT AUTO START THE TIMELAPSE + + WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { @@ -28,6 +33,8 @@ void setup() Serial.print("Camera Ready! Use 'http://"); Serial.print(WiFi.localIP()); Serial.println("' to connect"); + + } void loop() diff --git a/TimeLapse/app_httpd.cpp b/TimeLapse/app_httpd.cpp index da8efa6..e2d2773 100644 --- a/TimeLapse/app_httpd.cpp +++ b/TimeLapse/app_httpd.cpp @@ -108,12 +108,12 @@ static esp_err_t capture_handler(httpd_req_t *req) static esp_err_t startLapseHandler(httpd_req_t *req) { - startLapse(); + return startLapse(); } static esp_err_t stopLapseHandler(httpd_req_t *req) { - stopLapse(); + return stopLapse(); } static esp_err_t streamHandler(httpd_req_t *req) @@ -302,7 +302,7 @@ static esp_err_t status_handler(httpd_req_t *req) p += sprintf(p, "\"hmirror\":%u,", s->status.hmirror); p += sprintf(p, "\"dcw\":%u,", s->status.dcw); p += sprintf(p, "\"colorbar\":%u,", s->status.colorbar); - p += sprintf(p, "\"interval\":%u,", interval); + p += sprintf(p, "\"interval\":%u,", (int)interval); *p++ = '}'; *p++ = 0; httpd_resp_set_type(req, "application/json"); diff --git a/TimeLapse/camera.cpp b/TimeLapse/camera.cpp index 7e2bc30..1f59e05 100644 --- a/TimeLapse/camera.cpp +++ b/TimeLapse/camera.cpp @@ -69,7 +69,7 @@ bool initCamera() s->set_saturation(s, -2); //lower the saturation } //drop down frame size for higher initial frame rate - s->set_framesize(s, FRAMESIZE_QVGA); + s->set_framesize(s, FRAMESIZE_UXGA); #if defined(CAMERA_MODEL_M5STACK_WIDE) s->set_vflip(s, 1); diff --git a/TimeLapse/camera.h b/TimeLapse/camera.h old mode 100644 new mode 100755 diff --git a/TimeLapse/camera_pins.h b/TimeLapse/camera_pins.h old mode 100644 new mode 100755 diff --git a/TimeLapse/file.cpp b/TimeLapse/file.cpp old mode 100644 new mode 100755 diff --git a/TimeLapse/file.h b/TimeLapse/file.h old mode 100644 new mode 100755 diff --git a/TimeLapse/index.h b/TimeLapse/index.h old mode 100644 new mode 100755 diff --git a/TimeLapse/lapse.cpp b/TimeLapse/lapse.cpp index 9328f3c..6d77450 100644 --- a/TimeLapse/lapse.cpp +++ b/TimeLapse/lapse.cpp @@ -5,7 +5,7 @@ unsigned long fileIndex = 0; unsigned long lapseIndex = 0; -unsigned long frameInterval = 1000; +unsigned long frameInterval = 10000; bool mjpeg = true; bool lapseRunning = false; unsigned long lastFrameDelta = 0; @@ -22,7 +22,7 @@ bool startLapse() char path[32]; for(; lapseIndex < 10000; lapseIndex++) { - sprintf(path, "/lapse%03d", lapseIndex); + sprintf(path, "/lapse%03d", (int)lapseIndex); if (!fileExists(path)) { createDir(path); @@ -37,6 +37,7 @@ bool startLapse() bool stopLapse() { lapseRunning = false; + return lapseRunning; } bool processLapse(unsigned long dt) @@ -57,7 +58,7 @@ bool processLapse(unsigned long dt) } char path[32]; - sprintf(path, "/lapse%03d/pic%05d.jpg", lapseIndex, fileIndex); + sprintf(path, "/lapse%03d/pic%05d.jpg", (int)lapseIndex, (int)fileIndex); Serial.println(path); if(!writeFile(path, (const unsigned char *)fb->buf, fb->len)) { diff --git a/TimeLapse/lapse.h b/TimeLapse/lapse.h old mode 100644 new mode 100755