Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# EloquentEsp32cam
Use your Esp32-cam like an expert

Add option for Seeed Studio Xiao S3 Sense.
Set camera model to cam.xiao() on setup()
6 changes: 1 addition & 5 deletions examples/2_CameraSettings/2_CameraSettings.ino
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/**
* Example 2: Camera Configuration
* This sketch shows the available sensor configurations for the
* Esp32 camera.
* It does nothing: it's only a reference of the available methods
* Include the EloquentEsp32Cam library
*/

#include "esp32cam.h"


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* Example 3: Get your First picture
* This sketch shows the basic code you need to take a picture
* from your Esp32 camera
*/
#define MAX_RESOLUTION_VGA

#include "esp32cam.h"
Expand Down
42 changes: 42 additions & 0 deletions examples/4_Live_Style_Transfer/4_Live_Style_Transfer.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include "esp32cam.h"
#include "esp32cam/http/LiveStyleTransfer.h"

// Replace with your WiFi credentials
#define WIFI_SSID "Your SSID"
#define WIFI_PASS "Your password"

// 80 is the port to listen to
// You can change it to whatever you want, 80 is the default for HTTP
Eloquent::Esp32cam::Cam cam;
Eloquent::Esp32cam::Http::LiveStyleTransfer styleTransfer(cam, 80);


void setup() {
Serial.begin(115200);
delay(3000);
Serial.println("Init");

cam.aithinker();
cam.highQuality();
cam.qvga();

while (!cam.begin())
Serial.println(cam.getErrorMessage());

while (!cam.connect(WIFI_SSID, WIFI_PASS))
Serial.println(cam.getErrorMessage());

//Initialize live style transfer http server
// If something goes wrong, print the error message
while (!styleTransfer.begin())
Serial.println(styleTransfer.getErrorMessage());

cam.viewAt("esp32cam");

// display the IP address of the camera
Serial.println(styleTransfer.getWelcomeMessage());
}


void loop() {
}
25 changes: 8 additions & 17 deletions examples/4_Video_Feed/4_Video_Feed.ino
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
/**
* Example 4: Video Feed over HTTP
* This sketch shows how to access the live camera feed
* from a browser using HTTP
*/
#include "esp32cam.h"
#include "esp32cam/http/LiveFeed.h"

// Replace with your WiFi credentials
#define WIFI_SSID "SSID"
#define WIFI_PASS "PASSWORD"

#define WIFI_SSID "Your SSID"
#define WIFI_PASS "Your password"

// 80 is the port to listen to
// You can change it to whatever you want, 80 is the default for HTTP
Eloquent::Esp32cam::Cam cam;
Eloquent::Esp32cam::Http::LiveFeed feed(cam);
Eloquent::Esp32cam::Http::LiveFeed feed(cam, 80);


/**
*
*/
void setup() {
Serial.begin(115200);
delay(3000);
Expand All @@ -42,17 +35,15 @@ void setup() {
Serial.println(feed.getErrorMessage());

// make the camera accessible at http://esp32cam.local
if (!cam.mDNS("esp32cam"))
if (!cam.viewAt("esp32cam"))
Serial.println("Cannot create alias, use the IP address");
else
Serial.println("Live Feed available at http://esp32cam.local");

// display the IP address of the camera
Serial.println(feed.getWelcomeMessage());
}


/**
*
*/
void loop() {
// do nothing, web server handles the requests
}
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "git",
"url": "https://github.com/eloquentarduino/EloquentEsp32cam"
},
"version": "1.1.2",
"version": "1.1.1",
"authors": {
"name": "Simone Salerno",
"url": "https://github.com/eloquentarduino"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EloquentEsp32cam
version=1.1.2
version=1.1.1
author=Simone Salerno <support@eloquentarduino.com>
maintainer=Simone Salerno <support@eloquentarduino.com>
sentence=Use your Esp32-cam like an expert
Expand Down
12 changes: 0 additions & 12 deletions src/esp32cam/Cam.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "../traits/ConnectsToWiFi.h"
#include "../traits/HasMDNS.h"
#include "../traits/SavesToFilesystem.h"
#include "./features/CloudStorageUploader.h"


namespace Eloquent {
Expand All @@ -39,7 +38,6 @@ namespace Eloquent {
public:
camera_config_t config;
camera_fb_t *frame;
Features::CloudStorageUploader cloudStorageUploader;

/**
*
Expand Down Expand Up @@ -165,16 +163,6 @@ namespace Eloquent {
return SavesToFilesystem::saveTo(fs, filename, frame->buf, frame->len);
}

/**
* Upload current picture to https://esp32camstorage.eloquentarduino.com
*
* @param deviceToken
* @return
*/
bool uploadToCloudStorage(String deviceToken) {
return setErrorMessage(cloudStorageUploader.upload(deviceToken, frame->buf, frame->len));
}

/**
* Get HTTP address of camera
* @param port
Expand Down
4 changes: 2 additions & 2 deletions src/esp32cam/JpegDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ namespace Eloquent {

startBenchmark();

if (status = pjpeg_decode_init(&jpeg, pjpegConsume, (void *) &decoding, 1)) {
if (pjpeg_decode_init(&jpeg, pjegConsume, (void *) &decoding, 1)) {
stopBenchmark();

return this->setErrorMessage(String("Jpeg decode error: ") + status);
return this->setErrorMessage("Jpeg decode error");
}

while ((status = pjpeg_decode_mcu()) != PJPG_NO_MORE_BLOCKS) {
Expand Down
5 changes: 3 additions & 2 deletions src/esp32cam/JpegDecoderGray.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ unsigned char pjpegConsume(unsigned char* dest, unsigned char chunkSize, unsigne

if (!len || (*offset) > len) {
*read = 0;
Serial.println("exit...");
return PJPG_STREAM_READ_ERROR;
}

Expand Down Expand Up @@ -86,10 +87,10 @@ namespace Eloquent {

startBenchmark();

if (status = pjpeg_decode_init(&jpeg, pjpegConsume, (void *) &decoding, 1)) {
if (pjpeg_decode_init(&jpeg, pjpegConsume, (void *) &decoding, 1)) {
stopBenchmark();

return this->setErrorMessage(String("Jpeg decode error: ") + status);
return this->setErrorMessage("Jpeg decode error");
}

while ((status = pjpeg_decode_mcu()) != PJPG_NO_MORE_BLOCKS) {
Expand Down
13 changes: 0 additions & 13 deletions src/esp32cam/apps/ColorBlobDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,6 @@ namespace Eloquent {
return isOk();
}

/**
* Update target color
*
* @param y
* @param cb
* @param cr
*/
void updateColor(uint8_t y, uint8_t cb, uint8_t cr) {
_y = y;
_cb = cb;
_cr = cr;
}

/**
* Detect color blog in Jpeg frame
*
Expand Down
27 changes: 25 additions & 2 deletions src/traits/SetModelPins.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,29 @@ namespace Eloquent {
_pins.flashlight = -1;
}

/**
*
*/
void xiao() {
_pins.d0 = 15;
_pins.d1 = 17;
_pins.d2 = 18;
_pins.d3 = 16;
_pins.d4 = 14;
_pins.d5 = 12;
_pins.d6 = 11;
_pins.d7 = 48;
_pins.xclk = 10;
_pins.pclk = 13;
_pins.vsync = 38;
_pins.href = 47;
_pins.sscb_sda = 40;
_pins.sscb_scl = 39;
_pins.pwdn = -1;
_pins.reset = -1;
_pins.flashlight = 21;
}

protected:
struct {
int8_t d0 = 0;
Expand Down Expand Up @@ -213,8 +236,8 @@ namespace Eloquent {
config->pin_pclk = _pins.pclk;
config->pin_vsync = _pins.vsync;
config->pin_href = _pins.href;
config->pin_sscb_sda = _pins.sscb_sda;
config->pin_sscb_scl = _pins.sscb_scl;
config->pin_sccb_sda = _pins.sscb_sda;
config->pin_sccb_scl = _pins.sscb_scl;
config->pin_pwdn = _pins.pwdn;
config->pin_reset = _pins.reset;

Expand Down