Skip to content

Commit b8dca20

Browse files
authored
Merge pull request #44 from hpsaturn/devel
Devel
2 parents 8e1d877 + 2d56990 commit b8dca20

File tree

40 files changed

+126
-110
lines changed

40 files changed

+126
-110
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void onDataReady(uint32_t lenght) {
104104
It's also possible to define a specific target:
105105
106106
```cpp
107-
uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
107+
const uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
108108
radio.setTarget(macRecv);
109109
radio.init();
110110
```
@@ -136,7 +136,7 @@ CamFreenove Camera;
136136
```
137137

138138
>[!TIP]
139-
>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 :D
139+
>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
140140
141141
### PSRAM or DRAM?
142142

@@ -197,10 +197,9 @@ Some examples are for Arduino users (*.ino samples), but is possible too compile
197197

198198
I want to extend my gratitude to:
199199

200-
@ElectroZeusTIC and @AcoranTf for testing on Arduino IDE.
201-
@UtaAoya for findings related to the M5UnitCam device.
202-
@MeloCuentan for fixing issues with the AI-Thinker Camera and the new ESP32S3 RGB receiver.
203-
@turmandreams for tests on the AI-Thinker Camera and the M5Core receiver.
204-
200+
[@ElectroZeusTIC](https://github.com/electrozeustic) and [@AcoranTf](https://github.com/AcoranTf) for testing on Arduino IDE.
201+
[@UtaAoya](https://x.com/UtaAoya) for findings related to the M5UnitCam device.
202+
[@MeloCuentan](https://github.com/MeloCuentan) for fixing issues with the AI-Thinker Camera and the new ESP32S3 RGB receiver.
203+
[@turmandreams](https://github.com/turmandreams) for tests on the AI-Thinker Camera and the M5Core receiver.
205204

206205
---

examples/custom-camera-sender/custom-camera-sender.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ camera_fb_t* fb;
1515

1616
bool has_psram = false;
1717

18-
// Please change this to your Camera pins:
18+
// !! N O T E !!
19+
// Please change this for your Camera pins if your camera
20+
// is not listed in the examples or driver directory.
21+
22+
// If your new config works and it is not included in the
23+
// drivers section, please notify it via an issue or please
24+
// contribute to the proyect with a pull request. Thanks!
25+
1926
camera_config_t camera_config = {
2027
.pin_pwdn = -1,
2128
.pin_reset = 15,

examples/esp32cam-basic-sender/esp32cam-basic-sender.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ void setup() {
4040
Serial.printf("PSRAM size: %dMb\r\n", psram_size);
4141
}
4242

43-
// M5Core2 receiver target (P2P or 1:1 mode)
44-
// uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
43+
// Optional set M5Core2 receiver target (P2P or 1:1 mode)
44+
// const uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
4545
// radio.setTarget(macRecv);
4646
radio.init();
4747

examples/esp32cam-basic-sender/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; ESPNowCam Freenove ESP32S3CAM
2-
; https://github.com/hpsaturn/esp32s3-cam
2+
; https://github.com/hpsaturn/ESPNowCam.git
33
; @Hpsaturn 2024
44

55
[platformio]

examples/esp32cam-p2p-sender/esp32cam-p2p-sender.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void setup() {
4141
}
4242

4343
// M5Core2 receiver target (P2P or 1:1 mode)
44-
uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
44+
const uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
4545
radio.setTarget(macRecv);
4646
radio.init();
4747

examples/freenove-basic-sender/freenove-basic-sender.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void setup() {
4141
}
4242

4343
// M5Core2 receiver target (P2P or 1:1 mode)
44-
// uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
44+
// const uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
4545
// radio.setTarget(macRecv);
4646
radio.init();
4747

examples/freenove-p2p-sender/freenove-p2p-sender.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void setup() {
4040
}
4141

4242
// M5Core2 receiver
43-
uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
43+
const uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
4444
radio.setTarget(macRecv);
4545
radio.init();
4646

examples/freenove-tank/freenove-tank.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,19 @@ void onDataReady(uint32_t lenght) {
139139
decodeMsg(lenght);
140140
}
141141

142-
void wcli_reboot(String opts){
142+
void wcli_reboot(char *args, Stream *response){
143143
ESP.restart();
144144
}
145145

146-
void wcli_kset(String opts) {
147-
maschinendeck::Pair<String, String> operands = maschinendeck::SerialTerminal::ParseCommand(opts);
146+
void wcli_kset(char *args, Stream *response) {
147+
Pair<String, String> operands = wcli.parseCommand(args);
148148
String key = operands.first();
149149
String v = operands.second();
150150
cfg.saveAuto(key,v);
151151
}
152152

153-
void wcli_klist(String opts) {
154-
maschinendeck::Pair<String, String> operands = maschinendeck::SerialTerminal::ParseCommand(opts);
153+
void wcli_klist(char *args, Stream *response) {
154+
Pair<String, String> operands = wcli.parseCommand(args);
155155
String opt = operands.first();
156156
Serial.printf("\n%11s \t%s \t%s \r\n", "KEYNAME", "DEFINED", "VALUE");
157157
Serial.printf("\n%11s \t%s \t%s \r\n", "=======", "=======", "=====");
@@ -166,34 +166,34 @@ void wcli_klist(String opts) {
166166
}
167167
}
168168

169-
void wcli_setup(String opts) {
169+
void wcli_setup(char *args, Stream *response) {
170170
setup_mode = true;
171171
Serial.println("\r\nSetup Mode Enable (fail-safe mode)\r\n");
172172
}
173173

174-
void wcli_exit(String opts) {
174+
void wcli_exit(char *args, Stream *response) {
175175
setup_time = 0;
176176
setup_mode = false;
177177
}
178178

179-
void wcli_debug(String opts) {
179+
void wcli_debug(char *args, Stream *response) {
180180
debug = !debug;
181181
cfg.saveBool(PKEYS::KDEBUG, debug);
182182
}
183183

184-
void wcli_servoL(String opts) {
185-
maschinendeck::Pair<String, String> operands = maschinendeck::SerialTerminal::ParseCommand(opts);
184+
void wcli_servoL(char *args, Stream *response) {
185+
Pair<String, String> operands = wcli.parseCommand(args);
186186
attachServoLeft();
187187
servoLeft.write(operands.first().toInt());
188188
}
189189

190-
void wcli_servoR(String opts) {
191-
maschinendeck::Pair<String, String> operands = maschinendeck::SerialTerminal::ParseCommand(opts);
190+
void wcli_servoR(char *args, Stream *response) {
191+
Pair<String, String> operands = wcli.parseCommand(args);
192192
attachServoRight();
193193
servoRight.write(operands.first().toInt());
194194
}
195195

196-
void wcli_pauseCam(String opts){
196+
void wcli_pauseCam(char *args, Stream *response){
197197
cam_stopped = !cam_stopped;
198198
Serial.printf("camera streaming %s\r\n", cam_stopped ? "stopped" : "resumed");
199199
}
@@ -218,7 +218,7 @@ void loadVariables() {
218218
degreesMaxR = degreesCenterR + spanRight + offsetRight;
219219
}
220220

221-
void wcli_print(String opts) {
221+
void wcli_print(char *args, Stream *response) {
222222
loadVariables();
223223
Serial.printf("LEFT => span: %i offset: %i center: %i\r\n", spanLeft, offsetLeft, degreesCenterL);
224224
Serial.printf("LEFT => degreesMinL: %i degreesMaxL: %i\r\n\n", degreesMinL, degreesMaxL);
@@ -237,20 +237,20 @@ void setup() {
237237

238238
cfg.init("espnowcam");
239239

240-
wcli.disableConnectInBoot();
241240
wcli.setSilentMode(true);
242-
wcli.begin();
243241

244-
wcli.term->add("reboot", &wcli_reboot, "\tperform a ESP32 reboot");
245-
wcli.term->add("setup", &wcli_setup,"\tTYPE THIS WORD to start to configure the device :D\n");
246-
wcli.term->add("exit", &wcli_exit, "\texit of the setup mode. AUTO EXIT in 10 seg! :)");
247-
wcli.term->add("klist", &wcli_klist, "\tlist valid preference keys");
248-
wcli.term->add("kset", &wcli_kset, "\tset preference key (e.g on/off or 1/0 or text)");
249-
wcli.term->add("print", &wcli_print, "\tprint current variables");
250-
wcli.term->add("servoL", &wcli_servoL, "\tset value on servo L");
251-
wcli.term->add("servoR", &wcli_servoR, "\tset value on servo R");
252-
wcli.term->add("pauseCam", &wcli_pauseCam, "\tstop/resume camera stream");
253-
wcli.term->add("debug", &wcli_debug, "\tdebugging flag toggle");
242+
wcli.add("reboot", &wcli_reboot, "\tperform a ESP32 reboot");
243+
wcli.add("setup", &wcli_setup,"\tTYPE THIS WORD to start to configure the device :D\n");
244+
wcli.add("exit", &wcli_exit, "\texit of the setup mode. AUTO EXIT in 10 seg! :)");
245+
wcli.add("klist", &wcli_klist, "\tlist valid preference keys");
246+
wcli.add("kset", &wcli_kset, "\tset preference key (e.g on/off or 1/0 or text)");
247+
wcli.add("print", &wcli_print, "\tprint current variables");
248+
wcli.add("servoL", &wcli_servoL, "\tset value on servo L");
249+
wcli.add("servoR", &wcli_servoR, "\tset value on servo R");
250+
wcli.add("pauseCam", &wcli_pauseCam, "\tstop/resume camera stream");
251+
wcli.add("debug", &wcli_debug, "\tdebugging flag toggle");
252+
253+
wcli.begin();
254254

255255
// Allow allocation of all timers
256256
ESP32PWM::allocateTimer(0);
@@ -287,11 +287,11 @@ void setup() {
287287
delay(1000);
288288

289289
// BE CAREFUL WITH IT, IF JPG LEVEL CHANGES, INCREASE IT
290-
recv_buff = (uint8_t*) ps_malloc(100* sizeof( uint8_t ) ) ;
290+
recv_buff = static_cast<uint8_t*>(ps_malloc(100 * sizeof(uint8_t)));
291291
radio.setRecvBuffer(recv_buff);
292292
radio.setRecvCallback(onDataReady);
293293

294-
uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
294+
const uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
295295
radio.setTarget(macRecv);
296296
radio.init(244);
297297

examples/freenoveWR-basic-sender/freenoveWR-basic-sender.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void setup() {
4242
}
4343

4444
// M5Core2 receiver target (P2P or 1:1 mode)
45-
// uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
45+
// const uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};
4646
// radio.setTarget(macRecv);
4747
radio.init();
4848

examples/m5core2-basic-receiver/m5core2-basic-receiver.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void setup() {
3636
}
3737

3838
// BE CAREFUL WITH IT, IF JPG LEVEL CHANGES, INCREASE IT
39-
fb = (uint8_t*) ps_malloc(5000* sizeof( uint8_t ) ) ;
39+
fb = static_cast<uint8_t *>(ps_malloc(5000 * sizeof(uint8_t)));
4040

4141
radio.setRecvBuffer(fb);
4242
radio.setRecvCallback(onDataReady);

0 commit comments

Comments
 (0)