Google Drive connectivity on a Pi?

Guys,
An upcoming project that Im starting to think about…

Essentially RPi takes a photo on an event trigger (PIR sensor etc), save file to a cloud drive and then alert me via message.

I have a Google Drive account so would like to use this as the online data store. I also have PushBullet configured so that could send me the alert.

I have read several sites that talk to getting Google Drive working in some form or another but all seem to date back to 2014 / 2015 and seem incredibly clunky.

Has anyone seen this done more recently, presumably with a more seamless integration?

My other thought was to mount a drive on the RPi back to a PC with Google Drive installed on it and let that PC do the synchronising but this seems inefficient.

Thoughts? Maybe even a RPi / Google Drive turorial :slight_smile:

Thx
Jon

Hi Jon,

There are lots of tutorials out there for this.

And this.

Or you could use IFTTT.com

1 Like

Quick update.

I stumbled across this tutorial:

It works almost exactly as I want it to, arguably better in some ways. I am using Microsoft OneDrive, not Google but I suspect Google would work also.

The tutorial is configured to pull a folder from an online cloud drive to the Pi, but by swapping the source and destinations around you can simply copy or sync a folder on the Pi to the online cloud folder.

The tutorial installs a fancy GUI for scheduling but its essentially a wrapper for Cron.

With this solution in place my LoPy4 sends data to TTN and NodeRed reads & charts it. I have also setup another node to append the data to a CSV file. Now, this CSV file gets uploaded to my OneDrive folder and is a) backed-up and b) accessible without having to tunnel back to the Pi:)

R
Jon

If you’re still looking for the best way to handle this, Rclone is definitely the ‘gold standard’ for syncing whole folders on the Pi.
However, if you just need to pull down individual files or assets for a script without setting up a full sync client, I’ve found a much easier workaround. Google’s standard share links usually fail when you try to use wget in the terminal because of the preview page. I’ve been using https://drivelinkgenerator.com/ to get the direct download paths - it makes it super simple to just grab the file directly via the CLI without any authentication headaches.

1 Like

While I dont use google drive, so never tried, I would recommend using the API

With these sorts of things, normally the hardest part is the auth and session management, but its oauth so there should be a few ways to do it.

Hey @Britany309908,

Probably not a bad option for downloading publically accessible Drives, but without knowing more about the kind of security on drivelinkgenerator / who runs it, I wouldn’t feel comfortable using it for any sort of syncing project.

I think Michael’s response is going to be the cleaner and safer way to do this sort of thing.

Thanks I. ended up using rclone. From memory it worked very well.

1 Like