-
-
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 #39 from hpsaturn/freenove-esp32-wrover-cam
New driver for Freenove ESP32 WRover Cam
- Loading branch information
Showing
12 changed files
with
147 additions
and
17 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
61 changes: 61 additions & 0 deletions
61
examples/freenoveWR-basic-sender/freenoveWR-basic-sender.ino
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,61 @@ | ||
/************************************************** | ||
* ESP32Cam Freenove Wrover - 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/CamFreenoveWR.h> | ||
|
||
// Object for the old ESP32Cam Freenove WRover | ||
CamFreenoveWR 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:freenoveWR-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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=EspNowCam | ||
version=0.1.12 | ||
version=0.1.13 | ||
author=@hpsaturn | ||
maintainer=Antonio Vanegas <[email protected]> | ||
sentence=ESPNowCam, a straightforward video streamer for popular ESP32Cam models, leveraging the ESPNow protocol. No need for IPs, routers, or credentials—keeping it simple! :D | ||
|
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,41 @@ | ||
#ifndef CAMFREENOVEWR_H | ||
#define CAMFREENOVEWR_H | ||
|
||
#include "CameraBase.hpp" | ||
#include "esp_camera.h" | ||
|
||
class CamFreenoveWR : public CameraBase { | ||
public: | ||
using CameraBase::begin; | ||
using CameraBase::free; | ||
using CameraBase::get; | ||
|
||
CamFreenoveWR(){ | ||
config.pin_reset = -1; | ||
config.pin_xclk = 21; | ||
config.pin_sccb_sda = 26; | ||
config.pin_sccb_scl = 27; | ||
config.pin_d7 = 35; | ||
config.pin_d6 = 34; | ||
config.pin_d5 = 39; | ||
config.pin_d4 = 36; | ||
config.pin_d3 = 19; | ||
config.pin_d2 = 18; | ||
config.pin_d1 = 5; | ||
config.pin_d0 = 4; | ||
config.pin_vsync = 25; | ||
config.pin_href = 23; | ||
config.pin_pclk = 22; | ||
config.xclk_freq_hz = 20000000; | ||
config.ledc_timer = LEDC_TIMER_0; | ||
config.ledc_channel = LEDC_CHANNEL_0; | ||
config.pixel_format = PIXFORMAT_RGB565; | ||
config.frame_size = FRAMESIZE_QVGA; | ||
config.jpeg_quality = 12; | ||
config.fb_count = 2; | ||
config.fb_location = CAMERA_FB_IN_PSRAM; | ||
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY; | ||
} | ||
}; | ||
|
||
#endif |