Skip to content

Commit 14f96f5

Browse files
authored
release v0.1.17rev082 Merge pull request #56
2 parents 70c5103 + 0d5401c commit 14f96f5

File tree

10 files changed

+251
-22
lines changed

10 files changed

+251
-22
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ ESPNowCam radio;
8383
radio.init();
8484
radio.sendData(data, data_len);
8585
```
86-
87-
[full sender implementaton example](https://github.com/hpsaturn/ESPNowCam/blob/master/examples/xiao-espnow-sender/xiao-espnow-sender.cpp)
88-
86+
[full sender implementation example](https://github.com/hpsaturn/ESPNowCam/blob/master/examples/xiao-espnow-sender/xiao-espnow-sender.cpp)
8987

9088
**To receive** the data, you only need to define a buffer and callback:
9189

@@ -144,6 +142,15 @@ CamFreenove Camera;
144142
>[!TIP]
145143
>For now, it includes drivers for FreenoveS3, XIAOS3, M5UnitCamS3, Freenove WRover, ESP32Cam AI-Thinker and the TTGO T-Journal cameras, but you are able to define your custom camera like is shown in the [custom-camera-sender](https://github.com/hpsaturn/ESPNowCam/tree/master/examples/custom-camera-sender) example. If you can run it in a different camera, please notify me via a [GitHub issue](https://github.com/hpsaturn/ESPNowCam/issues/new) or please contribute with the project sending a pull request :D
146144
145+
### Channel
146+
147+
Is possible to configure the radio channel or the WiFi channel. You should put the same channel on all devices. This setting is optional, and it is not mandatory, but could improve the connection.
148+
149+
```cpp
150+
radio.setChannel(2);
151+
radio.init();
152+
```
153+
147154
### PSRAM or DRAM?
148155

149156
Well, in my last tests with different cameras and using QVGA frame size, seems that is better using the DRAM and the internal JPG. DRAM is more faster than PSRAM, and the internal compressor has a better quality with the same JPGQ level, but it uses more bandwidth, on the other hand the result is so good on P2P mode.
@@ -177,6 +184,13 @@ Some examples are for Arduino users (*.ino samples), but is possible too compile
177184
pio run --target upload
178185
```
179186

187+
### Camera CLI
188+
189+
Also I'm working in a complete Camera configurator and test suite for this library and also other features around the ESP Cameras. It is a project in progress, but you are able to configure and test all ESPNowCam features more easy using a CLI and manager that runs into the Camera:
190+
191+
![ESP32 Camera CLI](pictures/esp32_camera_cli_preview.jpg)
192+
more [here](https://github.com/hpsaturn/esp32-camera-cli).
193+
180194
## Troubleshooting
181195

182196
> [!NOTE]

examples/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Some video receivers
2828
| makerfabs-nojpg-receiver | Makerfabs RGB Parallel [1] [2] | <2FPS |
2929
| tft-3.5-basic-receiver | Any TFT display with LGFX [1] | STABLE |
3030
| tft-il9485-basic-receiver | M5Core TFT reciver il9481 [1] [2]| STABLE |
31-
| ft-rgb-hmi-basic-receiver | ESP32S3_RGB_ESP32-8048S043 [1] [2] | STABLE |
31+
| tft-rgb-hmi-basic-receiver | ESP32S3_RGB_ESP32-8048S043 [1] [2] | STABLE |
32+
| tft-s3-RGB-800x480-receiver | ESP32S3_RGB_ESP32-8048S043 [1] | STABLE |
3233
| crowpanel-receiver | Elecrow round panel 320x240 [1] | TESTING |
3334

3435
[1] Use with any sender sample
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#define LGFX_USE_V1
2+
#include <LovyanGFX.hpp>
3+
4+
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
5+
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
6+
7+
#include <driver/i2c.h>
8+
9+
class LGFX : public lgfx::LGFX_Device
10+
{
11+
public:
12+
lgfx::Bus_RGB _bus_instance;
13+
lgfx::Panel_RGB _panel_instance;
14+
lgfx::Light_PWM _light_instance;
15+
lgfx::Touch_GT911 _touch_instance;
16+
17+
LGFX(void)
18+
{
19+
{
20+
auto cfg = _panel_instance.config();
21+
22+
cfg.memory_width = 800;
23+
cfg.memory_height = 480;
24+
cfg.panel_width = 800;
25+
cfg.panel_height = 480;
26+
27+
cfg.offset_x = 0;
28+
cfg.offset_y = 0;
29+
30+
_panel_instance.config(cfg);
31+
}
32+
33+
{
34+
auto cfg = _panel_instance.config_detail();
35+
36+
cfg.use_psram = 1;
37+
38+
_panel_instance.config_detail(cfg);
39+
}
40+
41+
{
42+
auto cfg = _bus_instance.config();
43+
cfg.panel = &_panel_instance;
44+
cfg.pin_d0 = GPIO_NUM_8; // B0
45+
cfg.pin_d1 = GPIO_NUM_3; // B1
46+
cfg.pin_d2 = GPIO_NUM_46; // B2
47+
cfg.pin_d3 = GPIO_NUM_9; // B3
48+
cfg.pin_d4 = GPIO_NUM_1; // B4
49+
cfg.pin_d5 = GPIO_NUM_5; // G0
50+
cfg.pin_d6 = GPIO_NUM_6; // G1
51+
cfg.pin_d7 = GPIO_NUM_7; // G2
52+
cfg.pin_d8 = GPIO_NUM_15; // G3
53+
cfg.pin_d9 = GPIO_NUM_16; // G4
54+
cfg.pin_d10 = GPIO_NUM_4; // G5
55+
cfg.pin_d11 = GPIO_NUM_45; // R0
56+
cfg.pin_d12 = GPIO_NUM_48; // R1
57+
cfg.pin_d13 = GPIO_NUM_47; // R2
58+
cfg.pin_d14 = GPIO_NUM_21; // R3
59+
cfg.pin_d15 = GPIO_NUM_14; // R4
60+
61+
cfg.pin_henable = GPIO_NUM_40;
62+
cfg.pin_vsync = GPIO_NUM_41;
63+
cfg.pin_hsync = GPIO_NUM_39;
64+
cfg.pin_pclk = GPIO_NUM_42;
65+
cfg.freq_write = 14000000;
66+
67+
cfg.hsync_polarity = 0;
68+
cfg.hsync_front_porch = 8;
69+
cfg.hsync_pulse_width = 4;
70+
cfg.hsync_back_porch = 16;
71+
cfg.vsync_polarity = 0;
72+
cfg.vsync_front_porch = 4;
73+
cfg.vsync_pulse_width = 4;
74+
cfg.vsync_back_porch = 4;
75+
cfg.pclk_idle_high = 1;
76+
_bus_instance.config(cfg);
77+
}
78+
_panel_instance.setBus(&_bus_instance);
79+
80+
{
81+
auto cfg = _light_instance.config();
82+
cfg.pin_bl = GPIO_NUM_2;
83+
_light_instance.config(cfg);
84+
}
85+
_panel_instance.light(&_light_instance);
86+
87+
{
88+
auto cfg = _touch_instance.config();
89+
cfg.x_min = 0;
90+
cfg.x_max = 800;
91+
cfg.y_min = 0;
92+
cfg.y_max = 480;
93+
cfg.pin_int = GPIO_NUM_18;
94+
cfg.bus_shared = false;
95+
cfg.offset_rotation = 0;
96+
// I2C
97+
cfg.i2c_port = I2C_NUM_1;
98+
cfg.pin_sda = GPIO_NUM_19;
99+
cfg.pin_scl = GPIO_NUM_20;
100+
cfg.freq = 400000;
101+
cfg.i2c_addr = 0x14; // 0x5D , 0x14
102+
_touch_instance.config(cfg);
103+
_panel_instance.setTouch(&_touch_instance);
104+
}
105+
106+
setPanel(&_panel_instance);
107+
}
108+
};
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**************************************************
2+
* ESPNowCam video Receiver
3+
* @hpsaturn Copyright (C) 2024
4+
* This file is part ESPNowCam tests project:
5+
* https://github.com/hpsaturn/ESPNowCam
6+
*
7+
* This code was submitted by @MeloCuentan
8+
* and tested on a real board around the next
9+
* issue:
10+
* https://github.com/hpsaturn/ESPNowCam/issues/53
11+
**************************************************/
12+
13+
#include <Arduino.h>
14+
#include <HardwareSerial.h>
15+
#include "LGFX_ESP32S3_RGB_ESP32-8048S043.h"
16+
17+
#include <LGFX_TFT_eSPI.hpp>
18+
19+
#include "ESPNowCam.h"
20+
21+
const uint8_t pin_brightness = 2;
22+
23+
static LGFX tft;
24+
25+
ESPNowCam radio;
26+
27+
// frame buffer
28+
uint8_t fb[60000];
29+
30+
// display globals
31+
int32_t dw = 800;
32+
int32_t dh = 480;
33+
34+
void onDataReady(uint32_t lenght) { tft.drawJpg(fb, lenght, 0, 0, dw, dh); }
35+
36+
void setup(void) {
37+
tft.init();
38+
tft.setRotation(0);
39+
40+
pinMode(pin_brightness, OUTPUT);
41+
analogWriteResolution(8);
42+
analogWriteFrequency(1000);
43+
analogWrite(pin_brightness, 127);
44+
45+
tft.setTextColor(TFT_WHITE);
46+
47+
// BE CAREFUL WITH IT, IF JPG LEVEL CHANGES, INCREASE IT
48+
// fb = (uint8_t *)ps_malloc(30000 * sizeof(uint8_t));
49+
50+
radio.setRecvBuffer(fb);
51+
radio.setRecvCallback(onDataReady);
52+
53+
if (radio.init()) {
54+
String text = "ESPNow Init Success";
55+
uint8_t text_length = text.length();
56+
uint8_t text_size = 4;
57+
uint16_t posX = (800 - (text_size * 6 * text_length)) / 2;
58+
uint16_t posY = ((480 - (text_size * 8)) / 3) * 2;
59+
tft.setTextSize(text_size);
60+
tft.drawString(text, posX, posY);
61+
}
62+
delay(500);
63+
}
64+
65+
void loop(void) {}

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "EspNowCam",
3-
"version": "0.1.16",
3+
"version": "0.1.17",
44
"homepage":"https://github.com/hpsaturn/esp32s3-cam",
55
"keywords":
66
[

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=EspNowCam
2-
version=0.1.16
2+
version=0.1.17
33
author=@hpsaturn
44
maintainer=Antonio Vanegas <[email protected]>
55
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
49.2 KB
Loading

platformio.ini

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ src_dir = ./examples/
77
lib_dir = ./examples/lib
88

99
[env]
10-
platform = espressif32@6.9.0
10+
platform = espressif32@6.10.0
1111
framework = arduino
1212
monitor_speed = 115200
1313
monitor_filters =
@@ -20,7 +20,7 @@ build_flags =
2020
-D CORE_DEBUG_LEVEL=3
2121
-D BOARD_HAS_PSRAM=1
2222
lib_deps =
23-
23+
2424
extra_scripts = pre:prebuild.py
2525

2626
[esp32common]
@@ -43,7 +43,7 @@ extends = esp32common
4343
lib_deps =
4444
${esp32common.lib_deps}
4545
46-
46+
4747
build_flags =
4848
${env.build_flags}
4949
-DESP32S3
@@ -91,19 +91,16 @@ build_flags =
9191
-DCONFIG_ARDUINO_LOOP_STACK_SIZE=16384
9292

9393
[env:tjournal-espnow-sender]
94-
platform = espressif32
9594
extends = env
9695
board = esp32dev
9796
build_src_filter = -<*> -<*common*> +<tjournal-espnow-sender/>
9897

9998
[env:custom-camera-sender]
100-
platform = espressif32
10199
extends = env
102100
board = esp32dev
103101
build_src_filter = -<*> -<*common*> +<custom-camera-sender/>
104102

105103
[env:esp32cam-p2p-sender]
106-
platform = espressif32
107104
extends = env
108105
board = esp32dev
109106
build_src_filter = -<*> -<*common*> +<esp32cam-p2p-sender/>
@@ -126,7 +123,7 @@ board = esp32dev
126123
build_src_filter = -<*> +<m5core2-espnow-receiver/>
127124
lib_deps =
128125
${esp32common.lib_deps}
129-
m5stack/M5Unified@^0.2.0
126+
m5stack/M5Unified@^0.2.3
130127

131128
[env:makerfabs-receiver]
132129
extends = esp32common
@@ -150,6 +147,14 @@ lib_deps =
150147
${esp32common.lib_deps}
151148
lovyan03/LovyanGFX@^1.1.5
152149

150+
[env:tft-s3-RGB-800x480-receiver]
151+
extends = esp32common
152+
board = lolin_s3
153+
build_src_filter = -<*> +<tft-s3-RGB-800x480-receiver/tft-s3-RGB-800x480-receiver.cpp>
154+
lib_deps =
155+
${esp32common.lib_deps}
156+
lovyan03/LovyanGFX@^1.1.5
157+
153158
[env:crowpanel-receiver]
154159
extends = esp32common
155160
board = esp32-c3-devkitm-1
@@ -174,7 +179,7 @@ board = esp32dev
174179
build_src_filter = -<*> +<multi-camera-one-receiver/m5core2-multi-receiver.cpp>
175180
lib_deps =
176181
${esp32common.lib_deps}
177-
m5stack/M5Unified@^0.2.0
182+
m5stack/M5Unified@^0.2.3
178183

179184
[env:makerfabs-multi-receiver]
180185
extends = esp32common
@@ -188,7 +193,6 @@ extends = m5cores3_common
188193
build_src_filter = -<*> +<multi-camera-one-receiver/m5cores3-camera1.cpp>
189194

190195
[env:tjournal-camera2]
191-
platform = espressif32
192196
extends = env
193197
board = esp32dev
194198
build_src_filter = -<*> +<multi-camera-one-receiver/tjournal-camera2.cpp>
@@ -210,7 +214,7 @@ board_build.arduino.memory_type = dio_opi ;
210214
build_src_filter = -<*> +<common/> +<freenove-tank/>
211215
lib_deps =
212216
${esp32common.lib_deps}
213-
madhephaestus/[email protected].5
217+
madhephaestus/[email protected].6
214218
hpsaturn/EasyPreferences@^0.1.0
215219
hpsaturn/ESP32 Wifi CLI @^0.3.3
216220

@@ -220,4 +224,4 @@ board = esp32dev
220224
build_src_filter = -<*> +<common/> +<m5stickCplus-joystick-tank/>
221225
lib_deps =
222226
${esp32common.lib_deps}
223-
m5stack/M5Unified@^0.2.0
227+
m5stack/M5Unified@^0.2.3

src/ESPNowCam.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ void ESPNowCam::setRecvFilter(uint8_t *fb, const uint8_t *macAddr, RecvCb cb) {
262262
/***********************************
263263
* C O M M O N S E C T I O N
264264
************************************/
265+
void ESPNowCam::setChannel(uint8_t channel) {
266+
_channel = channel;
267+
}
265268

266269
bool ESPNowCam::init(uint8_t chunk_size) {
267270
chunksize = chunk_size;
@@ -273,6 +276,11 @@ bool ESPNowCam::init(uint8_t chunk_size) {
273276
WiFi.disconnect();
274277
delay(100);
275278

279+
if (_channel != -1) {
280+
log_i("Set custom channel: %i", _channel);
281+
esp_wifi_set_channel(_channel, WIFI_SECOND_CHAN_NONE);
282+
}
283+
276284
if (esp_now_init() == ESP_OK) {
277285
log_i("ESPNow Init Success");
278286

0 commit comments

Comments
 (0)