Original base code taken from here: https://randomnerdtutorials.com/esp32-cam-pan-and-tilt-2-axis/
Also expressif demo code examples for ESP32-CAM
- Converted to PlatformIO project (I am using PlatformIO plugin for VS Code
- Added zeroconf/ mDNS via ESPmDNS library.
- Control of 9G servos off ESP32CAM pins, using ESP32Servo library.
- (web api) EEPROM on tilt and pan servo values
- (web-api) User-control of amount of rotation as well as direction
- (web api) Change framesize and jpeg-quality
- Changed up web UI so you get tilt and pan updates.
- (Local network) OTA updating
<name>
, the mDNS device name, is set in PanTiliWebCam.cpp
Eneter wifi details in demo_network_credentials.h
and rename to network_credentials.h
http://<name>.local
http://<name>.local:81/stream
Move default increment (5 degrees)
http://<name>.local/action?go=<left|right|up|down>
Move <x>
degrees
http://<name>.local/action?go=<left|right|up|down>°rees=<x>
200 response is a JSON with current tilt and pan angles
<framesize>
is an integer corresponding to framesize_t
type in esp32_camera
library sensor.h
http://<name>.local/action?framesize=<framesize>
<quality>
is an integer (0-63)
http://<name>.local/action?quality=<quality>
Reset camera to saved settings
http://<name>.local/action?eeprom=0
Save current camera settings to EEPROM
http://<name>.local/action?eeprom=1
http://<name>.local/action?reset=1
Use esp32camUSB environment for uploading via USB - you'll have to do this first time anyway!
Use esp32camOTA for OTA updating. https://docs.platformio.org/en/latest/platforms/espressif32.html#over-the-air-ota-update