make it wokr

This commit is contained in:
Marcel Ochsendorf 2020-01-30 16:23:39 +01:00
parent bb21a20578
commit 83c6ecd763
10 changed files with 12 additions and 9 deletions

View File

@ -3,8 +3,8 @@
#include "camera.h"
#include "lapse.h"
const char *ssid = "...";
const char *password = "...";
const char *ssid = "iPhone von Marcel";
const char *password = "00000000";
void startCameraServer();
@ -28,6 +28,8 @@ void setup()
Serial.print("Camera Ready! Use 'http://");
Serial.print(WiFi.localIP());
Serial.println("' to connect");
// startLapse();
}
void loop()

View File

@ -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");

View File

@ -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);

0
TimeLapse/camera.h Normal file → Executable file
View File

0
TimeLapse/camera_pins.h Normal file → Executable file
View File

0
TimeLapse/file.cpp Normal file → Executable file
View File

0
TimeLapse/file.h Normal file → Executable file
View File

0
TimeLapse/index.h Normal file → Executable file
View File

View File

@ -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))
{

0
TimeLapse/lapse.h Normal file → Executable file
View File