The webserver for the esp32-cam stream doesn't get started automatically. (#19905)

This ensures that it does start when the WcStream (or WcInterrupt) are run.

Co-authored-by: Anthony Sepa <protectivedad@gmail.com>
This commit is contained in:
protectivedad 2023-11-03 12:02:42 -03:00 committed by GitHub
parent b83516970f
commit 11e9b7375d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -1239,7 +1239,11 @@ void CmndWebcam(void) {
void CmndWebcamStream(void) {
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) {
Settings->webcam_config.stream = XdrvMailbox.payload;
if (!Settings->webcam_config.stream) { WcInterruptControl(); } // Stop stream
if (!Settings->webcam_config.stream) {
WcInterruptControl(); // Stop stream
} else {
WcSetStreamserver(Settings->webcam_config.stream); // Ensure server is running
}
}
ResponseCmndStateText(Settings->webcam_config.stream);
}

View File

@ -701,6 +701,7 @@ void WcInterrupt(uint32_t state) {
// Stop camera ISR if active to fix TG1WDT_SYS_RESET
if (!Wc.up) { return; }
WcSetStreamserver(state);
if (state) {
// Re-enable interrupts
cam_start();