mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
Add ESP32 configuration webcam
This commit is contained in:
parent
640c834bad
commit
af32b3f5e5
@ -21,7 +21,7 @@ build_flags = ${common32.build_flags}
|
||||
extends = env:tasmota32
|
||||
board = esp32cam
|
||||
board_build.f_cpu = 240000000L
|
||||
build_flags = ${common32.build_flags} -DUSE_WEBCAM
|
||||
build_flags = ${common32.build_flags} -DFIRMWARE_WEBCAM
|
||||
|
||||
[env:tasmota32-minimal]
|
||||
extends = env:tasmota32
|
||||
|
@ -123,6 +123,8 @@
|
||||
#define D_JSON_PROBETEMPERATURE "ProbeTemperature"
|
||||
#define D_JSON_PROGRAMFLASHSIZE "ProgramFlashSize"
|
||||
#define D_JSON_PROGRAMSIZE "ProgramSize"
|
||||
#define D_JSON_PSRMAXMEMORY "PsrMax"
|
||||
#define D_JSON_PSRFREEMEMORY "PsrFree"
|
||||
#define D_JSON_REFERENCETEMPERATURE "ReferenceTemperature"
|
||||
#define D_JSON_REMAINING "Remaining"
|
||||
#define D_JSON_RESET "Reset"
|
||||
|
@ -461,6 +461,9 @@ void CmndStatus(void)
|
||||
|
||||
if ((0 == payload) || (4 == payload)) {
|
||||
Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS4_MEMORY "\":{\"" D_JSON_PROGRAMSIZE "\":%d,\"" D_JSON_FREEMEMORY "\":%d,\"" D_JSON_HEAPSIZE "\":%d,\""
|
||||
#ifdef ESP32
|
||||
D_JSON_PSRMAXMEMORY "\":%d,\"" D_JSON_PSRFREEMEMORY "\":%d,"
|
||||
#endif
|
||||
D_JSON_PROGRAMFLASHSIZE "\":%d,\"" D_JSON_FLASHSIZE "\":%d"
|
||||
#ifdef ESP8266
|
||||
",\"" D_JSON_FLASHCHIPID "\":\"%06X\""
|
||||
@ -468,6 +471,9 @@ void CmndStatus(void)
|
||||
",\"" D_JSON_FLASHMODE "\":%d,\""
|
||||
D_JSON_FEATURES "\":[\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\"]"),
|
||||
ESP_getSketchSize()/1024, ESP.getFreeSketchSpace()/1024, ESP_getFreeHeap()/1024,
|
||||
#ifdef ESP32
|
||||
ESP.getPsramSize()/1024, ESP.getFreePsram()/1024,
|
||||
#endif
|
||||
ESP.getFlashChipSize()/1024, ESP.getFlashChipRealSize()/1024
|
||||
#ifdef ESP8266
|
||||
, ESP.getFlashChipId()
|
||||
|
@ -638,4 +638,8 @@
|
||||
#undef USE_DEBUG_DRIVER // Disable debug code
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
|
||||
#ifdef ESP32
|
||||
#include "tasmota_configurations_ESP32.h"
|
||||
#endif // ESP32
|
||||
|
||||
#endif // _TASMOTA_CONFIGURATIONS_H_
|
||||
|
40
tasmota/tasmota_configurations_ESP32.h
Normal file
40
tasmota/tasmota_configurations_ESP32.h
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
tasmota_configurations_ESP32.h - ESP32 only Configurations for Tasmota
|
||||
|
||||
Copyright (C) 2020 Theo Arends
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _TASMOTA_CONFIGURATIONS_ESP32_H_
|
||||
#define _TASMOTA_CONFIGURATIONS_ESP32_H_
|
||||
|
||||
#ifdef ESP32
|
||||
|
||||
/*********************************************************************************************\
|
||||
* [tasmota32-webcam.bin]
|
||||
* Provide an image with useful supported sensors enabled
|
||||
\*********************************************************************************************/
|
||||
|
||||
#ifdef FIRMWARE_WEBCAM
|
||||
|
||||
#undef CODE_IMAGE_STR
|
||||
#define CODE_IMAGE_STR "webcam"
|
||||
|
||||
#define USE_WEBCAM
|
||||
#endif // FIRMWARE_WEBCAM
|
||||
|
||||
#endif // ESP32
|
||||
|
||||
#endif // _TASMOTA_CONFIGURATIONS_ESP32_H_
|
@ -642,13 +642,13 @@ void HandleImage(void) {
|
||||
}
|
||||
client.stop();
|
||||
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("CAM: Sending image #: %d"), bnum+1);
|
||||
AddLog_P2(LOG_LEVEL_DEBUG_MORE, PSTR("CAM: Sending image #: %d"), bnum+1);
|
||||
}
|
||||
|
||||
void HandleImageBasic(void) {
|
||||
if (!HttpCheckPriviledgedAccess()) { return; }
|
||||
|
||||
AddLog_P(LOG_LEVEL_DEBUG, PSTR(D_LOG_HTTP "Capture image"));
|
||||
AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_HTTP "Capture image"));
|
||||
|
||||
if (Settings.webcam_config.stream) {
|
||||
if (!CamServer) {
|
||||
@ -686,7 +686,7 @@ void HandleImageBasic(void) {
|
||||
|
||||
esp_camera_fb_return(wc_fb); // Free frame buffer
|
||||
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("CAM: Image sent"));
|
||||
AddLog_P2(LOG_LEVEL_DEBUG_MORE, PSTR("CAM: Image sent"));
|
||||
}
|
||||
|
||||
void HandleWebcamMjpeg(void) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user