My Texas Cam - Just Like Being There - Raspberry Pi using Python Motion Capture and grive

Опубликовано: 04 Июнь 2026
на канале: Claude Pageau
2,535
11

source available at https://github.com/pageauc/pi-timolo
My Texas Cam - Just Like Being There
Raspberry Pi Python Motion Capture
and syncing to my google drive using grive
-------------------------------------------------------------
This Robin Cam is a grive (google drive) capable raspberry pi
computer based security camera that uses a lightweight python motion detection program to capture images with the pi camera module.

Download full installation instructions from github here

https://raw.github.com/pageauc/pi-mot...

Download github raspbian tar archive file from here

https://raw.github.com/pageauc/pi-mot...

Raspberry PI forum for lightweight python motion detection topic

http://www.raspberrypi.org/forums/vie...

Introduction
-----------------
Recently I have been working on a grive capable security camera using two types of security camera cases.
One is a small fake plastic security cam case from Amazon. Model A or B fits inside with wifi only.(used in this video)

http://www.amazon.com/gp/product/B004...

Here is a larger aluminum camera case that I have a model B installed in. This one has room for a usb power supply etc..

http://www.amazon.com/Monoprice-10843...

I may do a youtube video on How To setup these cases with the raspberry pi computer and camera module installed.

After some programming changes I now have the Raspberry Pi security camera's working efficiently from a software point of view.
The current configuration uses a modified version of pimotion.py script to save files to a number sequence instead of a date-time sequence.
I also added some code (not mine) to optionally put date/time information directly on the photo images.
This is convenient to see the exact time stamp that the photo was taken.
Using number sequencing allows limiting the number of files that need to get synchronized to my google drive.
It was too much to manage all the dated files and cleanup in google drive.
This method restricts the number of motion files that need to get updated via grive. Files are overwritten in Round robin fashion.
If you need more history you can write a routine to save google drive files from a synchronized PC folder to a dated archive folder
using a windows robocopy freefilesync or similar program through a batch file. Synchronization uses a rpi compiled version of grive.
This requires slightly modifying the source code to make it compatible with the RPI.

The tar file is a complete setup including a precompiled grive to reduce the effort required to get this working.
To automate the security camera operation, I have setup pimotion.py to run from a /etc/init.d/pimotion.sh bash script
by copying skeleton file to pimotion.sh script (sample included). Then modified to run your pimotion.py script on boot.
see later in post for more setup detail.

You must have a raspberry pi model A or B with the latest raspbian build and pi camera module installed and working.
There are several tutorials showing how to do this so it is not covered here.
This assumes you know how to cut and paste into nano or similar text editor on the pi using ssh.
You also need an operational internet connection via wifi or wired connection.
Wifi needs to be setup to work on boot with no desktop in order for the camera to sync unattended with your google drive.
I have written the pimotion python script and bash sync scripts to make it somewhat independent of the folder names etc.
This minimizes hard coding folder names in the scripts.
If you run the script manually from the command line then settings and activity information will be displayed.
Just a little setup for pimotion.py If you already have a pimotion.py then mv existing file to another file name

Download and Setup Instructions
-------------------------------
ssh into an internet connected raspberry pi and execute the following commands.
Note change picam to a folder name of your choice if required.

cd ~
mkdir picam
cd ./picam
Download pimotion.tar file from my github account
wget https://raw.github.com/pageauc/pi-mot...
Extract tar files to current folder
tar -xvf pimotion.tar
Install required grive libraries from the internet
sudo ./grive_setup.sh
This will setup google drive security connection see details below
You will need to cut the rpi grive url displayed from above command

See full instructions in Readme.txt file.