Notifications
Clear all

Upload ESP32-CAM pictures to...?  


YurkshireLad
(@yurkshirelad)
Estimable Member
Joined: 3 months ago
Posts: 225
Topic starter  

I have a simple sketch for an ESP32-CAM module that is connected to an RWLC-0516 motion sensor. The code monitors the sensor and automatically takes a picture when motion is detected.

I don't know what to do with the pictures. I have a wyze camera at home that sends a notification plus a picture to my phone when it detects motion. The pictures are available on my phone wherever I am.

I could automatically email pictures from my ESP32-CAM to myself, but I'd need a SMTP service that I could use at no cost, so there's probably a limit on the number of emails I can send.

I could automatically upload the pictures to a website, but I'd have to set one up that accepts private uploads but also uses user accounts so only my wife and I can access the pictures.

I could try to upload them to something like Google photos, or OneDrive but I need to easily be able to delete them from a phone.

If I upload the pictures somewhere, I'd like them to be automatically deleted if they're too old.

Has anyone done something like this?


Quote
MadMisha
(@madmisha)
Estimable Member
Joined: 1 year ago
Posts: 130
 

Link to Google Photos API and here is the more commonly used Google Drive API. I have been sitting on the Google drive one for a long time. It's free, sharable and can easily be crated. I did just find this: Arduino Project Hub-Upload images to Google Drive. Google Drive has apps so you can easily delete and view from your phone.


ReplyQuote
YurkshireLad
(@yurkshirelad)
Estimable Member
Joined: 3 months ago
Posts: 225
Topic starter  

Thanks. I haven't looked at any Google APIs yet, so those are helpful links. The only problem I can see there is that the picture isn't stored no a filesystem and their API to upload to Photos expects a file. Still, lots of reading to be done.


ReplyQuote
Arlo
 Arlo
(@arlo)
Active Member
Joined: 1 week ago
Posts: 9
 

@yurkshirelad

I made the motion activated cam also and used the code found here. It will take a picture , record it on the micro sd card, then send it to my email. I made a gmail account just for this in case it starts sending too many and gmail locks it out as spam. I did have to change settings in gmail to use less secure apps. It takes about 15 seconds from the time it takes a picture until a email is recieved.

                   Arlo.


ReplyQuote
YurkshireLad
(@yurkshirelad)
Estimable Member
Joined: 3 months ago
Posts: 225
Topic starter  

I found out that Home Assistant has support for cameras, but darned if I can work out how to make it work.

I'm publishing the image from the ESP32-CAM to an MQTT queue:

  String imgDataB64 = base64::encode(fb->buf, fb->len);
  client.publish(MQTT_TOPIC, imgDataB64.c_str()); 

I defined a camera in Home Assistant:

camera:
  - platform: mqtt
    topic: home/diningroom/camera
    unique_id: dining_room_camera
    name: "Dining Room Camera"

I added a Picture card and selected the dining room camera entity. But nothing happens.I don't see anything in the logs to show that a message is sent via MQTT or that Home Assistant received anything. The above code doesn't show that an error occurred during the publish.

Has anyone made this work?


ReplyQuote