From c2b295984b409a521d93dbb66253ee706ed7c655 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Mon, 4 May 2020 06:25:13 +0200 Subject: [PATCH 1/2] fix webcam size parameter --- libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h | 2 +- tasmota/xdrv_39_webcam.ino | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h b/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h index 4d943a052..90e2460b3 100644 --- a/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h +++ b/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h @@ -80,7 +80,7 @@ inline void analogWriteFreqRange(uint32_t channel,uint32_t freq, uint32_t irange ledcSetup(cnt+PWM_CHANNEL_OFFSET,freq,range); } } - Serial.printf("freq - range %d - %d\n",freq,range); + //Serial.printf("freq - range %d - %d\n",freq,range); } #define INPUT_PULLDOWN_16 INPUT_PULLUP diff --git a/tasmota/xdrv_39_webcam.ino b/tasmota/xdrv_39_webcam.ino index ffda441ee..841684cd0 100644 --- a/tasmota/xdrv_39_webcam.ino +++ b/tasmota/xdrv_39_webcam.ino @@ -39,6 +39,11 @@ * 8 = FRAMESIZE_XGA (1024x768) * 9 = FRAMESIZE_SXGA (1280x1024) * 10 = FRAMESIZE_UXGA (1600x1200) + +* only boards with PSRAM should be used, to enable PSRAM board should be se set to esp32cam in common32 of platform_override.ini +* board = esp32cam +* to speed up cam processing cpu frequency should be better set to 240Mhz in common32 of platform_override.ini +* board_build.f_cpu = 240000000L \*********************************************************************************************/ #define XDRV_39 39 @@ -673,7 +678,7 @@ void CmndWC(void) { uint32_t flag = 0; if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 10)) { wc_set_streamserver(XdrvMailbox.payload); - wc_setup(flag); + wc_setup(XdrvMailbox.payload); } if (CamServer) { flag = 1; } Response_P(PSTR("{\"" D_CMND_WC "\":{\"Streaming\":\"%s\"}"),GetStateText(flag)); From 0f5ffe5473ad6f560880fb65e6f507fba0cfdff9 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Mon, 4 May 2020 06:54:24 +0200 Subject: [PATCH 2/2] replace serial print --- tasmota/xdrv_39_webcam.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_39_webcam.ino b/tasmota/xdrv_39_webcam.ino index 841684cd0..eeb2dc301 100644 --- a/tasmota/xdrv_39_webcam.ino +++ b/tasmota/xdrv_39_webcam.ino @@ -524,7 +524,8 @@ void CamHandleRoot(void) { //CamServer->redirect("http://" + String(ip) + ":81/cam.mjpeg"); CamServer->sendHeader("Location", WiFi.localIP().toString() + ":81/cam.mjpeg"); CamServer->send(302, "", ""); - Serial.printf("WC root called"); + //Serial.printf("WC root called"); + AddLog_P2(WC_LOGLEVEL, PSTR("CAM: root called")); } uint16_t motion_detect;