The camera comes with internal and external antenna. To use the external antenna, a resistor must be resoldered (instructions).
I re-soldered a tiny resistor near the antenna connector to switch the antenna from internal to external. It would be great if the board producer used some kind of jumper instead. I know, the costs.
3d printed enclosure of the esp32 cam, pink, white,blue colours, front view4. I flashed the board with ESPHome firmware (actually I did it before the assembly). I used an online flasher. I had some issues – I still don’t know which button to hold during the start of the board (left or right). Anyways, after some retries flashing succeded.
ESPHome configuration
Then I searched for various pieces of code on the ESPHome community forums and blogs (1, 2, 3) and came up with this:
ESP32-Cam exposes the following entities:
a camera
a switch (for the white LED)
a switch (for the red status LED)
a slider (for the white LED brightness)
a switch (for restarting a board)
a binary sensor (for the status of the board).
it is accessible as a web server on port 8080 (stream) and 8081 (still pictures).
The ESPHome yaml code to achieve above functionalities:
I’ve set up a simple dashboard in Home Assistant that shows idle preview (0.1 fps), uptime, switches for white LED and status led and a slider for adjusting white LED.
home assistant screenshot showing various data about webcamThe image below shows various statuses related to the ESP32 board, like restart switch, firmware, connection status, IP, firmware version and WIFI signal (the code above does not include these entities).
Except the soldering, this DIY camera is not too difficult to build.
The image quality is ok-ish (1600×1200).
The framerate is okay-ish for special purposes (e. g. door camera, environment camera). I get about 3-5fps in my case (different floor than the wifi router).
It is more stable than my other ‘IP webcam’ app running on Android phones. This app keeps stopping every few days, while ESP32 is stable.
TODO
What still remains is:
I’d like to adjust the brightness etc. on the fly (without recompiling the firmware), but I didn’t find the appropriate .yaml code for it.
integration in MotionEye (for recording the videos and motion detection) or Frigate (for object detection). I tried to integrated it to MotionEye, but it is very slow or the stream is mostly broken.
Disclaimer
The links to the products are not affiliate links and I don’t receive any compensation for linking.
The code and the ideas are mostly from HomeAssistant and ESPHome community forums.
Add comment