I’ve recently bought the ESP32 Camera Module so that I can use it on my Gas meter flashed with the ESPHome firmware.
the device will be in Deep Sleep and it will wake up every few hours to capture a still image and upload it to my server for processing.
So, my questions are as follows:
How do I create an automation that once it wakes up, it will capture the image and send it?
How do I send the image? (I am thinking of HTTP, MQTT and NFS, but I am open to suggestions)
I am planning on it being battery powered, so I want it to last as much as possible. As for the processing I found two promising solutions if you are interested: analog-meter-reading-openCV & ppplyn
I am not planning on integrating ESPHome on Home Assistant, so I don’t think I will have any problems with the deep sleep.
All I need is to send the picture to an external source to save it, but I have no idea how to do that.
MQTT might be the solution because it can retain the message, but I am not sure if it supports binary files.
Do you have any suggestions or code on how to save and upload the image?
My aim is to send the data/image over the http request as the ESP will be on another network
(Wantig to set up a remote camera and send the images to Home Assistant via the Nabu Casa Rest API, similar to the link of my other post but rather than the button sending the “human readable uptime” state, it sends an image from the camera)
It might be a while, but I have a similar request. In my case, I made the esp32cam wake up every 10 minutes for 20 seconds. There’s an automation in HA that runs every 14 seconds and tries to download the picture.
Ideally, HA would know when to take the picture, I think it might be possible to do that. A better case would be if esp32cam can upload the file directly somewhere.
Battery consumption is somewhat decent, can be improved with longer sleep times - 150-240 mA while active, 3-5mA while sleeping. I’m keeping a backup of the old photo while getting the new one. Anyway, this is as far as I’ve gotten, for now.
I’m very new to ESP home and generally YAML, following, as I’m currently struggling to make a mailbox “sensor” that uses esp32-cam to take a picture every 5 minutes, then sleeps, I’d like to keep it all in the ESP home / HA ecosystem.
I’ll be trying the above example tonight, but am also following for any improvements yall come up with. Thanks!
Whats the purpose of taking a picture every 5 min? Is this going inside a mail box? If there is a door or if its inside the mail box then snap a picture on door open, motion, vibration, light/lux level etc. Surely you just want to know when theres mail and not 300 pictures of the inside of your mailbox every day i assume?
That “example” above that you plan to try out. That isnt an example, thats someone elses configuration for how they need and want things to work and just copying it and trying it isnt a good idea. Just go to the website, they give you esp32-Cam base configurations you can use to start with. Theres also more than 1 type of esp32-Cam so make sure you use the config thats for YOUR board and not someone elses.
I guess I’m kinda lucky that copy and pasting the above code worked out for me.
Here’s where I am, I’ve got it to where esp32-cam wakes up every 5 minutes for 90s. When it’s awake it sends a mqtt message, and I setup an automation to run the shell script on receipt of the message. I used curl to download the jpg from the snapshot, always overwriting the same file name.
The mailbox is 300ft from the house, it would be nice to glimpse a screen to see if the mail is in, so I don’t have to walk out and check multiple times a day.
It’s not installed yet, I’m waiting for battery stuff to come in.