Upload photos from ESP32 camera to Google Drive folder
ESP32 is an awesome piece of hardware. It would be awesome to use it as a timelapse camera. Instead of saving files to the SD card, one might want to upload pictures. But where? Google drive is perfect for such a purpose.
Google scripts do not support direct uploading of binary files. Photo is split into chunks which are converted to base64 and uploaded as text.
Solution consists of two parts. Arduino code and Google script.
Open file config.h in Arduino and edit your wifi network SSID name and password as well as scriptId which you will get once you upload esp32.gs file into https://script.google.com/ .
Create a new project at https://script.google.com/ and copy there content of esp32.gs. Publish your newly created script by Publish > Deploy as web app. You will need to give it permission as asked.
This repo is build on the top of amazing work of https://github.com/gsampallo/esp32cam-gdrive . However gsampallo solution worked only with small photos.
Over the air update was added for convenience. AI-Thinker ESP32-CAM do not have option for choosing partition scheme in Arduino editor. By default it only offers Huge App. If you want to use OTA you need to add a custom build.local.txt file into Arduino15\packages\esp32\hardware\esp32\1.x.x\boards.txt as stated here. Restart Arduino and select Minimal SPIFFS partition scheme.
esp32cam.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
esp32cam.menu.PartitionScheme.huge_app.build.partitions=huge_app
esp32cam.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
esp32cam.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
esp32cam.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
esp32cam.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080