Add command `WcClock 10..200`

Add command ``WcClock 10..200`` set webcam clock in MHz. Default is 20
This commit is contained in:
Theo Arends 2022-10-13 17:58:16 +02:00
parent 3dd32a1ebd
commit 2ad018816b
6 changed files with 28 additions and 11 deletions

View File

@ -3,16 +3,19 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - Development
## [12.1.1.5]
## [12.1.1.6]
### Added
- Command ``Sunrise 0..3`` to select sunrise dawn angle between Normal, Civil, Nautical or Astronomical (#16795)
- Command ``WcClock 10..200`` set webcam clock in MHz. Default is 20
### Changed
### Fixed
### Removed
- Display of energy values in GUI use columns when define ``USE_ENERGY_COLUMN_GUI`` is enabled (default)
## [12.1.1.5] 20221013
### Added
- Command ``Sunrise 0..3`` to select sunrise dawn angle between Normal, Civil, Nautical or Astronomical (#16795)
## [12.1.1.4] 20221012
### Added

View File

@ -107,7 +107,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
[Complete list](BUILDS.md) of available feature and sensors.
## Changelog v12.1.1.4
## Changelog v12.1.1.6
### Added
- Command ``SetOption46 0..255`` to add 0..255 * 10 milliseconds power on delay before initializing I/O [#15438](https://github.com/arendst/Tasmota/issues/15438)
- Command ``SetOption146 1`` to enable display of ESP32 internal temperature
@ -117,6 +117,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
- Command ``DspSpeed 2..127`` to control message rotation speed on display of POWR3xxD and THR3xxD
- Command ``DspLine<1|2> <index>,<unit>,<index>,<unit>,...`` to select message(s) on display of POWR3xxD and THR3xxD
- Command ``Sunrise 0..3`` to select sunrise dawn angle between Normal, Civil, Nautical or Astronomical [#16795](https://github.com/arendst/Tasmota/issues/16795)
- Command ``WcClock 10..200`` set webcam clock in MHz. Default is 20
- Support for Shelly Plus 2PM
- Support for SGP40 gas and air quality sensor [#16341](https://github.com/arendst/Tasmota/issues/16341)
- Support for Modbus writing using ModbusBridge by JeroenSt [#16351](https://github.com/arendst/Tasmota/issues/16351)

View File

@ -587,7 +587,6 @@ typedef struct {
uint8_t eth_address; // 45E
uint8_t module; // 45F
WebCamCfg webcam_config; // 460
uint8_t ws_width[3]; // 464
char serial_delimiter; // 467
uint8_t seriallog_level; // 468
@ -726,8 +725,7 @@ typedef struct {
mytmplt8285 ex_user_template8; // 72F 14 bytes (ESP8266) - Free since 9.0.0.1
#endif // ESP8266
#ifdef ESP32
uint8_t free_esp32_72f[1]; // 72F
uint8_t webcam_clk; // 72F
WebCamCfg2 webcam_config2; // 730
uint8_t free_esp32_734[9]; // 734

View File

@ -20,6 +20,6 @@
#ifndef _TASMOTA_VERSION_H_
#define _TASMOTA_VERSION_H_
const uint32_t VERSION = 0x0C010105; // 12.1.1.5
const uint32_t VERSION = 0x0C010106; // 12.1.1.6
#endif // _TASMOTA_VERSION_H_

View File

@ -856,6 +856,7 @@ void SettingsDefaultSet2(void) {
#else
Settings->config_version = 1; // ESP32
#endif // CONFIG_IDF_TARGET_ESP32S3
Settings->webcam_clk = 20;
#endif // ESP32
flag.stop_flash_rotate |= APP_FLASH_CYCLE;
@ -1592,6 +1593,11 @@ void SettingsDelta(void) {
else if (DAWN_NAUTIC == SUNRISE_DAWN_ANGLE) { Settings->mbflag2.sunrise_dawn_angle = 2; }
else if (DAWN_ASTRONOMIC == SUNRISE_DAWN_ANGLE) { Settings->mbflag2.sunrise_dawn_angle = 3; }
}
#ifdef ESP32
if (Settings->version < 0x0C010106) { // 12.1.1.6
Settings->webcam_clk = 20;
}
#endif // ESP32
Settings->version = VERSION;
SettingsSave(1);

View File

@ -378,7 +378,8 @@ uint32_t WcSetup(int32_t fsiz) {
config.ledc_channel = (ledc_channel_t) ledc_channel;
AddLog(LOG_LEVEL_DEBUG_MORE, "CAM: XCLK on GPIO %i using ledc channel %i", config.pin_xclk, config.ledc_channel);
config.ledc_timer = LEDC_TIMER_0;
config.xclk_freq_hz = 20000000;
// config.xclk_freq_hz = 20000000;
config.xclk_freq_hz = Settings->webcam_clk * 1000000;
config.pixel_format = PIXFORMAT_JPEG;
//esp_log_level_set("*", ESP_LOG_INFO);
@ -1092,6 +1093,7 @@ void WcInit(void) {
#define D_CMND_RTSP "Rtsp"
#define D_CMND_WC_AUTH "Auth"
#define D_CMND_WC_CLK "Clock"
const char kWCCommands[] PROGMEM = D_PRFX_WEBCAM "|" // Prefix
"|" D_CMND_WC_STREAM "|" D_CMND_WC_RESOLUTION "|" D_CMND_WC_MIRROR "|" D_CMND_WC_FLIP "|"
@ -1100,7 +1102,7 @@ const char kWCCommands[] PROGMEM = D_PRFX_WEBCAM "|" // Prefix
D_CMND_WC_AEC_VALUE "|" D_CMND_WC_AE_LEVEL "|" D_CMND_WC_AEC2 "|" D_CMND_WC_AGC "|"
D_CMND_WC_AGC_GAIN "|" D_CMND_WC_GAINCEILING "|" D_CMND_WC_RAW_GMA "|" D_CMND_WC_LENC "|"
D_CMND_WC_WPC "|" D_CMND_WC_DCW "|" D_CMND_WC_BPC "|" D_CMND_WC_COLORBAR "|" D_CMND_WC_FEATURE "|"
D_CMND_WC_SETDEFAULTS "|" D_CMND_WC_STATS "|" D_CMND_WC_INIT "|" D_CMND_WC_AUTH
D_CMND_WC_SETDEFAULTS "|" D_CMND_WC_STATS "|" D_CMND_WC_INIT "|" D_CMND_WC_AUTH "|" D_CMND_WC_CLK
#ifdef ENABLE_RTSPSERVER
"|" D_CMND_RTSP
#endif // ENABLE_RTSPSERVER
@ -1113,7 +1115,7 @@ void (* const WCCommand[])(void) PROGMEM = {
&CmndWebcamAELevel, &CmndWebcamAEC2, &CmndWebcamAGC, &CmndWebcamAGCGain, &CmndWebcamGainCeiling,
&CmndWebcamGammaCorrect, &CmndWebcamLensCorrect, &CmndWebcamWPC, &CmndWebcamDCW, &CmndWebcamBPC,
&CmndWebcamColorbar, &CmndWebcamFeature, &CmndWebcamSetDefaults,
&CmndWebcamStats, &CmndWebcamInit, &CmndWebcamAuth
&CmndWebcamStats, &CmndWebcamInit, &CmndWebcamAuth, &CmndWebcamClock
#ifdef ENABLE_RTSPSERVER
, &CmndWebRtsp
#endif // ENABLE_RTSPSERVER
@ -1355,6 +1357,13 @@ void CmndWebcamAuth(void){
ResponseCmndNumber(Settings->webcam_config2.auth);
}
void CmndWebcamClock(void){
if((XdrvMailbox.payload >= 10) && (XdrvMailbox.payload <= 200)){
Settings->webcam_clk = XdrvMailbox.payload;
}
ResponseCmndNumber(Settings->webcam_clk);
}
void CmndWebcamInit(void) {
WcInterruptControl();
ResponseCmndDone();