ESP32 Cam - working!

What do you guys think about a battery powered esp32 camera, which would be awaken from a low-power mode via PIR sensor and then it would record for a predefined time? Door camera setup would come to mind as a use case.

2 Likes

I figured this same thing out today. I was getting like 20% signal 5 ft from the AP and 5% hardly even connecting and not able to get any images for 20 ft away. You don’t even have to move the 0 Ohm resistor, you can just bridge the other solder pads in the diamond next to the antenna connector with solder and it will enable the onboard antenna (you should undo this if you switch to a real antenna). Now getting 70% signal at 20 ft away with a wall in the way.
They should really have a jumper or something easier to select onboard vs external antenna, but I guess that’s what you get for $6.

That looks like an ai-thinker clone. Config is on the esphome pages.

1 Like

I flash esphome, now i can see in home assitant, could you give me link to view cam in http, i type IP of ESP32-cam but not image. Thanks in advance!

There isn’t an http address. The camera works via the esphome API with home assistant only.

1 Like

Thank you for quick reply!

I do not get this issue with AI Thinker CAM. I am using 1024x768 and get about 4fps when viewing the stream. When I close the stream there is a few seconds delay and it goes back to 0.1fps ie one frame every 10secs.

That is interesting. There may of course be subtle differences between the boards that could cause different behaviour.
I have ordered two AI Thinker cams and will receive them in a few days. Plan to test them and compare their performance with the TTGO cam board within the framework of ESPHome.

For the time being I have decided to set up the TTGO cam board as a Generic MJPEG IP Camera in HA, using this firmware: https://github.com/Xinyuan-LilyGo/esp32-camera-bme280 . Works fine, and is quite stable. Although, this makes accessing the PIR and the OLED on the TTGO board more difficult.

I believe the TTGO boards have 8MB of PSRAM where all the others have 4MB, though 4MB is big enough to run the highest resolution the cam supports. Whether esphome has to handle this differently I dont know exactly, I think above 4MB it has to be accessed in pages. AI thinker has no usb or serial bridge. It does have a sdcard reader and a flashlight LED. If you have all the extras unconfigured they should be the same, except they use different GPIOs to access the cam. The AI thinker ones are cheap anyway I got three for £19 including shipping from china.

After reading your comment, i checked mine, and I am experiencing the same thing on my TTGO T-Camera board also. Ill try and submit an issue to ESPHome

Oops, looks like you already have :slight_smile:

Sounds like a good idea. I plan to run a few ESP32 cameras with a USB wall wart if there is power nearby, but of course there rarely is.

Is a battery powered solution something you are investigating?

It looks like the ESP32 deep sleep mode would give a reasonable battery life, but wakeup time might be a problem. If it takes a few seconds to connect to WiFi you will likely lose some critical video footage.

Ordered two AI-Thinker ESP32 boards with cam and used the ESPHome firmware to flash.
Everything went smooth and i was able to adopt it in HA without any hassle.

Fact is that it gives me unstable performance in HA. After a while (± 30 minutes) the cam goes down. It looks like it is constantly rebooting due to overheating or lack of resources… I have the complete stock settings that ESPHome prescribes.

Any experience so far?

1 Like

Did you manage to fix this? I’m having the same issue.

1 Like

Anyone manage to get the PIR working in home assistant for the TTGO?

I also got two of them. Implemented last evening. I use higher than default resolution - SVGA
During the nigh one lost picture but was still connecting. I think this might be caused by low WiFi signal (behind fridge) so today I added external one. WiFi jumped from -75 to -58 db. Will see tonight.
Second one worked witout issues this morning.

I installed them in quite well ventilated places … so maybe that might help?

Just now, I added switch to turn flash on … but I think it might also cause overheating so need to use for short period of times.

Think heat is the main issue in my case I think… if I open up a command prompt with a ping -t to the esp the connection does not drop out. I also had the esp next to my access point the entire time… in your case, maybe you could try to connect it via FTDI adapter to your pc to see what it does. I use esphome via cmd and that gives pretty nice logging feedback.

hi,
I’ve been able to setup the esp32 cam using the Arduino sample ‘CameraWebServer’. I can browse to the webserver and see video. All fine.
I have a HA setup with let’s encrypt so HTTPS. The esp32 works over HTTP.
How do you guys integrate this in HA. With a picture card this doesn’t work.
Any tips?

If you have the camera set up with esphome then it communicates via the esphome api, http and https are not relevant.

this works for esp32-cam ai-thinker just change board to esp-wrover-kit

Guys I’ve just got one of the Banggood Geekcreit® ESP32-CAM modules (like linked on a post above) and testing it.
I’m using platform ESP32 and board type ‘esp32dev’, and the YAML configuration for Ai-thinker-camera as provided in the ESPhome guide.

However I get a ‘Setup Failed error’ in the logs when the ESP tries to configure the camera and HA does not see the camera (but does see the Switch for the LED, and control it OK). See the error near the end of the log…

[21:03:15][C][wifi:257]: Hostname: ‘esp32_camera_1’
[21:03:15][C][wifi:261]: Signal strength: -42 dB ▂▄▆█
[21:03:15][C][wifi:262]: Channel: 5
[21:03:15][C][wifi:263]: Subnet: 255.255.255.0
[21:03:15][C][wifi:264]: Gateway: 192.168.0.1
[21:03:15][C][wifi:265]: DNS1: 192.168.0.1
[21:03:15][C][wifi:266]: DNS2: 0.0.0.0
[21:03:15][C][switch.gpio:049]: GPIO Switch ‘“ESP32 Camera Light”’
[21:03:15][C][switch.gpio:050]: Pin: GPIO4 (Mode: OUTPUT)
[21:03:15][C][switch.gpio:066]: Restore Mode: Restore (Defaults to OFF)
[21:03:15][C][logger:142]: Logger:
[21:03:15][C][logger:143]: Level: VERBOSE
[21:03:15][C][logger:144]: Log Baud Rate: 115200
[21:03:15][C][logger:145]: Hardware UART: UART0
[21:03:15][C][esp32_camera:044]: ESP32 Camera:
[21:03:15][C][esp32_camera:045]: Name: ESP32_Cam
[21:03:15][C][esp32_camera:046]: Board Has PSRAM: YES
[21:03:15][C][esp32_camera:048]: Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[21:03:15][C][esp32_camera:049]: VSYNC Pin: 25
[21:03:15][C][esp32_camera:050]: HREF Pin: 23
[21:03:15][C][esp32_camera:051]: Pixel Clock Pin: 22
[21:03:15][C][esp32_camera:052]: External Clock: Pin:0 Frequency:20000000
[21:03:15][C][esp32_camera:053]: I2C Pins: SDA:26 SCL:27
[21:03:15][C][esp32_camera:054]: Reset Pin: -1
[21:03:15][C][esp32_camera:075]: Resolution: 640x480 (VGA)
[21:03:15][E][esp32_camera:092]: Setup Failed: ERROR
[21:03:15][C][api:101]: API Server:
[21:03:15][C][api:102]: Address: esp32_camera_1.local:6053
[21:03:15][C][ota:127]: Over-The-Air Updates:
[21:03:15][C][ota:128]: Address: esp32_camera_1.local:3232

What board type and YAML are others using for the Banggood sourced ESP32-CAM boards ??