Taken from the official Espressif ESP32 camera examples: https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer
I have copied and changed the status_handler. When calling the pages:
Or
Then the GPIO4 will set to HIGH or LOW, the LED goes on or off and a simple JSON output with LED:true or LED:false is generated. It's not pretty but it works. GPIO4 should only be responsible for the LED when no SD card is insert. I have never worked with the intern sd card slot.
Changes were made only to app_httpd.cpp
Have fun with it.
Wiring and settings as usual:
I flash with 5V, don't forget to connect IO0 to GND during flashing and de-wire it during testing.