Scripts and Methods to Upload Files to Google Drive from Raspberry Pi

[UPDATE] After considering all the options below, I went for Jeremy’s Python Script. It looked like the simplest method – if it worked (and it did!). Here are the detailed instructions I wrote for getting it to work. Jeremy’s Blog got the Google Authentication steps wrong, because Google changes their processes without notice.

So Many Options

There are some options to consider. One is Grive, which, if you believe the Internet, doesn’t work anymore.

However: “There was previously an open-source command-line tool named Grive and a graphical counterpart named Grive Tools. However, Grive has been abandoned and is no longer functional due to changes in the Google Drive API. Instead of updating the old open-souce application, the developers created a new application named overGrive and are selling it for $5” (HowToGeek).

A Command-line Tool by a Google Drive Developer, “Drive”

If you’re more of a Terminal geek, “drive” is a small command line program that runs on both Linux and macOS. It’s open-source and written in Google’s “Go” programming language. You need to install the GO programming language. This program was originally written by Burcu Dogan, aka rakyll, a Google employee who has worked for Google Drive’s platform team. It’s even copyrighted by Google.

GDrive

This one is a contender. Synchronizes a directory between the Pi and Google Drive. So if you delete a file from one, it will delete from the other, etc. You can’t independently upload/download.

https://github.com/prasmussen/gdrive

https://forums.plex.tv/discussion/262597/i-wanted-to-share-a-script-for-transferring-files-from-linux-to-google-drive

https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=109587

https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=156699&p=1022207&hilit=gdrive#p1022207

Motion Google Drive Uploader

This one looks promising. It’s a python script that was written for Motion.

Grive2

I’m a little skeptical of thise, due to the amount of setup it requires and that you need to refer to a .ru site for information. https://github.com/Grive/grive

OverGrive

A paid application. $5.

Upload Idea

I can create a file on my web server that I can write to via PHP. Have the Raspberry Pi monitor that file for content, and if it finds content, execute a BASH script.

For example, I write to my file at https://www.myserver.com/pi/commands.txt, and I add “uphoto” to that text file. The Ra spi reads that file, and if it has “uphoto” in it, it executes a BASH script to upload the contents of a photo directory to Google Drive. I then overwrite commands.txt with “dphoto” that tells the Raspi to delete all the photos.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s