Merge 3889e11ea6
into bb21a20578
This commit is contained in:
commit
9e05f9282a
|
@ -15,7 +15,12 @@ void setup()
|
||||||
Serial.println();
|
Serial.println();
|
||||||
initFileSystem();
|
initFileSystem();
|
||||||
initCamera();
|
initCamera();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// startLapse(); -------- IF YOU WANT AUTO START THE TIMELAPSE
|
||||||
|
|
||||||
|
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
while (WiFi.status() != WL_CONNECTED)
|
while (WiFi.status() != WL_CONNECTED)
|
||||||
{
|
{
|
||||||
|
@ -28,6 +33,8 @@ void setup()
|
||||||
Serial.print("Camera Ready! Use 'http://");
|
Serial.print("Camera Ready! Use 'http://");
|
||||||
Serial.print(WiFi.localIP());
|
Serial.print(WiFi.localIP());
|
||||||
Serial.println("' to connect");
|
Serial.println("' to connect");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|
|
@ -108,12 +108,12 @@ static esp_err_t capture_handler(httpd_req_t *req)
|
||||||
|
|
||||||
static esp_err_t startLapseHandler(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)
|
static esp_err_t stopLapseHandler(httpd_req_t *req)
|
||||||
{
|
{
|
||||||
stopLapse();
|
return stopLapse();
|
||||||
}
|
}
|
||||||
|
|
||||||
static esp_err_t streamHandler(httpd_req_t *req)
|
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, "\"hmirror\":%u,", s->status.hmirror);
|
||||||
p += sprintf(p, "\"dcw\":%u,", s->status.dcw);
|
p += sprintf(p, "\"dcw\":%u,", s->status.dcw);
|
||||||
p += sprintf(p, "\"colorbar\":%u,", s->status.colorbar);
|
p += sprintf(p, "\"colorbar\":%u,", s->status.colorbar);
|
||||||
p += sprintf(p, "\"interval\":%u,", interval);
|
p += sprintf(p, "\"interval\":%u,", (int)interval);
|
||||||
*p++ = '}';
|
*p++ = '}';
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
httpd_resp_set_type(req, "application/json");
|
httpd_resp_set_type(req, "application/json");
|
||||||
|
|
|
@ -69,7 +69,7 @@ bool initCamera()
|
||||||
s->set_saturation(s, -2); //lower the saturation
|
s->set_saturation(s, -2); //lower the saturation
|
||||||
}
|
}
|
||||||
//drop down frame size for higher initial frame rate
|
//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)
|
#if defined(CAMERA_MODEL_M5STACK_WIDE)
|
||||||
s->set_vflip(s, 1);
|
s->set_vflip(s, 1);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
unsigned long fileIndex = 0;
|
unsigned long fileIndex = 0;
|
||||||
unsigned long lapseIndex = 0;
|
unsigned long lapseIndex = 0;
|
||||||
unsigned long frameInterval = 1000;
|
unsigned long frameInterval = 10000;
|
||||||
bool mjpeg = true;
|
bool mjpeg = true;
|
||||||
bool lapseRunning = false;
|
bool lapseRunning = false;
|
||||||
unsigned long lastFrameDelta = 0;
|
unsigned long lastFrameDelta = 0;
|
||||||
|
@ -22,7 +22,7 @@ bool startLapse()
|
||||||
char path[32];
|
char path[32];
|
||||||
for(; lapseIndex < 10000; lapseIndex++)
|
for(; lapseIndex < 10000; lapseIndex++)
|
||||||
{
|
{
|
||||||
sprintf(path, "/lapse%03d", lapseIndex);
|
sprintf(path, "/lapse%03d", (int)lapseIndex);
|
||||||
if (!fileExists(path))
|
if (!fileExists(path))
|
||||||
{
|
{
|
||||||
createDir(path);
|
createDir(path);
|
||||||
|
@ -37,6 +37,7 @@ bool startLapse()
|
||||||
bool stopLapse()
|
bool stopLapse()
|
||||||
{
|
{
|
||||||
lapseRunning = false;
|
lapseRunning = false;
|
||||||
|
return lapseRunning;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool processLapse(unsigned long dt)
|
bool processLapse(unsigned long dt)
|
||||||
|
@ -57,7 +58,7 @@ bool processLapse(unsigned long dt)
|
||||||
}
|
}
|
||||||
|
|
||||||
char path[32];
|
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);
|
Serial.println(path);
|
||||||
if(!writeFile(path, (const unsigned char *)fb->buf, fb->len))
|
if(!writeFile(path, (const unsigned char *)fb->buf, fb->len))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue