Closed 41linea45 closed 5 days ago
try this in handles.cpp between server.on("/", HTTP_GET, [] {
and server.on("/robots.txt", HTTP_GET
,
server.on("/stop", HTTP_GET,
[] { server.send(200, "text/txt", "REBOOTING_ESP\n");
ESP.restart();});
server.on("/stop"
That would not work.
The HTTP server is single threaded.
The thread is busy executing the MJPEG handler, so that it cannot process the stop
request.
@41linea45
I need to control stream start stop by button
The MJPEG stream is pull-based: it is the HTTP client who determines when to start and stop receiving the stream. The ESP32-CAM device is an HTTP server and thus it cannot control whether the stream is running.
Hello,
Firstly, thanks to avesome library. I need to control stream start stop by button(digitalRead). Now, I can sart stream by a digitalRead:
if(button_state== 1){ server.handleClient(); }
But I cant stop stream by a button . when void handleMjpeg() starts stream , it doesnt works loop procedure. I am newbie and pls tell me how can i stop stream i press the button. Best regards.