-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from hpsaturn/esp32cam-ai-thinker
Esp32cam AI-Thinker
- Loading branch information
Showing
24 changed files
with
398 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/************************************************** | ||
* ESP32Cam AI-Thinker Transmitter | ||
* by @hpsaturn Copyright (C) 2024 | ||
* This file is part ESPNowCam project: | ||
* https://github.com/hpsaturn/ESPNowCam | ||
**************************************************/ | ||
|
||
// N O T E: | ||
// ------- | ||
// Don't forget first install NanoPb library! | ||
// and also review the README.md file. | ||
|
||
#include <Arduino.h> | ||
#include <ESPNowCam.h> | ||
#include <drivers/CamAIThinker.h> | ||
|
||
CamAIThinker Camera; | ||
ESPNowCam radio; | ||
|
||
void processFrame() { | ||
if (Camera.get()) { | ||
uint8_t *out_jpg = NULL; | ||
size_t out_jpg_len = 0; | ||
frame2jpg(Camera.fb, 12, &out_jpg, &out_jpg_len); | ||
radio.sendData(out_jpg, out_jpg_len); | ||
free(out_jpg); | ||
Camera.free(); | ||
} | ||
} | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
Serial.setDebugOutput(true); | ||
Serial.println(); | ||
|
||
delay(1000); // only for debugging. | ||
|
||
if(psramFound()){ | ||
size_t psram_size = esp_spiram_get_size() / 1048576; | ||
Serial.printf("PSRAM size: %dMb\r\n", psram_size); | ||
} | ||
|
||
// M5Core2 receiver target (P2P or 1:1 mode) | ||
// uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC}; | ||
// radio.setTarget(macRecv); | ||
radio.init(); | ||
|
||
// You are able to change the Camera config E.g: | ||
// Camera.config.fb_count = 2; | ||
// Camera.config.frame_size = FRAMESIZE_QQVGA; | ||
|
||
if (!Camera.begin()) { | ||
Serial.println("Camera Init Fail"); | ||
} | ||
delay(500); | ||
} | ||
|
||
void loop() { | ||
processFrame(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
; ESPNowCam Freenove ESP32S3CAM | ||
; https://github.com/hpsaturn/esp32s3-cam | ||
; @Hpsaturn 2024 | ||
|
||
[platformio] | ||
src_dir = ./ | ||
|
||
[env] | ||
platform = espressif32 | ||
framework = arduino | ||
monitor_speed = 115200 | ||
monitor_filters = | ||
esp32_exception_decoder | ||
time | ||
build_flags = | ||
-D CORE_DEBUG_LEVEL=3 | ||
-D BOARD_HAS_PSRAM=1 | ||
|
||
[esp32common] | ||
extends = env | ||
board = esp32dev | ||
|
||
[env:freenove-basic-sender] | ||
extends = esp32common | ||
lib_deps = | ||
hpsaturn/EspNowCam@^0.1.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/************************************************** | ||
* ESP32Cam AI-Thinker Transmitter | ||
* by @hpsaturn Copyright (C) 2024 | ||
* This file is part ESPNowCam project: | ||
* https://github.com/hpsaturn/ESPNowCam | ||
**************************************************/ | ||
|
||
// N O T E: | ||
// ------- | ||
// Don't forget first install NanoPb library! | ||
// and also review the README.md file. | ||
|
||
#include <Arduino.h> | ||
#include <ESPNowCam.h> | ||
#include <drivers/CamAIThinker.h> | ||
|
||
CamAIThinker Camera; | ||
ESPNowCam radio; | ||
|
||
void processFrame() { | ||
if (Camera.get()) { | ||
uint8_t *out_jpg = NULL; | ||
size_t out_jpg_len = 0; | ||
frame2jpg(Camera.fb, 12, &out_jpg, &out_jpg_len); | ||
radio.sendData(out_jpg, out_jpg_len); | ||
free(out_jpg); | ||
Camera.free(); | ||
} | ||
} | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
Serial.setDebugOutput(true); | ||
Serial.println(); | ||
|
||
delay(1000); // only for debugging. | ||
|
||
if(psramFound()){ | ||
size_t psram_size = esp_spiram_get_size() / 1048576; | ||
Serial.printf("PSRAM size: %dMb\r\n", psram_size); | ||
} | ||
|
||
// M5Core2 receiver target (P2P or 1:1 mode) | ||
uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC}; | ||
radio.setTarget(macRecv); | ||
radio.init(); | ||
|
||
// You are able to change the Camera config E.g: | ||
// Camera.config.fb_count = 2; | ||
// Camera.config.frame_size = FRAMESIZE_QQVGA; | ||
|
||
if (!Camera.begin()) { | ||
Serial.println("Camera Init Fail"); | ||
} | ||
delay(500); | ||
} | ||
|
||
void loop() { | ||
processFrame(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.