Changes in code (Dummy Servo

Created Diff never expires
19 removals
Lines
Total
Removed
Words
Total
Removed
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
685 lines
34 additions
Lines
Total
Added
Words
Total
Added
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
703 lines
//TAB1: Pinout and wifi setup
//TAB1:

#include "esp_camera.h"
#include "esp_camera.h"
#include <WiFi.h>
#include <WiFi.h>
#include <Servo.h>
#include <Servo.h>


static const int servoPin1 = 12;
static const int dservo1Pin = 1;
static const int servoPin2 = 13;
static const int dservo2Pin = 3;
static const int dservo3Pin = 0;
static const int dservo4Pin = 16;
static const int servo1Pin = 12;
static const int servo2Pin = 13;
Servo servo1;
Servo servo1;
Servo servo2;
Servo servo2;
Servo dservo1;
Servo dservo2;
Servo dservo3;
Servo dservo4;
//
//
// WARNING!!! Make sure that you have either selected ESP32 Wrover Module,
// WARNING!!! Make sure that you have either selected ESP32 Wrover Module,
// or another board which has PSRAM enabled
// or another board which has PSRAM enabled
//
//
// Adafruit ESP32 Feather
// Adafruit ESP32 Feather


// Select camera model
// Select camera model
//#define CAMERA_MODEL_WROVER_KIT
//#define CAMERA_MODEL_WROVER_KIT
//#define CAMERA_MODEL_M5STACK_PSRAM
//#define CAMERA_MODEL_M5STACK_PSRAM
#define CAMERA_MODEL_AI_THINKER
#define CAMERA_MODEL_AI_THINKER


const char* ssid = "Aidan's iPhone";
const char* ssid = "Aidan's iPhone";
const char* password = "cloudyelephant230";
const char* password = "cloudyelephant230";




#if defined(CAMERA_MODEL_WROVER_KIT)
#if defined(CAMERA_MODEL_WROVER_KIT)
#define PWDN_GPIO_NUM -1
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 21
#define XCLK_GPIO_NUM 21
#define SIOD_GPIO_NUM 26
#define SIOD_GPIO_NUM 26
#define SIOC_GPIO_NUM 27
#define SIOC_GPIO_NUM 27


#define Y9_GPIO_NUM 35
#define Y9_GPIO_NUM 35
#define Y8_GPIO_NUM 34
#define Y8_GPIO_NUM 34
#define Y7_GPIO_NUM 39
#define Y7_GPIO_NUM 39
#define Y6_GPIO_NUM 36
#define Y6_GPIO_NUM 36
#define Y5_GPIO_NUM 19
#define Y5_GPIO_NUM 19
#define Y4_GPIO_NUM 18
#define Y4_GPIO_NUM 18
#define Y3_GPIO_NUM 5
#define Y3_GPIO_NUM 5
#define Y2_GPIO_NUM 4
#define Y2_GPIO_NUM 4
#define VSYNC_GPIO_NUM 25
#define VSYNC_GPIO_NUM 25
#define HREF_GPIO_NUM 23
#define HREF_GPIO_NUM 23
#define PCLK_GPIO_NUM 22
#define PCLK_GPIO_NUM 22




#elif defined(CAMERA_MODEL_AI_THINKER)
#elif defined(CAMERA_MODEL_AI_THINKER)
#define PWDN_GPIO_NUM 32
#define PWDN_GPIO_NUM 32
#define RESET_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 0
#define XCLK_GPIO_NUM 0
#define SIOD_GPIO_NUM 26
#define SIOD_GPIO_NUM 26
#define SIOC_GPIO_NUM 27
#define SIOC_GPIO_NUM 27


#define Y9_GPIO_NUM 35
#define Y9_GPIO_NUM 35
#define Y8_GPIO_NUM 34
#define Y8_GPIO_NUM 34
#define Y7_GPIO_NUM 39
#define Y7_GPIO_NUM 39
#define Y6_GPIO_NUM 36
#define Y6_GPIO_NUM 36
#define Y5_GPIO_NUM 21
#define Y5_GPIO_NUM 21
#define Y4_GPIO_NUM 19
#define Y4_GPIO_NUM 19
#define Y3_GPIO_NUM 18
#define Y3_GPIO_NUM 18
#define Y2_GPIO_NUM 5
#define Y2_GPIO_NUM 5
#define VSYNC_GPIO_NUM 25
#define VSYNC_GPIO_NUM 25
#define HREF_GPIO_NUM 23
#define HREF_GPIO_NUM 23
#define PCLK_GPIO_NUM 22
#define PCLK_GPIO_NUM 22


#else
#else
#error "Camera model not selected"
#error "Camera model not selected"
#endif
#endif


// GPIO Setting
// GPIO Setting
// ser1 left ser2 right
// ser1 left ser2 right
extern int gpLed = 4; // Light
extern int gpLed = 4; // Light
extern String WiFiAddr ="";
extern String WiFiAddr ="";
void startCameraServer();
void startCameraServer();


void setup() {
void setup() {
Serial.begin(115200);
Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.setDebugOutput(true);
Serial.println();
Serial.println();
pinMode(gpLed, OUTPUT); //Light
pinMode(gpLed, OUTPUT); //Light


dservo1.attach(dservo1pin);
dservo2.attach(dservo2pin);
dservo3.attach(dservo3pin);
dservo4.attach(dservo4pin);
servo1.attach(servo1Pin);
servo2.attach(servo2Pin);
delay(50);
dservo1.detach();
dservo2.detach();
dservo3.detach();
dservo4.detach();

//initialize
//initialize
digitalWrite(gpLed, LOW);
digitalWrite(gpLed, LOW);


camera_config_t config;
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
config.pin_href = HREF_GPIO_NUM;
config.pin_href = HREF_GPIO_NUM;
config.pin_sscb_sda = SIOD_GPIO_NUM;
config.pin_sscb_sda = SIOD_GPIO_NUM;
config.pin_sscb_scl = SIOC_GPIO_NUM;
config.pin_sscb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000;
config.xclk_freq_hz = 20000000;
config.pixel_format = PIXFORMAT_JPEG;
config.pixel_format = PIXFORMAT_JPEG;
//init with high specs to pre-allocate larger buffers
//init with high specs to pre-allocate larger buffers
if(psramFound()){
if(psramFound()){
config.frame_size = FRAMESIZE_UXGA;
config.frame_size = FRAMESIZE_UXGA;
config.jpeg_quality = 10;
config.jpeg_quality = 10;
config.fb_count = 2;
config.fb_count = 2;
} else {
} else {
config.frame_size = FRAMESIZE_SVGA;
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 12;
config.jpeg_quality = 12;
config.fb_count = 1;
config.fb_count = 1;
}
}


// camera init
// camera init
esp_err_t err = esp_camera_init(&config);
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
if (err != ESP_OK) {
Serial.printf("Camera init failed with error 0x%x", err);
Serial.printf("Camera init failed with error 0x%x", err);
return;
return;
}
}


//drop down frame size for higher initial frame rate
//drop down frame size for higher initial frame rate
sensor_t * s = esp_camera_sensor_get();
sensor_t * s = esp_camera_sensor_get();
s->set_framesize(s, FRAMESIZE_CIF);
s->set_framesize(s, FRAMESIZE_CIF);


WiFi.begin(ssid, password);
WiFi.begin(ssid, password);


while (WiFi.status() != WL_CONNECTED) {
while (WiFi.status() != WL_CONNECTED) {
delay(500);
delay(500);
Serial.print(".");
Serial.print(".");
}
}
Serial.println("");
Serial.println("");
Serial.println("WiFi connected");
Serial.println("WiFi connected");


startCameraServer();
startCameraServer();


Serial.print("Camera Ready! Use 'http://");
Serial.print("Camera Ready! Use 'http://");
Serial.print(WiFi.localIP());
Serial.print(WiFi.localIP());
WiFiAddr = WiFi.localIP().toString();
WiFiAddr = WiFi.localIP().toString();
Serial.println("' to connect");
Serial.println("' to connect");
}
}


void loop() { // put your main code here, to run repeatedly:
void loop() { // put your main code here, to run repeatedly:
}
}


//TAB 2: HTML Webpage
//TAB2:

// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
#include "esp_http_server.h"
#include "esp_http_server.h"
#include "esp_timer.h"
#include "esp_timer.h"
#include "esp_camera.h"
#include "esp_camera.h"
#include "img_converters.h"
#include "img_converters.h"
#include "camera_index.h"
#include "camera_index.h"
#include "Arduino.h"
#include "Arduino.h"
#include <Servo.h>
#include <Servo.h>
static const int servoPin1 = 12;
static const int dservo1Pin = 15;
static const int servoPin2 = 13;
static const int dservo2Pin = 14;
extern Servo servo1; // create servo object to control a servo
static const int dservo3Pin = 0;
static const int dservo4Pin = 16;
static const int servo1Pin = 12;
static const int servo2Pin = 13;
extern Servo servo1;
extern Servo servo2;
extern Servo servo2;
extern Servo dservo1;
extern Servo dservo2;
extern Servo dservo3;
extern Servo dservo4;




extern int gpLed;
extern int gpLed;
extern String WiFiAddr;
extern String WiFiAddr;


typedef struct {
typedef struct {
size_t size; //number of values used for filtering
size_t size; //number of values used for filtering
size_t index; //current value index
size_t index; //current value index
size_t count; //value count
size_t count; //value count
int sum;
int sum;
int * values; //array to be filled with values
int * values; //array to be filled with values
} ra_filter_t;
} ra_filter_t;


typedef struct {
typedef struct {
httpd_req_t *req;
httpd_req_t *req;
size_t len;
size_t len;
} jpg_chunking_t;
} jpg_chunking_t;


#define PART_BOUNDARY "123456789000000000000987654321"
#define PART_BOUNDARY "123456789000000000000987654321"
static const char* _STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY;
static const char* _STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY;
static const char* _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n";
static const char* _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n";
static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n";
static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n";


static ra_filter_t ra_filter;
static ra_filter_t ra_filter;
httpd_handle_t stream_httpd = NULL;
httpd_handle_t stream_httpd = NULL;
httpd_handle_t camera_httpd = NULL;
httpd_handle_t camera_httpd = NULL;


static ra_filter_t * ra_filter_init(ra_filter_t * filter, size_t sample_size){
static ra_filter_t * ra_filter_init(ra_filter_t * filter, size_t sample_size){
memset(filter, 0, sizeof(ra_filter_t));
memset(filter, 0, sizeof(ra_filter_t));


filter->values = (int *)malloc(sample_size * sizeof(int));
filter->values = (int *)malloc(sample_size * sizeof(int));
if(!filter->values){
if(!filter->values){
return NULL;
return NULL;
}
}
memset(filter->values, 0, sample_size * sizeof(int));
memset(filter->values, 0, sample_size * sizeof(int));


filter->size = sample_size;
filter->size = sample_size;
return filter;
return filter;
}
}


static int ra_filter_run(ra_filter_t * filter, int value){
static int ra_filter_run(ra_filter_t * filter, int value){
if(!filter->values){
if(!filter->values){
return value;
return value;
}
}
filter->sum -= filter->values[filter->index];
filter->sum -= filter->values[filter->index];
filter->values[filter->index] = value;
filter->values[filter->index] = value;
filter->sum += filter->values[filter->index];
filter->sum += filter->values[filter->index];
filter->index++;
filter->index++;
filter->index = filter->index % filter->size;
filter->index = filter->index % filter->size;
if (filter->count < filter->size) {
if (filter->count < filter->size) {
filter->count++;
filter->count++;
}
}
return filter->sum / filter->count;
return filter->sum / filter->count;
}
}


static size_t jpg_encode_stream(void * arg, size_t index, const void* data, size_t len){
static size_t jpg_encode_stream(void * arg, size_t index, const void* data, size_t len){
jpg_chunking_t *j = (jpg_chunking_t *)arg;
jpg_chunking_t *j = (jpg_chunking_t *)arg;
if(!index){
if(!index){
j->len = 0;
j->len = 0;
}
}
if(httpd_resp_send_chunk(j->req, (const char *)data, len) != ESP_OK){
if(httpd_resp_send_chunk(j->req, (const char *)data, len) != ESP_OK){
return 0;
return 0;
}
}
j->len += len;
j->len += len;
return len;
return len;
}
}


static esp_err_t capture_handler(httpd_req_t *req){
static esp_err_t capture_handler(httpd_req_t *req){
camera_fb_t * fb = NULL;
camera_fb_t * fb = NULL;
esp_err_t res = ESP_OK;
esp_err_t res = ESP_OK;
int64_t fr_start = esp_timer_get_time();
int64_t fr_start = esp_timer_get_time();


fb = esp_camera_fb_get();
fb = esp_camera_fb_get();
if (!fb) {
if (!fb) {
Serial.printf("Camera capture failed");
Serial.printf("Camera capture failed");
httpd_resp_send_500(req);
httpd_resp_send_500(req);
return ESP_FAIL;
return ESP_FAIL;
}
}


httpd_resp_set_type(req, "image/jpeg");
httpd_resp_set_type(req, "image/jpeg");
httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=capture.jpg");
httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=capture.jpg");


size_t fb_len = 0;
size_t fb_len = 0;
if(fb->format == PIXFORMAT_JPEG){
if(fb->format == PIXFORMAT_JPEG){
fb_len = fb->len;
fb_len = fb->len;
res = httpd_resp_send(req, (const char *)fb->buf, fb->len);
res = httpd_resp_send(req, (const char *)fb->buf, fb->len);
} else {
} else {
jpg_chunking_t jchunk = {req, 0};
jpg_chunking_t jchunk = {req, 0};
res = frame2jpg_cb(fb, 80, jpg_encode_stream, &jchunk)?ESP_OK:ESP_FAIL;
res = frame2jpg_cb(fb, 80, jpg_encode_stream, &jchunk)?ESP_OK:ESP_FAIL;
httpd_resp_send_chunk(req, NULL, 0);
httpd_resp_send_chunk(req, NULL, 0);
fb_len = jchunk.len;
fb_len = jchunk.len;
}
}
esp_camera_fb_return(fb);
esp_camera_fb_return(fb);
int64_t fr_end = esp_timer_get_time();
int64_t fr_end = esp_timer_get_time();
Serial.printf("JPG: %uB %ums", (uint32_t)(fb_len), (uint32_t)((fr_end - fr_start)/1000));
Serial.printf("JPG: %uB %ums", (uint32_t)(fb_len), (uint32_t)((fr_end - fr_start)/1000));
return res;
return res;
}
}


static esp_err_t stream_handler(httpd_req_t *req){
static esp_err_t stream_handler(httpd_req_t *req){
camera_fb_t * fb = NULL;
camera_fb_t * fb = NULL;
esp_err_t res = ESP_OK;
esp_err_t res = ESP_OK;
size_t _jpg_buf_len = 0;
size_t _jpg_buf_len = 0;
uint8_t * _jpg_buf = NULL;
uint8_t * _jpg_buf = NULL;
char * part_buf[64];
char * part_buf[64];


static int64_t last_frame = 0;
static int64_t last_frame = 0;
if(!last_frame) {
if(!last_frame) {
last_frame = esp_timer_get_time();
last_frame = esp_timer_get_time();
}
}


res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);
res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);
if(res != ESP_OK){
if(res != ESP_OK){
return res;
return res;
}
}


while(true){
while(true){
fb = esp_camera_fb_get();
fb = esp_camera_fb_get();
if (!fb) {
if (!fb) {
Serial.printf("Camera capture failed");
Serial.printf("Camera capture failed");
res = ESP_FAIL;
res = ESP_FAIL;
} else {
} else {
if(fb->format != PIXFORMAT_JPEG){
if(fb->format != PIXFORMAT_JPEG){
bool jpeg_converted = frame2jpg(fb, 80, &_jpg_buf, &_jpg_buf_len);
bool jpeg_converted = frame2jpg(fb, 80, &_jpg_buf, &_jpg_buf_len);
esp_camera_fb_return(fb);
esp_camera_fb_return(fb);
fb = NULL;
fb = NULL;
if(!jpeg_converted){
if(!jpeg_converted){
Serial.printf("JPEG compression failed");
Serial.printf("JPEG compression failed");
res = ESP_FAIL;
res = ESP_FAIL;
}
}
} else {
} else {
_jpg_buf_len = fb->len;
_jpg_buf_len = fb->len;
_jpg_buf = fb->buf;
_jpg_buf = fb->buf;
}
}
}
}
if(res == ESP_OK){
if(res == ESP_OK){
size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);
size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);
res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);
res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);
}
}
if(res == ESP_OK){
if(res == ESP_OK){
res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);
res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);
}
}
if(res == ESP_OK){
if(res == ESP_OK){
res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));
res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));
}
}
if(fb){
if(fb){
esp_camera_fb_return(fb);
esp_camera_fb_return(fb);
fb = NULL;
fb = NULL;
_jpg_buf = NULL;
_jpg_buf = NULL;
} else if(_jpg_buf){
} else if(_jpg_buf){
free(_jpg_buf);
free(_jpg_buf);
_jpg_buf = NULL;
_jpg_buf = NULL;
}
}
if(res != ESP_OK){
if(res != ESP_OK){
break;
break;
}
}
int64_t fr_end = esp_timer_get_time();
int64_t fr_end = esp_timer_get_time();


int64_t frame_time = fr_end - last_frame;
int64_t frame_time = fr_end - last_frame;
last_frame = fr_end;
last_frame = fr_end;
frame_time /= 1000;
frame_time /= 1000;
uint32_t avg_frame_time = ra_filter_run(&ra_filter, frame_time);
uint32_t avg_frame_time = ra_filter_run(&ra_filter, frame_time);
Serial.printf("MJPG: %uB %ums (%.1ffps), AVG: %ums (%.1ffps)"
Serial.printf("MJPG: %uB %ums (%.1ffps), AVG: %ums (%.1ffps)"
,(uint32_t)(_jpg_buf_len),
,(uint32_t)(_jpg_buf_len),
(uint32_t)frame_time, 1000.0 / (uint32_t)frame_time,
(uint32_t)frame_time, 1000.0 / (uint32_t)frame_time,
avg_frame_time, 1000.0 / avg_frame_time
avg_frame_time, 1000.0 / avg_frame_time
);
);
}
}


last_frame = 0;
last_frame = 0;
return res;
return res;
}
}


static esp_err_t cmd_handler(httpd_req_t *req){
static esp_err_t cmd_handler(httpd_req_t *req){
char* buf;
char* buf;
size_t buf_len;
size_t buf_len;
char variable[32] = {0,};
char variable[32] = {0,};
char value[32] = {0,};
char value[32] = {0,};


buf_len = httpd_req_get_url_query_len(req) + 1;
buf_len = httpd_req_get_url_query_len(req) + 1;
if (buf_len > 1) {
if (buf_len > 1) {
buf = (char*)malloc(buf_len);
buf = (char*)malloc(buf_len);
if(!buf){
if(!buf){
httpd_resp_send_500(req);
httpd_resp_send_500(req);
return ESP_FAIL;
return ESP_FAIL;
}
}
if (httpd_req_get_url_query_str(req, buf, buf_len) == ESP_OK) {
if (httpd_req_get_url_query_str(req, buf, buf_len) == ESP_OK) {
if (httpd_query_key_value(buf, "var", variable, sizeof(variable)) == ESP_OK &&
if (httpd_query_key_value(buf, "var", variable, sizeof(variable)) == ESP_OK &&
httpd_query_key_value(buf, "val", value, sizeof(value)) == ESP_OK) {
httpd_query_key_value(buf, "val", value, sizeof(value)) == ESP_OK) {
} else {
} else {
free(buf);
free(buf);
httpd_resp_send_404(req);
httpd_resp_send_404(req);
return ESP_FAIL;
return ESP_FAIL;
}
}
} else {
} else {
free(buf);
free(buf);
httpd_resp_send_404(req);
httpd_resp_send_404(req);
return ESP_FAIL;
return ESP_FAIL;
}
}
free(buf);
free(buf);
} else {
} else {
httpd_resp_send_404(req);
httpd_resp_send_404(req);
return ESP_FAIL;
return ESP_FAIL;
}
}


int val = atoi(value);
int val = atoi(value);
sensor_t * s = esp_camera_sensor_get();
sensor_t * s = esp_camera_sensor_get();
int res = 0;
int res = 0;


if(!strcmp(variable, "framesize")) {
if(!strcmp(variable, "framesize")) {
if(s->pixformat == PIXFORMAT_JPEG) res = s->set_framesize(s, (framesize_t)val);
if(s->pixformat == PIXFORMAT_JPEG) res = s->set_framesize(s, (framesize_t)val);
}
}
else if(!strcmp(variable, "quality")) res = s->set_quality(s, val);
else if(!strcmp(variable, "quality")) res = s->set_quality(s, val);
else if(!strcmp(variable, "contrast")) res = s->set_contrast(s, val);
else if(!strcmp(variable, "contrast")) res = s->set_contrast(s, val);
else if(!strcmp(variable, "brightness")) res = s->set_brightness(s, val);
else if(!strcmp(variable, "brightness")) res = s->set_brightness(s, val);
else if(!strcmp(variable, "saturation")) res = s->set_saturation(s, val);
else if(!strcmp(variable, "saturation")) res = s->set_saturation(s, val);
else if(!strcmp(variable, "gainceiling")) res = s->set_gainceiling(s, (gainceiling_t)val);
else if(!strcmp(variable, "gainceiling")) res = s->set_gainceiling(s, (gainceiling_t)val);
else if(!strcmp(variable, "colorbar")) res = s->set_colorbar(s, val);
else if(!strcmp(variable, "colorbar")) res = s->set_colorbar(s, val);
else if(!strcmp(variable, "awb")) res = s->set_whitebal(s, val);
else if(!strcmp(variable, "awb")) res = s->set_whitebal(s, val);
else if(!strcmp(variable, "agc")) res = s->set_gain_ctrl(s, val);
else if(!strcmp(variable, "agc")) res = s->set_gain_ctrl(s, val);
else if(!strcmp(variable, "aec")) res = s->set_exposure_ctrl(s, val);
else if(!strcmp(variable, "aec")) res = s->set_exposure_ctrl(s, val);
else if(!strcmp(variable, "hmirror")) res = s->set_hmirror(s, val);
else if(!strcmp(variable, "hmirror")) res = s->set_hmirror(s, val);
else if(!strcmp(variable, "vflip")) res = s->set_vflip(s, val);
else if(!strcmp(variable, "vflip")) res = s->set_vflip(s, val);
else if(!strcmp(variable, "awb_gain")) res = s->set_awb_gain(s, val);
else if(!strcmp(variable, "awb_gain")) res = s->set_awb_gain(s, val);
else if(!strcmp(variable, "agc_gain")) res = s->set_agc_gain(s, val);
else if(!strcmp(variable, "agc_gain")) res = s->set_agc_gain(s, val);
else if(!strcmp(variable, "aec_value")) res = s->set_aec_value(s, val);
else if(!strcmp(variable, "aec_value")) res = s->set_aec_value(s, val);
else if(!strcmp(variable, "aec2")) res = s->set_aec2(s, val);
else if(!strcmp(variable, "aec2")) res = s->set_aec2(s, val);
else if(!strcmp(variable, "dcw")) res = s->set_dcw(s, val);
else if(!strcmp(variable, "dcw")) res = s->set_dcw(s, val);
else if(!strcmp(variable, "bpc")) res = s->set_bpc(s, val);
else if(!strcmp(variable, "bpc")) res = s->set_bpc(s, val);
else if(!strcmp(variable, "wpc")) res = s->set_wpc(s, val);
else if(!strcmp(variable, "wpc")) res = s->set_wpc(s, val);
else if(!strcmp(variable, "raw_gma")) res = s->set_raw_gma(s, val);
else if(!strcmp(variable, "raw_gma")) res = s->set_raw_gma(s, val);
else if(!strcmp(variable, "lenc")) res = s->set_lenc(s, val);
else if(!strcmp(variable, "lenc")) res = s->set_lenc(s, val);
else if(!strcmp(variable, "special_effect")) res = s->set_special_effect(s, val);
else if(!strcmp(variable, "special_effect")) res = s->set_special_effect(s, val);
else if(!strcmp(variable, "wb_mode")) res = s->set_wb_mode(s, val);
else if(!strcmp(variable, "wb_mode")) res = s->set_wb_mode(s, val);
else if(!strcmp(variable, "ae_level")) res = s->set_ae_level(s, val);
else if(!strcmp(variable, "ae_level")) res = s->set_ae_level(s, val);
else {
else {
res = -1;
res = -1;
}
}


if(res){
if(res){
return httpd_resp_send_500(req);
return httpd_resp_send_500(req);
}
}


httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
return httpd_resp_send(req, NULL, 0);
return httpd_resp_send(req, NULL, 0);
}
}


static esp_err_t status_handler(httpd_req_t *req){
static esp_err_t status_handler(httpd_req_t *req){
static char json_response[1024];
static char json_response[1024];


sensor_t * s = esp_camera_sensor_get();
sensor_t * s = esp_camera_sensor_get();
char * p = json_response;
char * p = json_response;
*p++ = '{';
*p++ = '{';


p+=sprintf(p, "\"framesize\":%u,", s->status.framesize);
p+=sprintf(p, "\"framesize\":%u,", s->status.framesize);
p+=sprintf(p, "\"quality\":%u,", s->status.quality);
p+=sprintf(p, "\"quality\":%u,", s->status.quality);
p+=sprintf(p, "\"brightness\":%d,", s->status.brightness);
p+=sprintf(p, "\"brightness\":%d,", s->status.brightness);
p+=sprintf(p, "\"contrast\":%d,", s->status.contrast);
p+=sprintf(p, "\"contrast\":%d,", s->status.contrast);
p+=sprintf(p, "\"saturation\":%d,", s->status.saturation);
p+=sprintf(p, "\"saturation\":%d,", s->status.saturation);
p+=sprintf(p, "\"special_effect\":%u,", s->status.special_effect);
p+=sprintf(p, "\"special_effect\":%u,", s->status.special_effect);
p+=sprintf(p, "\"wb_mode\":%u,", s->status.wb_mode);
p+=sprintf(p, "\"wb_mode\":%u,", s->status.wb_mode);
p+=sprintf(p, "\"awb\":%u,", s->status.awb);
p+=sprintf(p, "\"awb\":%u,", s->status.awb);
p+=sprintf(p, "\"awb_gain\":%u,", s->status.awb_gain);
p+=sprintf(p, "\"awb_gain\":%u,", s->status.awb_gain);
p+=sprintf(p, "\"aec\":%u,", s->status.aec);
p+=sprintf(p, "\"aec\":%u,", s->status.aec);
p+=sprintf(p, "\"aec2\":%u,", s->status.aec2);
p+=sprintf(p, "\"aec2\":%u,", s->status.aec2);
p+=sprintf(p, "\"ae_level\":%d,", s->status.ae_level);
p+=sprintf(p, "\"ae_level\":%d,", s->status.ae_level);
p+=sprintf(p, "\"aec_value\":%u,", s->status.aec_value);
p+=sprintf(p, "\"aec_value\":%u,", s->status.aec_value);
p+=sprintf(p, "\"agc\":%u,", s->status.agc);
p+=sprintf(p, "\"agc\":%u,", s->status.agc);
p+=sprintf(p, "\"agc_gain\":%u,", s->status.agc_gain);
p+=sprintf(p, "\"agc_gain\":%u,", s->status.agc_gain);
p+=sprintf(p, "\"gainceiling\":%u,", s->status.gainceiling);
p+=sprintf(p, "\"gainceiling\":%u,", s->status.gainceiling);
p+=sprintf(p, "\"bpc\":%u,", s->status.bpc);
p+=sprintf(p, "\"bpc\":%u,", s->status.bpc);
p+=sprintf(p, "\"wpc\":%u,", s->status.wpc);
p+=sprintf(p, "\"wpc\":%u,", s->status.wpc);
p+=sprintf(p, "\"raw_gma\":%u,", s->status.raw_gma);
p+=sprintf(p, "\"raw_gma\":%u,", s->status.raw_gma);
p+=sprintf(p, "\"lenc\":%u,", s->status.lenc);
p+=sprintf(p, "\"lenc\":%u,", s->status.lenc);
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++ = '}';
*p++ = '}';
*p++ = 0;
*p++ = 0;
httpd_resp_set_type(req, "application/json");
httpd_resp_set_type(req, "application/json");
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
return httpd_resp_send(req, json_response, strlen(json_response));
return httpd_resp_send(req, json_response, strlen(json_response));
}
}


static esp_err_t index_handler(httpd_req_t *req){
static esp_err_t index_handler(httpd_req_t *req){
httpd_resp_set_type(req, "text/html");
httpd_resp_set_type(req, "text/html");
String page = "";
String page = "";
page += "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\">\n";
page += "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\">\n";
page += "<script>var xhttp = new XMLHttpRequest();</script>";
page += "<script>var xhttp = new XMLHttpRequest();</script>";
page += "<script>function getsend(arg) { xhttp.open('GET', arg +'?' + new Date().getTime(), true); xhttp.send() } </script>";
page += "<script>function getsend(arg) { xhttp.open('GET', arg +'?' + new Date().getTime(), true); xhttp.send() } </script>";
//page += "<p align=center><IMG SRC='http://" + WiFiAddr + ":81/stream' style='width:280px;'></p><br/><br/>";
//page += "<p align=center><IMG SRC='http://" + WiFiAddr + ":81/stream' style='width:280px;'></p><br/><br/>";
page += "<p align=center><IMG SRC='http://" + WiFiAddr + ":81/stream' style='width:300px; transform:rotate(180deg);'></p><br/><br/>";
page += "<p align=center><IMG SRC='http://" + WiFiAddr + ":81/stream' style='width:300px; transform:rotate(180deg);'></p><br/><br/>";
page += "<p align=center> <button style=width:90px;height:80px onmousedown=getsend('go') onmouseup=getsend('stop') ontouchstart=getsend('go') ontouchend=getsend('stop') ></button> </p>";
page += "<p align=center> <button style=width:90px;height:80px onmousedown=getsend('go') onmouseup=getsend('stop') ontouchstart=getsend('go') ontouchend=getsend('stop') ></button> </p>";
page += "<p align=center>";
page += "<p align=center>";
page += "<button style=width:90px;height:80px onmousedown=getsend('left') onmouseup=getsend('stop') ontouchstart=getsend('left') ontouchend=getsend('stop')></button>&nbsp;";
page += "<button style=width:90px;height:80px onmousedown=getsend('left') onmouseup=getsend('stop') ontouchstart=getsend('left') ontouchend=getsend('stop')></button>&nbsp;";
page += "<button style=width:90px;height:80px onmousedown=getsend('stop') onmouseup=getsend('stop')></button>&nbsp;";
page += "<button style=width:90px;height:80px onmousedown=getsend('stop') onmouseup=getsend('stop')></button>&nbsp;";
page += "<button style=width:90px;height:80px onmousedown=getsend('right') onmouseup=getsend('stop') ontouchstart=getsend('right') ontouchend=getsend('stop')></button>";
page += "<button style=width:90px;height:80px onmousedown=getsend('right') onmouseup=getsend('stop') ontouchstart=getsend('right') ontouchend=getsend('stop')></button>";
page += "</p>";
page += "</p>";


page += "<p align=center><button style=width:90px;height:80px onmousedown=getsend('back') onmouseup=getsend('stop') ontouchstart=getsend('back') ontouchend=getsend('stop') ></button></p>";
page += "<p align=center><button style=width:90px;height:80px onmousedown=getsend('back') onmouseup=getsend('stop') ontouchstart=getsend('back') ontouchend=getsend('stop') ></button></p>";


page += "<p align=center>";
page += "<p align=center>";
page += "<button style=width:140px;height:40px onmousedown=getsend('ledon')>LED ON</button>";
page += "<button style=width:140px;height:40px onmousedown=getsend('ledon')>LED ON</button>";
page += "<button style=width:140px;height:40px onmousedown=getsend('ledoff')>LED OFF</button>";
page += "<button style=width:140px;height:40px onmousedown=getsend('ledoff')>LED OFF</button>";
page += "</p>";
page += "</p>";
return httpd_resp_send(req, &page[0], strlen(&page[0]));
return httpd_resp_send(req, &page[0], strlen(&page[0]));
}
}


static esp_err_t go_handler(httpd_req_t *req){
static esp_err_t go_handler(httpd_req_t *req){
servo1.write(0); servo2.write(180);
servo1.write(0); servo2.write(180);
Serial.println("Go");
Serial.println("Go");
httpd_resp_set_type(req, "text/html");
httpd_resp_set_type(req, "text/html");
return httpd_resp_send(req, "OK", 2);
return httpd_resp_send(req, "OK", 2);
}
}
static esp_err_t back_handler(httpd_req_t *req){
static esp_err_t back_handler(httpd_req_t *req){
servo1.write(180); servo2.write(0);
servo1.write(180); servo2.write(0);
Serial.println("Back");
Serial.println("Back");
httpd_resp_set_type(req, "text/html");
httpd_resp_set_type(req, "text/html");
return httpd_resp_send(req, "OK", 2);
return httpd_resp_send(req, "OK", 2);
}
}


static esp_err_t left_handler(httpd_req_t *req){
static esp_err_t left_handler(httpd_req_t *req){
servo1.write(180); servo2.write(180);
servo1.write(180); servo2.write(180);
Serial.println("Left");
Serial.println("Left");
httpd_resp_set_type(req, "text/html");
httpd_resp_set_type(req, "text/html");
return httpd_resp_send(req, "OK", 2);
return httpd_resp_send(req, "OK", 2);
}
}
static esp_err_t right_handler(httpd_req_t *req){
static esp_err_t right_handler(httpd_req_t *req){
servo1.write(0); servo2.write(0);
servo1.write(0); servo2.write(0);
Serial.println("Right");
Serial.println("Right");
httpd_resp_set_type(req, "text/html");
httpd_resp_set_type(req, "text/html");
return httpd_resp_send(req, "OK", 2);
return httpd_resp_send(req, "OK", 2);
}
}


static esp_err_t stop_handler(httpd_req_t *req){
static esp_err_t stop_handler(httpd_req_t *req){
servo1.write(90); servo2.write(79);
servo1.write(90); servo2.write(79);
Serial.println("Stop");
Serial.println("Stop");
httpd_resp_set_type(req, "text/html");
httpd_resp_set_type(req, "text/html");
return httpd_resp_send(req, "OK", 2);
return httpd_resp_send(req, "OK", 2);
}
}


static esp_err_t ledon_handler(httpd_req_t *req){
static esp_err_t ledon_handler(httpd_req_t *req){
digitalWrite(gpLed, HIGH);
digitalWrite(gpLed, HIGH);
Serial.println("LED ON");
Serial.println("LED ON");
httpd_resp_set_type(req, "text/html");
httpd_resp_set_type(req, "text/html");
return httpd_resp_send(req, "OK", 2);
return httpd_resp_send(req, "OK", 2);
}
}
static esp_err_t ledoff_handler(httpd_req_t *req){
static esp_err_t ledoff_handler(httpd_req_t *req){
digitalWrite(gpLed, LOW);
digitalWrite(gpLed, LOW);
Serial.println("LED OFF");
Serial.println("LED OFF");
httpd_resp_set_type(req, "text/html");
httpd_resp_set_type(req, "text/html");
return httpd_resp_send(req, "OK", 2);
return httpd_resp_send(req, "OK", 2);
}
}


void startCameraServer(){
void startCameraServer(){
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
httpd_config_t config = HTTPD_DEFAULT_CONFIG();


httpd_uri_t go_uri = {
httpd_uri_t go_uri = {
.uri = "/go",
.uri = "/go",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = go_handler,
.handler = go_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};


httpd_uri_t back_uri = {
httpd_uri_t back_uri = {
.uri = "/back",
.uri = "/back",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = back_handler,
.handler = back_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};


httpd_uri_t stop_uri = {
httpd_uri_t stop_uri = {
.uri = "/stop",
.uri = "/stop",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = stop_handler,
.handler = stop_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};


httpd_uri_t left_uri = {
httpd_uri_t left_uri = {
.uri = "/left",
.uri = "/left",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = left_handler,
.handler = left_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};
httpd_uri_t right_uri = {
httpd_uri_t right_uri = {
.uri = "/right",
.uri = "/right",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = right_handler,
.handler = right_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};
httpd_uri_t ledon_uri = {
httpd_uri_t ledon_uri = {
.uri = "/ledon",
.uri = "/ledon",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = ledon_handler,
.handler = ledon_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};
httpd_uri_t ledoff_uri = {
httpd_uri_t ledoff_uri = {
.uri = "/ledoff",
.uri = "/ledoff",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = ledoff_handler,
.handler = ledoff_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};


httpd_uri_t index_uri = {
httpd_uri_t index_uri = {
.uri = "/",
.uri = "/",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = index_handler,
.handler = index_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};


httpd_uri_t status_uri = {
httpd_uri_t status_uri = {
.uri = "/status",
.uri = "/status",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = status_handler,
.handler = status_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};


httpd_uri_t cmd_uri = {
httpd_uri_t cmd_uri = {
.uri = "/control",
.uri = "/control",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = cmd_handler,
.handler = cmd_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};


httpd_uri_t capture_uri = {
httpd_uri_t capture_uri = {
.uri = "/capture",
.uri = "/capture",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = capture_handler,
.handler = capture_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};


httpd_uri_t stream_uri = {
httpd_uri_t stream_uri = {
.uri = "/stream",
.uri = "/stream",
.method = HTTP_GET,
.method = HTTP_GET,
.handler = stream_handler,
.handler = stream_handler,
.user_ctx = NULL
.user_ctx = NULL
};
};




ra_filter_init(&ra_filter, 20);
ra_filter_init(&ra_filter, 20);
Serial.printf("Starting web server on port: '%d'", config.server_port);
Serial.printf("Starting web server on port: '%d'", config.server_port);
if (httpd_start(&camera_httpd, &config) == ESP_OK) {
if (httpd_start(&camera_httpd, &config) == ESP_OK) {
httpd_register_uri_handler(camera_httpd, &index_uri);
httpd_register_uri_handler(camera_httpd, &index_uri);
httpd_register_uri_handler(camera_httpd, &go_uri);
httpd_register_uri_handler(camera_httpd, &go_uri);
httpd_register_uri_handler(camera_httpd, &back_uri);
httpd_register_uri_handler(camera_httpd, &back_uri);
httpd_register_uri_handler(camera_httpd, &stop_uri);
httpd_register_uri_handler(camera_httpd, &stop_uri);
httpd_register_uri_handler(camera_httpd, &left_uri);
httpd_register_uri_handler(camera_httpd, &left_uri);
httpd_register_uri_handler(camera_httpd, &right_uri);
httpd_register_uri_handler(camera_httpd, &right_uri);
httpd_register_uri_handler(camera_httpd, &ledon_uri);
httpd_register_uri_handler(camera_httpd, &ledon_uri);
httpd_register_uri_handler(camera_httpd, &ledoff_uri);
httpd_register_uri_handler(camera_httpd, &ledoff_uri);
}
}


config.server_port += 1;
config.server_port += 1;
config.ctrl_port += 1;
config.ctrl_port += 1;
Serial.printf("Starting stream server on port: '%d'", config.server_port);
Serial.printf("Starting stream server on port: '%d'", config.server_port);
if (httpd_start(&stream_httpd, &config) == ESP_OK) {
if (httpd_start(&stream_httpd, &config) == ESP_OK) {
httpd_register_uri_handler(stream_httpd, &stream_uri);
httpd_register_uri_handler(stream_httpd, &stream_uri);
}
}
servo1.attach(servoPin1);
servo2.attach(servoPin2);
}
}


//TAB 3: Literally just camera settings
TAB3:

//File: index.html.gz, Size: 3635
//File: index.html.gz, Size: 3635
#define index_html_gz_len 3635
#define index_html_gz_len 3635
const uint8_t index_html_gz[] = {
const uint8_t index_html_gz[] = {
0x1F, 0x8B, 0x08, 0x08, 0x8A, 0xF8, 0xFE, 0x5B, 0x00, 0x03, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x2E,
0x1F, 0x8B, 0x08, 0x08, 0x8A, 0xF8, 0xFE, 0x5B, 0x00, 0x03, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x2E,
0x68, 0x74, 0x6D, 0x6C, 0x00, 0xDD, 0x5C, 0xFD, 0x72, 0xDA, 0xB8, 0x16, 0xFF, 0x7F, 0x9F, 0xC2,
0x68, 0x74, 0x6D, 0x6C, 0x00, 0xDD, 0x5C, 0xFD, 0x72, 0xDA, 0xB8, 0x16, 0xFF, 0x7F, 0x9F, 0xC2,
0x71, 0x77, 0x8B, 0x3D, 0x6B, 0x08, 0x10, 0x92, 0xA6, 0x26, 0x90, 0x0D, 0x84, 0xB6, 0x3B, 0xD3,
0x71, 0x77, 0x8B, 0x3D, 0x6B, 0x08, 0x10, 0x92, 0xA6, 0x26, 0x90, 0x0D, 0x84, 0xB6, 0x3B, 0xD3,
0xAF, 0x6D, 0xF6, 0xEE, 0xEE, 0xCC, 0xCE, 0x4E, 0x2B, 0x6C, 0x19, 0xD4, 0x18, 0x8B, 0xDA, 0x72,
0xAF, 0x6D, 0xF6, 0xEE, 0xEE, 0xCC, 0xCE, 0x4E, 0x2B, 0x6C, 0x19, 0xD4, 0x18, 0x8B, 0xDA, 0x72,
0x80, 0xB2, 0x7E, 0x8E, 0xFB, 0x40, 0xF7, 0xC5, 0xEE, 0x91, 0x64, 0x1B, 0x9B, 0x8F, 0x10, 0xA0,
0x80, 0xB2, 0x7E, 0x8E, 0xFB, 0x40, 0xF7, 0xC5, 0xEE, 0x91, 0x64, 0x1B, 0x9B, 0x8F, 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