macintoshgeek
Posts: 24
Joined: Sun Feb 24, 2013 1:21 am

Uploading Motion files to Google Drive on Raspbian?

Sun Mar 10, 2013 10:38 pm

Hello,
I've been playing around with Motion on my Rapsberry Pi running Raspbian and came across this post that sounded like fun to do:
http://through-the-interface.typepad.co ... art-2.html

I've been trying to tweak the steps he lists to have it work with Raspbian, and as far as I know I should be good. I installed GData using

Code: Select all

sudo apt-get install python-gdata
And then I put the uploader.py and uploader.cfg files in /etc/motion and changed the motion.confg file to have the line

Code: Select all

on_movie_end /etc/motion/uploader.py /etc/motion/uploader.cfg %f
Am I missing something? Theoretically this should work on Raspbian right? What else has to be done?

Thanks

macintoshgeek
Posts: 24
Joined: Sun Feb 24, 2013 1:21 am

Re: Uploading Motion files to Google Drive on Raspbian?

Mon Mar 18, 2013 8:52 pm

Anyone have any ideas?

broo0ose
Posts: 317
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: Uploading Motion files to Google Drive on Raspbian?

Tue Mar 19, 2013 1:26 am

Do you get any errors?

macintoshgeek
Posts: 24
Joined: Sun Feb 24, 2013 1:21 am

Re: Uploading Motion files to Google Drive on Raspbian?

Tue Mar 19, 2013 1:49 am

No error is returned in motion. So I can't figure out where a problem could be coming from. I've adjusted the script as the tutorial said to to. And I would assume that it should be working with raspbian. I just can't seem to figure out where the problem is coming from.

broo0ose
Posts: 317
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: Uploading Motion files to Google Drive on Raspbian?

Tue Mar 19, 2013 1:45 pm

I've used the Google python API for Calendar and that worked perfectly, but my method used OAuth2 to do the authorisation.

If you want to try it that way I blogged the details here.
http://brucesbraindump.blogspot.co.uk/

then you would have to refer to the Google Drive API for the code to upload the motion files.
https://developers.google.com/drive/quickstart-python

HTH

Bruce

Camper
Posts: 2
Joined: Mon May 27, 2013 2:39 am

Re: Uploading Motion files to Google Drive on Raspbian?

Mon May 27, 2013 2:45 am

Try changing your "on_movie_end /etc/motion/uploader.py /etc/motion/uploader.cfg %f" to "on_movie_end sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg %f". It worked for me.

Camper
Posts: 2
Joined: Mon May 27, 2013 2:39 am

Re: Uploading Motion files to Google Drive on Raspbian?

Tue May 28, 2013 1:37 am

Camper wrote:Try changing your "on_movie_end /etc/motion/uploader.py /etc/motion/uploader.cfg %f" to "on_movie_end sudo python /etc/motion/uploader.py /etc/motion/uploader.cfg %f". It worked for me.
Actually it looks like may be a permissions problem with the motion user id. :oops:

I noticed that I would get uploads and emails if it saved the images and video as the user pi when starting with daemon off but would not get email or uploads when the files were owned by the user motion when running as a service with daemon on. I'm sure there's a more secure way of solving the problem but as a temp fix I added motion to the list of sudoers with nopasswd and now it works either way. The upload.py script is +x for all users/goups and the .cfg is +r for all users/groups, so it shouldn't be a permissions issue with the script. I'm pretty sure it's that the motion user not allowed to run python scripts. I'll work some more when I get down to that item on the "to do list".

diegoarpo
Posts: 1
Joined: Thu Nov 21, 2013 5:27 am

Re: Uploading Motion files to Google Drive on Raspbian?

Thu Nov 21, 2013 5:32 am

I am running into the same issue, the python script will work on the terminal but not on the motion.conf file when added. I have tried multiple proposed solutions, sudo python xx.py, python xx.py, ./xx.py (after chmod), and /home/pi/xx.py ... none would work. Is there a simpler way to test that the motion.conf on_picture_save event works?

w0lfcry
Posts: 1
Joined: Sun Feb 02, 2014 7:58 am

Re: Uploading Motion files to Google Drive on Raspbian?

Sun Feb 02, 2014 8:10 am

I was having the same problem. After many trials, I settled with the below

Code: Select all

on_movie_end sudo -u motion /home/motion/uploader.py /home/motion/uploader.cfg %f >> /tmp/end.log
I inserted motion using visudo. motion is also the owner of uploader.py and uploader.cfg

Bobby05
Posts: 1
Joined: Sun Jul 14, 2019 6:36 pm

Re: Uploading Motion files to Google Drive on Raspbian?

Sun Jul 14, 2019 6:46 pm

Is there a way to have the videos be sent onto one Google Docs, instead of just sharing the videos to the drive?

Return to “Networking and servers”