Raspberry Pi Motion Project

Well, some hundred or more hours spent, I have a grasp on how to set up a motion activated camera with my Raspberry Pi.

At first, I spent some time with PiKrellCam, which has some really great features, but it works only (or best) with the Pi camera. You can read my opinion on PiKrellCam elsewhere – but ultimately, I decided to use Motion (aka The Motion Package or The Motion Project). Also, after getting Amazon’s Echo “Alexa” installed and working with the Playstation Eye webcam, I decided that using cheap webcams works just as well than the more expensive Pi camera for sheer motion detection.

Initially, I installed Motion and fiddled with it, using one of the many installation web tutorials, but it took me two weeks to actually find the project page. This was due to the name, which is regrettably named something so common that it’s impossible to find. It’s like creating a backup program and calling it “Backup”; good luck finding it. Please, please rename it to MotionNV, MotionXYZ or something that I can use in a search string.

To put this into context, I’m pretty new to Linux and the Raspberry Pi. I started on this quest about four months ago, so I’ve learned a lot in a short period. And initially, I was setting up a security cam, but half way through my project, I decided to create a Granny Cam instead to put at my Granny’s house.

Also, since I was fooling with so many uses for the Pi, I installed a shedload of applications on it, including MotionPie. I decided not to use MotionPie, because it seemed like unnecessary overhead, and I could never get it to look like it does on its project page. To make it easier to replicate, I decided to install Motion from a clean Raspbian image – this burned up one entire beautiful spring Saturday, because the Motion installer fails to properly permit the /var/lib/motion directory – therefore, it fails when run. I thought it was a problem with the camera, because when I started Motion, the camera would turn off.

The fix to the /var/lib/motion directory problem is fairly easy, and I found it in the forum. But first, I changed the target_dir in motion.conf, then I changed the target_dir:

mkdir /home/pi/MotionFiles
sudo chgrp motion /home/pi/MotionFiles
sudo chmod g+rwx /home/pi/MotionFiles
sudo chmod -R g+w /home/pi/MotionFiles/

Holy Moses. This sent me down the wrong rabbit hole. In the future, I shall ALWAYS check permissions. And how I found it was by running Motion in non-daemon mode by:

motion -n

This showed me the permissions error that got me on the right track. I didn’t know I could run it this way, because the only way I knew how to run it was:

sudo service motion start

It was around this time that I found the Motion documentation. And while thorough, it fails to provide examples. And since I’m new at python, BASH, Linux, etc. it made it SO much harder to figure out simple commands without examples.

Everything in Motion.Conf

Ultimately, I set the image capture option to “center”, because I don’t want to capture video nor the entire event in photos. Here are the lines I changed in motion.conf:

   daemon on
   logfile /tmp/motion.log
   width 640
   height 480
   framerate 15
   output_pictures center
   quality 100
   ffmpeg_output_movies off
   target_dir /home/pi/MotionFiles
   snapshot_filename %Y%m%d_%H%M%S-snapshot
   picture_filename %Y%m%d_%H%M%S-motion-%q
   stream_port 8765
   stream_quality 100
   stream_maxrate 5
   stream_auth_method 1
   stream_authentication myusername:mypassword
   webcontrol_port 8766
   webcontrol_localhost on
   webcontrol_authentication myusername:mypassword
   on_event_start python /home/pi/scripts/on_event_start mo_%H%M%S
   sql_log_picture on
   sql_query insert into security(camera, filename, frame, file_type, time_stamp, event_time_stamp, Other) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C', '%D|%i|%J|%K|%L')
   database_type mysql
   database_dbname motion
   database_host localhost
   database_user myusername
   database_password mypassword
   database_port 3306

Side note: to view all config settings:

grep ^[[:alpha:]] /etc/motion/motion.conf

Many of these are self-explanatory, but some are definitely not. I removed the %v (event#) from the file name, because when I view them in a GUI, they don’t sort by date. Here are the variables that you can use for file name or even file output:

   # %Y = year, %m = month, %d = date,
   # %H = hour, %M = minute, %S = second,
   # %v = event, %q = frame number, %t = thread (camera) number,
   # %D = changed pixels, %N = noise level,
   # %i and %J = width and height of motion area,
   # %K and %L = X and Y coordinates of motion center
   # %C = value defined by text_event

Adding functionality outside of Motion is part of the fun, so of course I added a Python script:

on_event_start python /home/pi/scripts/on_event_start.py motion

Initially, I tried using a BASH script, but it wouldn’t work – this is where an example would really help. Anyway, I probably should start using Python instead. Here’s my on_event_start.py:

   import urllib
   import sys
   import os
   def rndmp3 ():
   file = '/home/pi/Music/alarm.mp3'
   os.system ('omxplayer ' + file)
	arg1 = sys.argv[1]
   url = "http://www.mywebsite.com/recordIP.php?motion=” + arg1
   content = urllib.urlopen(url).read()
   print url
   rndmp3 ()

This script kicks off my PHP script that logs the IP address of the Pi (because it’s connected to via DHCP, so there’s no guarantee that it will be the same). I could have made this PHP script do more, but I’d like the Pi to do as much as possible by itself. It also plays an alarm MP3, which is pretty annoying.

What is missing from the capture data is the event duration. I had to work around this deficiency by adding two new fields and add it to the MySQL database: start and end date/time.

I also installed MySQL to capture every event and its details:

      mysql> create database motion;
      mysql> CREATE USER 'myusername'@'localhost' IDENTIFIED BY 'mypassword';
      mysql> GRANT ALL PRIVILEGES ON motion.* TO 'myusername'@'%' WITH GRANT OPTION;
      mysql> use motion;
      mysql> CREATE TABLE security (
      camera int,
      filename char(80) not null,
      frame int,
      file_type int,
      time_stamp TIMESTAMP,
      event_time_stamp TIMESTAMP,
      Other varchar(100),
      start DATETIME,

Then create a python script to update the database on event end:

UPDATE security SET start = security.time_stamp, end = '2017-05-04 10:05:18' 
WHERE filename ='/home/pi/MotionFiles/20170504_091534-motion-03.jpg';

It copies the original event start timestamp to the start field, and add an end timestamp to the end field. I think this will be helpful when identifying events. Some events are just a few seconds, while others are much longer. Plotting this trend will allow me to monitor general activity.

And for trending purposes, this is critical. Here is the logic tree:

Motion detected

Saves center image.

Logs in db.

IP address captured externally.

# of pixels changed

# of seconds long is the event


# of events per day

# of pixels changed per hour, per day

# of seconds is an event per hour, per day

# of minutes without event – if x hours passes without event, then email.

If the trend is low, send email:

Subject: Granny Low Activity

Body: Average pixels changed per day is ###. Today’s average: ###

But I’m really jumping ahead to the end of the story. I spent hours and hours on this, trying to get the damn thing to do what I wanted.

I created a BASH script that checks the event log for Motion:

grep "motion_detected: Motion detected – starting event" /tmp/motion.log

And I created an SSH monitor to keep an eye on login attempts. Did I mention that I opened up the Pi to SSH? Well, I did. But before I did that, I changed my SSH port to something other than 22, changed the Pi user password, and installed Fail2Ban.

Allow Motion to Write to USB Drive

It seems like every step of the way involves days-long research. For example, I was able to get Motion to write to a file in /home/pi/MotionFiles, but I read that it’s not good for the SD card to write so often, so I added a USB drive to the Pi.

Adding the USB drive is a pain in the ass too, because initially it is auto-mounted at a location where I don’t want it. So to mount it every time I boot the Pi to a mount point that I like, I had to edit /etc/fstab, but first, I had to find the UUID of the drive. This means that I have to unmount it first.


Shows where I DON’T want it mounted (it’s sda1):

   sda           8:0    1    2G  0 disk
   +-sda1        8:1    1    2G  0 part /media/pi/8C24-0A33 [this is the usb drive default mount point]
   mmcblk0     179:0    0  7.4G  0 disk
   +-mmcblk0p2 179:2    0  7.4G  0 part /
   +-mmcblk0p1 179:1    0   41M  0 part /boot

Get the UUID of the drive. You’ll need this for the fstab line.


Look for “sda1” – it’s along string, like “1231536e-d084-4569-8bea-d425d71d8de6”

Now unmount it:

sudo umount /media/pi/8C24-0A33

To make matters easier, I also reformatted the vfat USB to ext4. You have to unmount the drive before doing this. I don’t recall the exact steps here, but it’s something like:

sudo mkfs.ext4 /dev/sda1

In the future, I probably will keep the drive set to vfat so I can swap it out to a Windows machine.

Create the mount point where you want it:

sudo mkdir /media/usbdrive


sudo mkdir /media/usbdrive/MediaFiles

The directory: /media/usbdrive will be the mount point.

Now edit fstab:

sudo /etc/fstab

At the end of the text file, add:

UUID=1231536e-d084-4569-8bea-d425d71d8de6 /media/usbdrive ext4 nofail,defaults 0 0

Now that it’s in fstab, remount it using:

mount -a

If it gives you an error, don’t try rebooting! It means that your fstab line is wrong somehow. Fix it and mount -a again until you get no errors. If you continue to get errors, don’t reboot! If you do, it will hang (probably), and you’ll have to connect a display/keyboard to then edit /etc/fstab. If you do reboot and get the hang, don’t use sudo – use just nano /etc/fstab.

Yay – now you have a USB drive mounted in a location that you want and it mounts on boot.

But Motion doesn’t have write access, so you might think that changing group permissions would work:

sudo chgrp motion /media/usbdrive/MotionFiles

Alas it did not. So what I did instead, is I added the “motion” user to the “pi” group:

sudo adduser motion pi

I then edited the motion.conf file and changed the target_dir

sudo nano /etc/motion/motion.conf
target_dir /media/usbdrive/MotionFiles

Now if all goes well, you can sudo service motion start and it will write to the new location.

Troubleshooting Tips

Most Common Commands

sudo service motion start

sudo service motion stop

sudo service motion restart

sudo service motion status

Although you can run just “motion status”, “sudo service motion status” is the one that checks the daemon.

Motion Starts then Stops

If it’s running at first then immediately shuts down when detecting motion, then it’s likely that the target directory can’t be written to. Make sure your permissions are correct, and make sure the disk isn’t FULL:

df -Bm

The Motion web page on your Pi is:

http://yourPiAddress:yourport (

Online Help is here:


Copy Files from Pi

Use the pscp command from a Windows terminal. 1234 represents the port. I think pscp is installed when you install Putty.

pscp -P 1234 -pw yourPiPassword pi@*.jpg D:\Trash\MotionFiles

List the drives:

sudo fdisk -l

Basic Commands

cd /etc/motion
sudo cp motion.conf motion.orig
sudo nano /etc/motion/motion.conf
stream_localhost on - >stream_localhost off
on = only stream to localhost and don't allow it anywhere else. You want this OFF
sudo nano /etc/default/motion
start_motion_daemon=no -> start_motion_daemon=yes
sudo service motion start
Navigate to the default URL: yourpiIPaddress:8081

List USB Devices


Get the uuid of the usb drive


Look for sda1

See what user is running the Motion daemon:

ps aux | grep -v grep | grep motion
motion   29741 12.6  1.7  71424 15260 ?        Sl   15:54   0:00 /usr/bin/motion

The first item should be “motion” and not “root” or anything else.

Different Ways to Run Motion:

motion start = will start motion as user pi

sudo motion start = starts motion as user root

sudo service motion start = starts motion as user motion



Hate Adobe Creative Cloud

Adobe has become one of the latest companies who feel the need to punish their legitimate customer base for the sins of pirates. Pirates will always find a way to use locked software; the only people who suffer are the non-pirate users. Forcing their users into something they don’t want is simply a betrayal. I would gladly pay an extra $10/license to shore up any pirate loss they feel they need to recover, but forcing me into a subscription model – a BAD one – is intolerable.

Since moving to Creative Cloud, all the applications within it grind my PC to a halt. Even “free” Adobe Reader locks up my PC for half a minute after opening a PDF. And although I have paid for the subscription, I continue to be nagged about my account expiring. It’s a horrible user experience.

And why did they do it? Was it to enhance user productivity? Was it to provide extra functionality for its customers? Does it benefit their customer base whatsoever? No, no, no, no. It does nothing at all for their customers – except make them frustrated and want to stop using Adobe products.

Everything about the experience is bad. I’m currently looking for alternatives, and I may buy the last non-cloud version, CS6, and never upgrade again. But more likely, I will switch to other products. Gimp is supposed to be a pretty good alternative to Photoshop. I can use Handbrake for Media Encoder. There are several options for a WYSIWYG HTML editor – all open source. Foxit Reader, please, for my PDFs. The only application I can’t substitute is Captivate – but Articulate makes a good replacement.

I’ve been using Adobe products since the late 1980s. It’s taken that long for truly good alternatives to surface, and now it’s time to move on. I know that Adobe doesn’t care about my single account. But that means it doesn’t care about yours either.

Set Up SheepShaver on Windows 10

Install Mac OS 9 Using SheepShaver

Alex walks you through this on YouTube.

Get the Files

  1. Download and install SheepShaver in a directory called “SheepShaver”.
  2. Download and unzip “New World PPC ROM
  3. Download “Apple Mac OS 9.0.4 (ISO)” version 9.0 (and not 9.1 or 9.2)
  4. Download “gtk2-runtime-2.24.10-2012-10-10-ash.exe” – you will need these.
  5. SheepShaver comes with MAC OS 9 ROMs that don’t work. You can delete those.
  6. Copy the newworld86.rom to the SheepShaver directory.
  7. Rename the newworld86.rom to “Mac OS ROM” with no extension.
  8. Use 7zip to unzip the Apple Mac OS file. It creates a Apple Mac OS 9.0.4.ISO file.
  9. Copy the Apple MacOS 9.0.4.ISO file to the SheepShaver directory.
  10. Make the Apple MacOS 9.0.4.ISO file read only: Right mouse click > Properties > Read Only. The Mac checks to see if the ISO is read only and errors if it is not.
  11. If you try to run SheepShaverGUI.exe without the GTK Runtime files, it will error with “The program can’t start because libgtk-win32-2.0-0.dll is missing…” So install these files by running gtk2-runtime-2.24.10-2012-10-10-ash.exe.

Configure SheepShaver

Open SheepShaverGUI.exe. Once you set everything up, you can run SheepShaver.exe directly.

On the Volumes Tab

  • Select your actual CD ROM drive.
  • Check the Enable “My Computer” icon. This allows you to access your Windows PC files from within the emulated OS.
  • Create a Virtual Hard Drive.
    • Click Create.
    • Set the Size to 500 minimum or 1000 (1GB) for more storage. This creates a disk file of that size in the SheepShaver directory. You can name it whatever you want, such as “Mac OS 9.hfv”, and add the extension HFV.
  • Add the Mac OS 9 CD.
    • Click Add.
    • Select the Apple MacOS 9.0.4.ISO file.

On the Graphics/Sound Tab

  • Video Type: Window
  • Refresh Rate: Dynamic
  • Width: 1024
  • Height: 768

On the Memory/Misc Tab

  • MacOS RAM Size (MB): 512
  • ROM File: leave blank.
  • Check Ignore Illegal Memory Accesses

Click Start.

SheepShaver throws a CD error: “The CD-ROM driver file ‘C:\WINDOWS\system32\drivers\cdenable.sys’ is missing”. You can ignore this – just click OK. If you copy the file to from the “\SheepSaver\CD-ROM drivers\cdenable.sys” and put it in “C:\Windows\SysWOW64\drivers\” the error goes away. Maybe you have to reboot after putting it there.

OS 9 should run now.

Within OS 9

A popup asks “This disk is unreadable by this Computer…”

  • Give the disk a Name (Mac OS 9), leave the Format to Mac OS Standard 1,000 MB, and click Initialize
  • It says it will erase the disk, which is fine – click Continue.
  • The desktop displays.

Now you need to install the OS onto the hard drive.

  • Click Mac OS 9 Install (on the ISO image)
  • The installer starts.
  • Click Continue.
  • Destination Disk: Mac OS 9 (as it was named above)
  • Click Select.
  • Continue. Continue. Agree.
  • Click Start.
  • Mac OS 9 will install to the hard drive.
  • Click Quit to leave the installer.
  • Click Special > Restart. It will boot from the hard drive.
  • Run through the Introduction
  • Set your region, name, time, etc. Simple finder: No. Skip the network. If it freezes, just hard shut it and restart.
  • Special > Shutdown

Open the SheepShaverGUI.exe again.

Select the Apple MacOS 9.0.4.ISO file, and click Remove. We don’t need the install disk anymore.

Now you have a Mac OS 9 computer. You can now run it from SheepShaver.exe.


Now that you have it running, you will inevitably want to browse the Internet. Download and install Classilla.

  1. Open SheepShaverGUI.exe, click the Network Tab, select Basilisk II Slirp.
  2. Click Start.
  3. Go to Apple > Control Panel > TCP/IP
    • Connect via: Ethernet
    • Configure: Manually
    • IP Address:
    • Subnet mask:
    • Router address:
    • Name server addr:

Note that these are the actual values. Don’t try putting your own router or IP addresses in.


Macintosh SE

Mac Support

I’d really like to install a Raspberty Pi in this.

Or run the monitor with the Pi.

Mac Roms for emulation.

Many of these models may not come with a hard drive, and for those floppy-only Macs I recommend System 6.0.8, because it is the latest system designed to be realistically useable in a floppy-only environment.

For these Macs with a hard drive, I recommend System 7.0.1 for general use. For these computers it has much lower RAM and disk requirements than 7.1 or 7.5, and it supports most programs that require System 7. Your little Mac will be happier with the slim 7.0.1.

Dowload OS.

Macintosh SE. 1Mbyte RAM, 800k Drive, 20SC Hard Disk.

Model No. M5011; © 1986 Apple Computer Inc.

Monitor/screen dimensions: 7 3/8 x 5 7/8 or 7.5 x 6 for simplicity.

Getting boot disks for this is not so easy without another Apple with a floppy drive. The boot images are easy enough to find, as are 800k disks (that’s 720k disks for PCs), but you need an Apple floppy drive to write 800k on those 720k disks; the floppy drives for PCs – and all the USB floppy drives – can’t write at “variable speed” like the Apple drives do. So you need an old Apple – but not too old – to write the disks.

“You would use Disk Copy 4.2 or 6.3.3 in order to make sector-copied floppies from disk images (the Make A Copy button in version 4.2, or the Make a Floppy command under the Utilities menu in 6.3.3).”

So I need an old Apple, Disk Copy, and the image files. I have two out of three.

Raspberry Pi Drives Macintosh CRT

This is probably beyond my ability, but this guy wired a Pi’s composite video output to a Mac CRT. From MincePi:

A word of warning – that project won’t work unless you use the same Raspbian version as used in the project. The kernel API has changed so much since then that the kernel modules won’t compile any more. The Pi foundation keeps old versions of Raspbian available on their site, so this shouldn’t be a problem. This project also assumes a Pi model B, and the PCM port pins have changed starting on the B+. You might not have to change the kernel module, but might be able to use the gpio utility to remap pin functions.

I’ve not updated the project since it would be better to use the DPI interface on the Pi instead of the combination of PCM and PWM. That would give you a normal framebuffer, and let you see the bootup messages etc. The problem with this is the timing of the Mac display is a little wonky – I don’t know if it’s possible without a bit of delay circuitry. And I don’t have time right now to do this.

If I remember correctly, the GUI should run. You have to point it to the second framebuffer though. There should be instructions to do this on the Web. It’s the same thing you have to do to use a PiTFT display.

The emulator I was going to run needed to have a bit of code changed. It assumes a 640×480 display, and this setup uses the native Mac resolution of (something like) 512×348. I never got around to doing that.

That’s all I can remember off the top of my head. If you have any problems, contact me and I’ll dig in and see if I remember what I did! I still have the original setup, so I should be able to test things.

Use ZIP Drive to Transfer Files

Instructions here.

Composite Video?

Cut CRT Tube with Diamond Grinder

Amazing reboot of an SE/30.

Mac Capacitor Service.


Generate Disks on PC

Disk Images

A color CRT won’t fit inside a Classic case. It is physically too long.

Power Mac
Power Macintosh 4400

The Shocking Truth About the Deadly CRT

Power-on your compact Mac. Crank up the brightness all the way. Yank the power cord. Wait two seconds. Now the CRT is discharged and you can pry off the suction cup with a screw driver.

It works because you have the juice flowing into the CRT maxed out (full brightness) and when you yank the power cord the CRT desperately is searching for more juice to keep itself alive. Because of that, it grabs all the available juice it can find in the electronics powering the CRT until they run completely dry. They run dry very quickly because the CRT is maxed out in brightness.

If you are dissatisfied with that layman’s terms explanation, think of it in terms of a load on a capacitor. There are certain types of capacitors called “memory capacitors” that keep clocks or memory alive (for several days or weeks, until the capacitor runs out of juice) when the main power is cut. These caps can keep the circuit alive for a long time because the circuit attached to those caps sips very little power in the first place. Now compare that example with the capacitors in the power supply of a Mac Pro computer. How long do you think those caps can keep the computer running after you yank the power cord on it (however big, fat and physically large they may appear to be to your eyes)? Milliseconds at best. That’s beause the computer requires so much more power thank those capacitors can supply. The computer drains all those PSU caps almost instantly when the main power is cut.

Simply put, the CRT when brightness is cranked up all the way draws more power than any residual power in the computer (after the power cord is yanked) can supply. Because the CRT uses up all that residual power in a few short milliseconds, there is nothing left in the video circuitry of the vintage compact Mac to shock you.

Video Adapter: 6-switch DB15 to VGA adapter

Iomega Zip Drive 100

I want to clear up some misinformation that I read before attempting to connect an old Zip 100 SCSI drive to a PowerPC 7100 external SCSI port. I read on the Intertubes that you must find the actual Iomega SCSI cable for the drive to work. I can tell you that that is fake news.


I found a DB25 male-to-male Belkin parallel cable (printer cable) at a thrift store yesterday (2017-07-21), and today I plugged it in to the 7100 and it works perfectly.  The termination was set to 0 and the SCSI ID to 5 (I would guess the ID is for the second port if you wanted to continue to daisy chain more SCSI devices). I didn’t change those from whoever owned the drive before me. I have not tested it on the Macintosh SE, but if it works on the PowerPC, I would expect it to work on the SE in the same configuration.

Processor Model Clock speedMhz) FSB speed (MT/s) L1 cache (bytes) Introduced Discontinued
MC68000 Lisa[2] 5 5 Jan-83 Jan-84
MC68000 Lisa 2[2] 5 5 Jan-84 Jan-85
MC68000 Macintosh XL[4] 5 5 Jan-85 Apr-85
MC68000 Macintosh[3] 8 8 Jan-84 Oct-85
MC68000 Macintosh 512K 8 8 Sep-84 Apr-86
MC68000 Macintosh Plus[5] 8 8 Jan-86 Oct-90
MC68000 Macintosh 512Ke[6] 8 8 Apr-86 Sep-87
MC68000 Macintosh SE 8 8 Mar-87 Aug-89
MC68000 Macintosh SE FDHD 8 8 Aug-89 Oct-90
MC68000 Macintosh Classic 8 8 Oct-90 Sep-92
MC68000 Macintosh Portable 16 16 Sep-89 Oct-91
MC68HC000 PowerBook 100 16 16 Oct-91 Aug-92
MC68020 Macintosh II 16 16 256 32/16 68881 68851 (optional) Mar-87 Jan-90
MC68020 Macintosh LC 16 16 256 16/16 Oct-90 Mar-92
MC68030 Macintosh IIx 16 16 512 none 32/32 68882 Sep-88 Oct-90
MC68030 Macintosh SE/30 16 16 512 none 32/32 68882 Jan-89 Oct-90
MC68030 Macintosh IIcx 16 16 512 none 32/32 68882 Mar-89 Feb-91
MC68030 Macintosh Classic II 16 16 512 none 16/32 none Oct-91 Sep-93
MC68030 Performa 200 16 16 512
MC68030 PowerBook 140 16 16 512 none 32/32 none Oct-91 Aug-92
MC68030 Macintosh LC II 16 16 512 none 16/32 none Mar-92 Mar-93
MC68030 Performa 400 16 16 512 none 16/33 none Mar-92 Mar-93
MC68030 Performa 405 16 16 512 none 16/34 none Mar-92 Mar-93
MC68030 Performa 410 16 16 512 none 16/35 none Mar-92 Mar-93
MC68030 Performa 430 16 16 512 none 16/36 none Mar-92 Mar-93
MC68030 Macintosh IIvi 16 16 512 32 32/32 none Oct-92 Feb-93
MC68030 Macintosh Color Classic 16 16 512 none 16/32 68882 (optional) Feb-93 May-94
MC68030 Performa 250 16 16 512 none 16/33 68882 (optional) Feb-93 May-94
MC68030 Performa 275 16 16 512 none 16/34 68882 (optional) Feb-93 May-94
MC68030 Macintosh IIsi 20 20 512 none 32/32 68882 Oct-90 Mar-93
MC68LC040 Macintosh Centris 610 20 20 8 Feb-93 Oct-93
MC68030 Macintosh IIci 25 25 512 0–32 32/32 68882 Sep-89 Feb-93
MC68030 PowerBook 170 25 25 512 none 32/32 68882 Oct-91 Oct-92
MC68030 PowerBook 145 25 25 512 none 32/32 none Aug-92 Jun-93
MC68030 PowerBook 160 25 25 512 none 32/32 none Oct-92 Aug-93
MC68030 PowerBook Duo 210 25 25 512 none 32/32 none Oct-92 Oct-93
MC68030 Macintosh LC III 25 25 512 none 32/32 68882 Feb-93 Feb-94
MC68030 Performa 450 25 25 512 none 32/33 68883 Feb-93 Feb-94
MC68030 Macintosh LC 520 25 25 512 none 32/32 68882 Jun-93 Feb-94
MC68030 PowerBook 145B 25 25 512 none 32/32 none Jul-93 Jul-94
MC68040 Macintosh Quadra 700 25 25 8 Oct-91 Mar-93
MC68040 Macintosh Quadra 900 25 25 8 Oct-91 May-92
MC68040 Macintosh Centris 650 25 25 8 Feb-93 Oct-93
MC68040 Macintosh Quadra 660AV 25 25 8 Jul-93 Sep-94
MC68040 Macintosh Centris 660AV 25 25 8 Jul-93 Sep-94
MC68040 Macintosh Quadra 610 25 25 8 Oct-93 Jul-94
MC68LC040 Macintosh LC 475 25 25 8 Oct-93 Oct-94
MC68LC040 Macintosh Quadra 605 25 25 8 Oct-93 Oct-94
MC68LC040 Performa 475 25 25 8 Oct-93 Oct-94
MC68LC040 Performa 476 25 25 8 Oct-93 Oct-94
MC68LC040 PowerBook 520 25 25 8 May-94 Jun-95
MC68LC040 PowerBook 520c 25 25 8 May-94 Sep-95
MC68030 Performa 600/600CD 32 16 512 32 32/32 none Sep-92 Oct-93
MC68030 Macintosh IIvx 32 16 512 32 32/32 68882 Oct-92 Oct-93
MC68030 Macintosh TV 32 16 512 none 32/32 68882 Oct-93 Feb-94
MC68030 PowerBook 180 33 33 512 none 32/32 68882 Oct-92 May-94
MC68030 PowerBook Duo 230 33 33 512 none 32/32 none Oct-92 Jul-94
MC68030 PowerBook 165c 33 33 512 none 32/32 68882 Feb-93 Dec-93
MC68030 PowerBook 180c 33 33 512 none 32/32 68882 Jun-93 Mar-94
MC68030 PowerBook 165 33 33 512 none 32/32 none Aug-93 Jul-94
MC68030 Macintosh LC III+ 33 33 512 none 32/32 68882 Oct-93 Feb-94
MC68030 Performa 460 33 33 512 none 32/33 68883 Oct-93 Feb-94
MC68030 Performa 466 33 33 512 none 32/34 68884 Oct-93 Feb-94
MC68030 Performa 467 33 33 512 none 32/35 68885 Oct-93 Feb-94
MC68030 Macintosh Color Classic II 33 33 512 none 32/32 68882 (optional) Oct-93 May-94
MC68030 PowerBook Duo 250 33 33 512 none 32/32 none Oct-93 May-94
MC68030 PowerBook Duo 270c 33 33 512 none 32/32 68882 Oct-93 Apr-94
MC68030 Macintosh LC 550 33 33 512 none 32/32 68882 Feb-94 Mar-95
MC68030 Performa 550 33 33 512 none 32/33 68883 Feb-94 Mar-95
MC68030 Performa 560 33 33 512 none 32/34 68884 Feb-94 Mar-95
MC68030 PowerBook 150 33 33 512 none 32/32 none Jul-94 Oct-95
MC68040 Macintosh Quadra 950 33 33 8 May-92 Oct-95
MC68040 Macintosh Quadra 800 33 33 8 Feb-93 Mar-94
MC68040 Workgroup Server 80 33 33 8 Feb-93 Mar-94
MC68040 Workgroup Server 95[7] 33 33 8 Mar-93 Apr-95
MC68040 Macintosh Quadra 650 33 33 8 Oct-93 Sep-94
MC68040 Macintosh Quadra 630 33 33 8 Jul-94 Oct-95
MC68040 Macintosh LC 630 33 33 8 Jul-94 Oct-95
MC68040 Performa 630 33 33 8 Jul-94 Oct-95
MC68040 Performa 630CD 33 33 8 Jul-94 Oct-95
MC68040 Performa 631CD 33 33 8 Jul-94 Oct-95
MC68040 Performa 635CD 33 33 8 Jul-94 Oct-95
MC68040 Performa 636 33 33 8 Jul-94 Oct-95
MC68040 Performa 636CD 33 33 8 Jul-94 Oct-95
MC68040 Performa 637CD 33 33 8 Jul-94 Oct-95
MC68040 Performa 638CD 33 33 8 Jul-94 Oct-95
MC68040 Performa 640CD 33 33 8 Jul-94 Oct-95
MC68040 PowerBook 550c 33 33 8 May-95 Apr-96
MC68LC040 Macintosh LC 575 33 33 8 Feb-94 Apr-95
MC68LC040 Performa 575 33 33 8 Feb-94 Apr-95
MC68LC040 Performa 576 33 33 8 Feb-94 Apr-95
MC68LC040 Performa 577 33 33 8 Feb-94 Apr-95
MC68LC040 Performa 578 33 33 8 Feb-94 Apr-95
MC68LC040 PowerBook Duo 280 33 33 8 Apr-94 Nov-94
MC68LC040 PowerBook Duo 280c 33 33 8 Apr-94 Jan-96
MC68LC040 PowerBook 540 33 33 8 May-94 Oct-94
MC68LC040 PowerBook 540c 33 33 8 May-94 Aug-95
MC68LC040 Macintosh LC 580 33 33 8 Apr-95 Apr-96
MC68LC040 Performa 580CD 33 33 8 Apr-95 Apr-96
MC68LC040 Performa 588CD 33 33 8 Apr-95 Apr-96
MC68LC040 PowerBook 190 33 33 8 Aug-95 Jun-96
MC68LC040 PowerBook 190cs 33 33 8 Aug-95 Oct-96
MC68030 Macintosh IIfx 40 40 512 32 32/32 68882 Mar-90 Apr-92
MC68040 Macintosh Quadra 840AV 40 40 8 Jul-93 Jul-94
PowerPC 603 Power Macintosh 5200 LC 75 37.5 8-Aug 256 Apr-95 Apr-96
PowerPC 603 Performa 5200CD 75 37.5 9-Aug 257 Apr-95 Apr-96
PowerPC 603 Performa 5210CD 75 37.5 10-Aug 258 Apr-95 Apr-96
PowerPC 603 Performa 5215CD 75 37.5 11-Aug 259 Apr-95 Apr-96
PowerPC 603 Performa 5220CD 75 37.5 12-Aug 260 Apr-95 Apr-96
PowerPC 603e PowerBook Duo 2300c 100 33.3 16/16 none Aug-95 Feb-97
PowerPC 603e Performa 6260CD 100 40 16/16 256 May-96 Jul-97
PowerPC 603e Performa 6290CD 100 40 16/17 257 May-96 Jul-97
PowerPC 603e Performa 6300CD 100 40 16/18 258 May-96 Jul-97
PowerPC 603e Performa 6310CD 100 40 16/19 259 May-96 Jul-97
PowerPC 601v Power Macintosh 7500 100 50 16/16 none May-95 May-96
PowerPC 601v Workgroup Server 7250 120 40 16/16 none Feb-96 Apr-97
PowerPC 603e Power Macintosh 6300/120 120 40 16/16 256 May-96 Jul-97
PowerPC 603e Performa 6320 120 40 16/17 257 May-96 Jul-97
PowerPC 604 Network Server 500[9] 132 44 512 1 Feb-96 Apr-97
PowerPC 604 Workgroup Server 8550 132 44 512 1 Feb-96 Sep-96
PowerPC 603ev Performa 6360[8] 160 40 16/16 none Oct-96 Oct-97
PowerPC 603ev PowerBook 1400c/cs 166 33.3 16/16 128 Nov-96 May-98
PowerPC 604e Power Macintosh 8500 180 45 256 1 Aug-96 Feb-97
PowerPC 604e Workgroup Server 7350 180 45 256 1 Apr-97 Mar-98
PowerPC 604e Power Macintosh 7600 200 50 256 1 Aug-96 Nov-97
PowerPC 604e Workgroup Server 8550 200 50 512 1 Sep-96 Apr-97
PowerPC 604e Power Macintosh 8600 200 50 512 1 Feb-97 Aug-97
PowerPC 604e Workgroup Server 9650 233 50 512 1 Apr-97 Aug-97
PowerPC 603ev 20th Anniversary Macintosh 250 50 16/16 128 May-97 Mar-98
PowerPC 604ev Workgroup Server 9650 350 50 1024 1 Aug-97 Mar-98
PowerPC 750CX iMac 600 100 256 Sep-00 May-01
PowerPC 755 iBook 600 100 256 Oct-01 May-02
PowerPC 7447 eMac 1250 167 512 none 1 Apr-04 May-05
PowerPC 7447a eMac 1420 167 512 none 1 May-05 Jul-06
PowerPC 970 Power Mac G5 1.6–2.0 800–1000 512 1–2 1 Jun-03 Jun-04
PowerPC 970FX iMac G5 1.6–2.1 533–700 512 1 1 Aug-04 Jan-06
PowerPC 970FX Power Mac G5 1.8–2.7 900–1350 512 1–2 1 Jun-04 Nov-05
PowerPC 7455 Macintosh Server G4 1000–1250 133–167 256 1–2 1–2 Aug-02 Jan-03
PowerPC 7455 Xserve 1000–1333 133 256 2 1–2 May-02 Jan-04
PowerPC 7447 PowerBook G4 1000–1333 133–167 512 none 1 Sep-03 Apr-04
PowerPC 7447a iBook G4 1000–1420 133–142 512 none 1 Apr-04 May-06
PowerPC 603e PowerBook 5300c/ce/cs 100–117 33.3 16/16 none Aug-95 Aug-96
PowerPC 601 Power Macintosh 8200 100–120 40 16/16 256 Apr-96 Jul-96
PowerPC 603e Power Macintosh 5300 LC 100–120 40 16/16 256 Aug-95 Apr-96
PowerPC 603e Power Macintosh 5260 LC 100–120 40 16/16 256 Apr-96 Mar-97
PowerPC 603e Performa 5300CD (DE) 100–121 41 16/17 257 Aug-95 Apr-96
PowerPC 603e Performa 5260CD 100–121 41 16/17 257 Apr-96 Mar-97
PowerPC 603e Performa 5320CD 100–122 42 16/18 258 Aug-95 Apr-96
PowerPC 603e Performa 5270CD 100–122 42 16/18 258 Apr-96 Mar-97
PowerPC 603e Performa 5280CD 100–123 43 16/19 259 Apr-96 Mar-97
PowerPC 603e PowerBook 1400c/cs 117–133 33.3 16/16 none Nov-96 May-98
PowerPC 604 Power Macintosh 7600 120–132 40–44 256 1 Apr-96 Aug-96
PowerPC 604 Power Macintosh 8500 120–150 40–50 256 1 May-95 Aug-96
PowerPC 604 Power Macintosh 9500 120–150 40–50 512 1 May-95 Aug-96
PowerPC 603ev Power Macintosh 5400 LC 120–200 40 16/16 256 Apr-96 early 1998
PowerPC 603ev Performa 5400CD 120–201 41 16/17 257 May-96 early 1999
PowerPC 603ev Performa 5410CD 120–202 42 16/18 258 Jun-96 early 2000
PowerPC 603ev Performa 5420CD 120–203 43 16/19 259 Jul-96 early 2001
PowerPC 603ev Performa 5430CD 120–204 44 16/20 260 Aug-96 early 2002
PowerPC 603ev Performa 5440CD 120–205 45 16/21 261 Sep-96 early 2003
PowerPC 7447a Mac mini 1250–1500 167 512 none 1 Jan-05 Feb-06
PowerPC 7447a PowerBook G4 1333–1667 167 512 none 1 Apr-04 Apr-06
PowerPC 603e Power Macintosh 4400 150–200 40 16/16 256 Nov-96 Feb-98
PowerPC 604e Network Server 700[9] 150–200 50 1024 1 Sep-96 Apr-97
PowerPC 603e Performa 4400 150–201 41 16/17 257 Nov-96 Feb-98
PowerPC 604e Power Macintosh 7300 166–200 45–50 256 1 Feb-97 Nov-97
PowerPC 603ev Power Macintosh 6400 180–200 40 16/16 256 Aug-96 Aug-97
PowerPC 604e Power Macintosh 9500 180–200 45–50 512 1–2 Aug-96 Feb-97
PowerPC 603ev Performa 6400 180–201 41 16/17 257 Aug-96 Aug-97
PowerPC 603ev PowerBook 3400 180–240 40 16/16 256 Feb-97 Nov-97
PowerPC 603ev PowerBook 2400 180–240 40 16/16 256 May-97 May-98
PowerPC 970 Xserve G5 2.0–2.3 1000–1150 512 1–2 1 Jan-04 Aug-05
PowerPC 970MP Power Mac G5 2.0–2.5 1000–1250 2×1024 1–2 2 Nov-05 Aug-06
PowerPC 604e Power Macintosh 9600 200–233 50 512 1–2 Feb-97 Aug-97
MC68040 Workgroup Server 60 20–25 20–25 8 Jul-93 Oct-94
PowerPC 603ev Power Macintosh 5500 225–275 50 16/16 256 Feb-97 early 1998
PowerPC 603ev Power Macintosh 6500 225–300 50 16/16 256 Feb-97 Mar-98
PowerPC 750 Power Macintosh G3 (Beige) 233–333 66 512-1024 Nov-97 Jan-99
PowerPC 750 Macintosh Server G3 (Beige) 233–333 66 1024 Mar-98 Dec-98
PowerPC 750 PowerBook G3 233–500 50–100 512–1024 Nov-97 Jan-01
PowerPC 750 iMac 233–500 66–100 512 Aug-98 Jul-01
PowerPC 604ev Power Macintosh 8600 250–300 50 1024 1 Aug-97 Feb-98
PowerPC 604ev Power Macintosh 9600 300–350 50 1024 1 Aug-97 Mar-98
PowerPC 750 iBook 300–366 66 512 Sep-99 Sep-00
PowerPC 750 Power Macintosh G3 (Blue & White) 300–450 100 1024 Jan-99 Sep-99
PowerPC 750 Macintosh Server G3 (Blue & White) 350–450 100 1024 Jan-99 Aug-99
PowerPC 7400 Power Mac G4 350–500 100 512–1024 none 1–2 Sep-99 Jan-01
PowerPC 7400 Macintosh Server G4 350–500 100 512–1024 none 1–2 Jan-00 Jan-01
PowerPC 750CXe iBook 366–500 66–100 256–512 Sep-00 May-02
PowerPC 7410 PowerBook G4 400–500 100 1024 none 1 Jan-01 Oct-01
PowerPC 7400 Power Mac G4 Cube 450–500 100 512–1024 none 1 Aug-00 Apr-01
PowerPC 7410 Power Mac G4 Cube[10] 450–500 100 1024 none 1 Apr-01 Jul-01
PowerPC 7410 Power Mac G4 466–533 133 1024 none 1–2 Jan-01 Jul-01
PowerPC 7410 Macintosh Server G4 466–533 133 1024 none 1–2 Jan-01 Jul-01
PowerPC 750CXe iMac 500–700 100 256 Jul-01 Mar-03
PowerPC 7450 PowerBook G4 550–667 100–133 256 none 1 Oct-01 Jul-02
PowerPC 750FX iBook 600–900 100 512 May-02 Oct-03
PowerPC 601 Power Macintosh 6100 60–66 30.0–33.3 16/16 none Mar-94
PowerPC 601 Workgroup Server 6150 60–66 30.0–33.3 16/16 none Apr-94 Apr-96
PowerPC 601 Performa 6110CD 60–67 30.0–33.4 16/17 none Apr-94
PowerPC 601 Performa 6112CD 60–68 30.0–33.5 16/18 none May-94
PowerPC 601 Performa 6115CD 60–69 30.0–33.6 16/19 none Jun-94
PowerPC 601 Performa 6116CD 60–70 30.0–33.7 16/20 none Jul-94
PowerPC 601 Performa 6117CD 60–71 30.0–33.8 16/21 none Aug-94
PowerPC 601 Performa 6118CD 60–72 30.0–33.9 16/22 none Sep-94
PowerPC 7455 PowerBook G4 667–1000 133–167 256 0–1 1 Apr-02 Sep-03
PowerPC 7450 Power Mac G4 667–867 133 256–1024 0–2 1–2 Jan-01 Jan-02
PowerPC 601 Power Macintosh 7100 66–80 33.3–40.0 16/16 none Mar-94 Jan-96
PowerPC 7450 iMac G4 700–800 100 256 none 1 Jan-02 Jan-03
PowerPC 7450 eMac 700–800 100 256 none 1 Apr-02 May-03
PowerPC 7450 Macintosh Server G4 733–1000 133 256 0–2 1–2 Sep-01 Aug-02
PowerPC 601 Power Macintosh 7200 75–120 37.5–40.0 16/16 none May-95 Feb-97
PowerPC 603 Power Macintosh 6200 75–120 37.5–40.0 8-Aug 256 May-95 Jul-97
PowerPC 603 Performa 6200CD 75–121 37.5–40.1 9-Aug 257 May-95 Jul-97
PowerPC 603 Performa 6205CD 75–122 37.5–40.2 10-Aug 258 May-95 Jul-97
PowerPC 603 Performa 6210CD 75–123 37.5–40.3 11-Aug 259 May-95 Jul-97
PowerPC 603 Performa 6214CD 75–124 37.5–40.4 12-Aug 260 May-95 Jul-97
PowerPC 603 Performa 6216CD 75–125 37.5–40.5 13-Aug 261 May-95 Jul-97
PowerPC 603 Performa 6218CD 75–126 37.5–40.6 14-Aug 262 May-95 Jul-97
PowerPC 603 Performa 6220CD 75–127 37.5–40.7 15-Aug 263 May-95 Jul-97
PowerPC 603 Performa 6230CD 75–128 37.5–40.8 16-Aug 264 May-95 Jul-97
PowerPC 7455 eMac 800–1000 133 256 none 1 May-03 Apr-04
PowerPC 7455 iBook G4 800–1000 133 256 none 1 Oct-03 Apr-04
PowerPC 7455 iMac G4 800–1250 100–167 256 none 1 Feb-03 Jul-04
PowerPC 7455 Power Mac G4 800–1420 133–167 256 1–4 1–2 Jan-02 Jun-04
PowerPC 601 Power Macintosh 8100 80–110 33.3–40.0 16/16 256 Mar-94 Jul-95
PowerPC 601 Workgroup Server 8150 80–110 36.7–40.0 16/16 256 Apr-94 Apr-96
PowerPC 601 Workgroup Server 9150 80–120 40 16/16 512–1024 Apr-94 May-96

How to Mount a USB Drive on Raspberry Pi (Jessie)

I followed this guide.

Create the mount point:

sudo mkdir usbdrive

Make pi the owner of the mounted drive and make its permissions read, write and execute for it

sudo chown -R pi:pi /media/usbdrive
sudo chmod -R 775 /media/usbdrive

Set all future permissions for the mount point to pi user and group (explanation can be found here)

sudo setfacl -Rdm g:pi:rwx /media/usbdrive
sudo setfacl -Rm g:pi:rwx /media/usbdrive

sudo blkid

You will see something like this. Again it is the sda1 line we are interested in. Note the TYPE=”exfat” at the end, you will need this for the fstab file. It is easiest to copy it now and paste it after running nano in the next step.
Look for the sda1 line.

For all drive types mount the usb with this command, -o insures pi is the owner which should avoid permission issues

sudo mount -t uid=pi,gid=pi /dev/sda1 /media/usbdrive

sudo ls -l /dev/disk/by-uuid/

This will display the UUID – the very unique ID for the drive itself, so you can be explicit in which USB drive you’re mounting. Use this UUID to add a line to /etc/fstab

sudo nano /etc/fstab

Add a line like:

UUID=5027202e-d084-4569-8bea-d425d71d8de6 /media/usbdrive ext4 nofail,defaults 0 0



Password Manager

I spent many hours debating the best way to manage passwords. I almost went with LastPass or the like, but I’m not happy about the prospect of their systems being hacked. Also, I was able to configure a custom solution that mimics their system pretty well, sans the not so secure in-browser plugins.

There are a few moving parts to this system. First, there’s the JavaScript that encrypts and decrypts the password strings. This JS not only decrypts, but it also formats the data into a an easily readable form.

Once encrypted, a PHP file saves the strings to text files on the web server. A daily cron job checks for changes to these text files, and if there are updates, it archives the text files to a RAR with a date stamp. The RAR is backed up to a Windows desktop using a Windows batch file – this is probably overkill, since I also email the encrypted text to myself.

If there are updates to the text files, it also fetches the encrypted content from all the files, and puts it into an email as plain text and sends it to me. The encrypted text can be input to an HTML file on a public web server with the same JS as the PHP file on the internal server, so I decrypt from a remote location.

This setup took many hours. The JS encryption took about 20hrs; the backup system took another 20hrs; and the file check and email another 20hrs. In days, it took about a month and a half, since I can work on this only a few hours at a time – at best.

Motion Detection on Raspberry Pi

One of the most common projects for the Raspberry Pi is a surveillance camera with motion detection. It should be no surprise, then, that there are several application options to choose from. Here are some that I found:

  • Kerberos Motion
  • PiCam
  • Motion – motion packages doesn’t yet work with the Raspberry Pi camera. You’ll instead have to use a special binary, called “motion-mmal”, specially created for the Raspberry Pi by a community member.
  • Motion-mmal
  • MotionEye (or MotionEyeOs)
  • ZoneMinder
  • PiKrellCam

Of these, I found the most positive remarks about PiKrellCam. Motion is probably the most popular, but it’s old, from what I’ve read, and it’s not as efficient as PiKrellCam – it tends to overheat the CPU and drop frames. It does work with USB webcams though, but since I have a Pi camera module, I don’t care. I read also that PiKrellCam takes advantage of some of the features of the Pi camera.

On the down side, PiKrellCam isn’t exactly for newbies. The download, install, and configuration I found to be more complicated than it needs to be.

You can also turn off the camera red LED by adding this line to /boot/config.txt:
Make everything wired. The broadcom wifi chip is too unstable for this. Also if you can, run the master motioneye os on something a bit beefier than an Rpi.
The biggest cause for false positives I found was noise in dark rooms. when an area is well lit with high resolution – I hardly had any false alerts

From a post: “I like MotionEye. Just tried out Kerberos.io after seeing this post, and the interface looks really nice, but each instance can only run 1 camera. One installation of MotionEye can view multiple cameras and has more options for connecting to and using them.
Zoneminder is too intensive for the pi I found. I swapped to motioneyeos and never looked back.”

I went with the PiKrellCam.


How to Upload AVI or MP4 Movie Files from Raspberry Pi to Google Drive

This was way harder than it looked. I used the uploader.py script written by this guy at Jeremy’s Blog. What I like about it is its  simplicity – it uses a single Python script – you don’t have to download a ton of files that you don’t know what they do. You can look at the script and see what it’s doing. The hardest part was getting the Google Authentication, because the instructions on Jeremy’s Blog are WRONG WRONG WRONG. So here’s how to do it, as of today.

Note that this script is designed to be used with the “Motion” security/surveillance module, which I don’t use. I intend to use it with PiKrellCam – hopefully I can get the two working together.

Set Up Google API Authentication

You can use the first part (Step 1) of this guide by Google, or follow along. Since it sounds like Google changes their authentication process every so often, these instructions might go out of date. What you really want is to get Google to set up and generate an authentication JSON file for you to download.

  1. Log in to the Google account that you’re going to use as a repository.
  2. Go to the Google API page.
  3. At the top of the page, click the dropdown and select Create Project. Name the project: Uploader.
  4. Click Dashboard (left menu), if you’re not already on it, and click Enable an API at the top of the page. It will enable the API and automatically send you to the Library tab.
  5. Under Google Apps APIs, click Drive API. The Drive API details displays.
  6. Click the Create credentials button.
  7. Click Client ID, and then click skip this.
  8. Click Configure consent screen.
  9. In the Product name shown to users, enter Uploader. Leave all other fields blank.
  10. Click Save. The Create client Id page displays.
  11. Select/Enter the following:
  12. Application type: Other
  13. Name: Uploader
  14. Click Create. The OAuth client popup displays your authentication details – you don’t need to copy these, but you can if you want.
  15. Close the popup. You will see your API authorization in a list. On the right side of the Uploader line, click the Download icon. It displays a download file dialog box – change the file name to client_secrets.json and put it somewhere like /home/pi/motion-uploader.

OK – that was hard enough. Jeremy’s instructions helped me hobble along, but they were so far off that I blindly felt my way through the process. I hope I captured all the steps, but I might not have. The rest of Jeremy’s instructions are pretty close.

Download Script and Python Client

Go to your home directory.

$ cd /home/pi/

Get the uploader.py from github.

$ git clone https://github.com/jerbly/motion-uploader.git

Update/install Google Python API:

$ sudo pip install --upgrade google-api-python-client
$ cd motion-uploader

Make uploader.py executable:

$ chmod a+x uploader.py

Configure Script

If you used the git clone command you’ll find the example uploader.cfg file in the motion-uploader directory. Edit it.

Make sure the folder is set to where you put the client_secrets.json file and where the script has write credentials. I put mine in /home/pi/motion-uploader/.

Under [docs], set the name of the folder on your Google Drive where you want the videos to be saved and where you want photos to be saved. I created a folder in Google Drive called Motion to match this.

$ sudo nano  uploader.cfg

folder = /home/pi/motion-uploader/

# GMail account credentials
name = Joe Shmo
user = joshmo
password = dh4Kfufus0f654qmdk
sender = joshmo@gmail.com

# Recipient email address (could be same as from_addr)
recipient = joshmo@gmail.com

# Subject line for email
subject = Motion detected

# First line of email message
message = Video uploaded

# Folder (or collection) in Docs where you want the videos to go
folder = motion
snapshot-folder = public

# Delete the local video file after the upload
delete-after-upload = true

# Send an email after the upload
send-email = true

Initial Authentication

You need to be logged in to your Google account for this. So open a browser and log in to the target account. Keep that browser open.

The initial authentication script will look like it failed. Get a test.AVI file from somewhere, or just touch test.avi to create a fake one. I used a renamed JPG I had laying around. Note that it will fail if it isn’t an AVI.

From the command line run the script from the /home/pi/motion-uploader/ directory.

$ cd /home/pi/motion-uploader/
$ ./uploader.py /home/pi/motion-uploader/uploader.cfg /home/pi/test.avi

A bloody error message displays some text about copying a URL. DO THAT. It also says: enter the Auth Code or something like that. Copy the URL in the error message, and paste it into the browser where you are already logged in to Google as the correct user. A web page displays two lines of text – the second line is the authentication code. Copy that code, go back to your terminal, and paste the auth code – press Enter. It will be happy.

This will authenticate you and create a credentials file which will be used for future logins (uploader_credentials.txt).

For me, it failed the first time, because I tried uploading a file that was NOT an AVI. But when I ran it the second time, with an AVI, it worked – and it didn’t ask for credentials.

Does It Upload MP4s?

But YES! The hippopotamus!

./uploader.py /home/pi/motion-uploader/uploader.cfg _

Well, that’s a relief. I was expecting to have to modify the Python to allow it. Fortunately, video files all have some level of similarity – it can use the AVI MIME type for MP4s.

Next Steps

Add the upload script to the PiKrellCam script to upload after a movie file is created. Or maybe, since PKC sends me a photo of the relevant video, I don’t want it to upload the video. I would rather have a manual step there.

  1. Motion detected.
  2. Movie captured, photo emailed to me.
  3. I view the photo – if it’s a bird, I don’t do anything. If it’s a bad guy, I send a command to upload the movie to Google Drive.

I’ve been considering a way to send commands to the Pi without opening up a port to my home network. I have an idea where I set a cron job on the Pi to monitor a text file on my web server (read txt every minute). The file is writeable by me and is empty by default. I can write a PHP script to add a command to the text file. When the Pi detects a command, it kicks off a process. For example, after I get a suspicious photo as an email attachment:

  1. Go to my PHP page.
  2. Enter upvid, which adds “upvid” to my text file (or maybe just the name of the file, like manual_2017-03-25_10.10.55_0).
  3. Pi reads that there’s a command in the text file, and logs that it read it (so it doesn’t execute it twice).
  4. Pi runs the uploader.py script and uploads the file to Google Drive.

I think it will work.

Copied from Jeremy’s Blog:

Motion comes with a feature to periodically take a snapshot regardless of whether motion has been detected. This is a nice feature if you want to have a web site with the latest view from your webcam. You can use Google Drive to host this image rather than installing a web server on your Pi and opening firewalls etc.

  1. Create a public folder in your Google Drive:
    • Create a new folder called ‘public’
    • Double click on it
    • Go to the sharing menu (person icon with + sign)
    • Click “Advanced” and then “Change…”
    • Set it to “On – Public on the Web”
  2. Configure your uploader.cfg so docs/snapshot-folder is set to this folder ‘public’.
  3. Configure motion.conf to take a snapshot every n seconds named lastsnap.jpg and upload it:
    • snapshot_interval 300
    • snapshot_filename lastsnap
    • on_picture_save /home/pi/motion-uploader/uploader.py /home/pi/uploader.cfg %f snap

To find the public URL that you can bookmark and embed in other pages run the command line with the ‘snapurl’ option:

./uploader.py /home/pi/uploader.cfg /home/pi/lastsnap.jpg snapurl


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.


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.





Motion Google Drive Uploader

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


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


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.


PiKrellCam at RaspberryPi Forum

PiKrellCam at GitHub

Reducing Power Consumption

This is a work in progress. There’s not much “easy” about PiKrellCam.

Pseudo code for a Python script to watch for external commands, then execute them.

while true
    pause for 5min
    go read the text file
    set setEmail = n
    if text file line says "emailme" and sentEmail != y
        send email
        set sentEmail = y
    if text file line says "delsent" and sentEmail == y
        set sentEmail = n
end while

Start PiKrellCam from command line:

$ cd pikrellcam
$ pikrellcam  motion_enable on &

Use ampersand to get back to the prompt.

Create a shell script to delay start.

$ sudo nano startCam.sh

sleep 3m
/home/pi/pikrellcam/pikrellcam motion_enable on



I installed PiKrellCam last night, and it didn’t exactly go smoothly. It would help if I read through the 1000+ posts on the Pi Forum, but I didn’t have the patience. Instead, I followed the directions from the PiKrellCam Git Page, which says:

$ cd /home/pi
$ git clone https://github.com/billw2/pikrellcam.git
$ cd pikrellcam
$ ./install-pikrellcam.sh

Note that this will only work if you’re logged in as user: pi. It seems that the installer is configured for only a very specific circumstance, so don’t expect to install it somewhere else or use a different user. This may no longer be the case, according to later forum posts, but if you want the simplest installation, use the pi account.

At first, I wanted to download the file to my ~/Downloads directory, so that’s what I did. The problem is that when I installed it, it installed to that same directory, which is probably why it failed.

During the install, I specified a unique port and created a password. The install seemed to go well, but when I accessed the web page, it displayed: “No preview jpeg”. I tried starting the service using the Start button, but it didn’t do anything.

So then I followed the install directions exactly (logged in as pi and at /home/pi/), and it still didn’t work right at first. At the web page, it refreshed about three times per second and still did nothing – just jumped and jittered. I tried clicking the Start button – actually I started clicking all the buttons, but it was unresponsive. Then after a few minutes, I got an error page saying that my camera was being used by another application (no it wasn’t). (In retrospect, I think I probably clicked the Start button and didn’t wait long enough for it to engage.)

I rebooted and tried the web page again. This time, it displayed the preview and worked! Yay? I don’t like it when things break then just work.

To provide context, I was doing all this while being constantly interrupted by family. I suggest doing this in a quiet, secluded area when you have plenty of time to troubleshoot.

Questions I had/still have:

  • Where are the web pages stored?
    • ~/pikrellcam/www/
  • Does the install also install NGINX? or was it already there?
  • Is PHP installed already? I need to check.
  • How do I uninstall it?
  • How do I update it? – There’s an Update button on the web page.
  • How do you know what applications are installed, like mpack, ssmtp, php?


The application pages are written in PHP and JQuery.

I’m playing with it now. Let me say that the Motion Regions function is extremely useful. To view the saved motion regions, click List. By default, you will see only “default” that’s all there is.

To toggle the motion regions off, click Preset.

The documentation says to edit the ~/pikrellcam/pikrellcam.config file to add your email address, but there’s more to it than that. You need to first install SSMTP.

Change the Default File Save Location

Because PiKrellCam is going to write to a drive a lot, you will want to set up an alternate location for it. You want your OS micro SD card to last as long as possible, so you want to read and write to it as infrequently as possible.


Go get ourself a good-sized USB drive. I used a 16GB Sandisk.

From your Pi home directory:

$ cd .pikrellcam
$ sudo nano pikrellcam.conf

Search for the media_dir line and change it to a location on your USB drive.

media_dir /media/pi/SANDISK-16/PKC

When PiKrellCam first writes to that location, it creates a file structure:


Don’t forget to add an entry for your new USB drive in the Samba config file.

$ sudo nano /etc/samba/smb.conf
$ sudo /etc/init.d/samba restart


Notes from the Raspberry Pi Forum

To view errors:

Changing saturation on the NoIR, edit at-commands.conf and add in:
daily sunrise-5 “@saturation 99”
daily sunset+5 “@saturation -99”

I’ve only been able to get improvement by setting the video fps low at night (around 6 fps)

Those that want to change frame fps at night can put lines like this in ~/.pikrellcam/at-commands.conf:
# sunrise/sunset or dawn/dusk (times are reported in the log file)
# Motion is detected and preview updated at video_fps/mjpeg_divider so
# mjpeg_divider should be changed when video_fps is changed. Also change
# video_mp4_box to track video_fps or mp4 will be slow or fast motion.
# Adjust camera parameters in the evening: sunset{+-offset}
daily sunset “@exposure_mode night”
daily sunset+10 “@video_fps 4”
daily sunset+10 “@video_mp4box_fps 4”
daily sunset+10 “@mjpeg_divider 1”

# Adjust camera parameters in the morning sunrise{+-offset}
daily sunrise-10 “@video_fps 24”
daily sunrise-10 “@video_mp4box_fps 24”
daily sunrise-10 “@mjpeg_divider 4”
daily sunrise “@exposure_mode auto”

I do have it succesfully emailing me via the preview save script????

This doesn’t work – I tried to edit the pikrellcam.conf file and set media_dir to
media_dir /mnt/cam
A: can you check the symlink under /home/pi/pikrellcam/www – you should find media -> /mnt/cam
A: check to make sure you have write permissions.

After a reboot I have no preview of the camera in the webinterface
A: Go to the web UI System and push the Start button

To update:
cd ~/pikrellcam
git pull origin

Or just use the Update button on the web page.

If you ever run git and get an error like:
$ git pull origin
Updating e78deba..a6929d1
error: Your local changes to the following files would be overwritten by merge:
Please, commit your changes or stash them before you can merge.
Just delete www/index.php and www/media.php and run again: git pull origin.
Any change to a file made in ~/.pikrellcam will not be overwritten by an update.
Likewise, any edit or adding of a file in pikrellcam/scripts will not be overwritten.
Worst case would be you have to clean up and start over with a git clone. Every config file in ~/.pikrellcam/ will be safe and you can leave them alone if you have to do a new git clone.

How to kill
killall -9 pikrellcam

Email uses “mpack” an email application. To get the emailing you have to edit preview-save in the scripts directory and not the one in the scripts-dist directory. In the preview-save script uncomment the two lines:
mpack -s pikrellcam@$HOSTNAME $PREVIEW_JPEG $MY_EMAIL
echo “mpack -s pikrellcam@$HOSTNAME $PREVIEW_JPEG $MY_EMAIL” >> $LOG_FILE

and make sure the MY_EMAIL line has your correct email address. Finally, in pikrellcam.conf, this line must be set and not commented out:
on_motion_preview_save $C/preview-save $F $m $P $G

In case you want to save just the still image instead of the video to a remote site, you can do something like this:


# construct still filename from video filename
F=$(basename $VIDEO_FILE .mp4).jpg
curl -T /home/pi/pikrellcam/media/stills/$F ftp://ftp.mysite.com/pics/$F –user USERNAME:PASSWORD

Parameters for motion_vectors_dimming and motion_area_min_side
The dimming is the percent to dim the jpeg stream when the show of motion vectors is enabled. If you want more contrast between the image and drawn motion vector squares, set the dimming lower. Set it higher if you want to see the image better, but less contrast is available for the vectors.

If motion vector count limit is set low, the size of the detected object can be very small and the blow up of that detected area for a thumb can be grainy or even missed since there can be some skew. Setting a minimum to the motion area side compensates for that. The units of the minimum is pixels.

Neither of these affect actual motion detection.

Web page password protection is now changed to use htpasswd.

Labels: Turn ON: Setup->Motion->Settings->Preview_Clean

Now there is a git “Upgrade” button on the web page for one click upgrades.

To directly email the still, you can use mpack like so ($s is last saved still):
on_still_capture mpack -s pikrellcam-still@$H $s user@gmail.com

The media_dir is configured in ~/.pikrellcam/pikrellcam.conf and you can have an automatic mount enabled in ~/pikrellcam/scripts/startup
For my setups, I leave the .pikrellcam.conf media_dir at its default of “media” and I edit the startup
script so that MOUNT_DISK=sda1
I have a USB stick plugged in which appears as /dev/sda so the startup script mounts /dev/sda1 on ~/pikrellcam/media and so all my video files are stored on the USB stick.

# crontab file
0 0 * * * find /home/pi/pikrellcam/media/archive -mtime +7 -exec rm {} \;

Recommended for low light (added these lines at at-commands.conf):
daily dusk “@brightness 50”
daily dusk “@video_fps 4”
daily dusk “@mjpeg_divider 1”
daily dusk “@mp4_box_fps 4”
daily dusk “@exposure_mode night”
daily sunrise “@brightness 50”
daily sunrise “@video_fps 24”
daily sunrise “@mjpeg_divider 6”
daily sunrise “@exposure_mode auto”

Streaming: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=115583&start=400

On and off at terminal ?:
echo ‘motion_enable on’ >> /home/pi/pikrellcam/www/FIFO
echo ‘motion_enable off’ >> /home/pi/pikrellcam/www/FIFO

Some thoughts about security:
1. the .htpasswd shouldn’t reside inside the www root
auth_basic_user_file /home/pi/pikrellcam/www/.htpasswd;

2. the access to the .htpasswd should be denied by nginx configuration:
# deny access to .ht* files, if Apache’s document root
# concurs with nginx’s one
location ~ /\.ht {
deny all;


echo motion limits 12 12 > ~/pikrellcam/www/FIFO
echo motion burst 500 4 > ~/pikrellcam/www/FIFO

#If you want to configure a custom motions regions also:
#echo motion load_regions windy > ~/pikrellcam/www/FIFO

And when the weather gets back to normal, run something like this:

echo motion limits 5 4 > ~/pikrellcam/www/FIFO
echo motion burst 200 3 > ~/pikrellcam/www/FIFO
#echo motion load_regions default > ~/pikrellcam/www/FIFO

I have a python program which monitors a sensor and then calls a shell script which does:
echo “still” > /home/pi/pikrellcam/www/FIFO
echo “record on 4 4” > /home/pi/pikrellcam/www/FIFO

so I get a still image as well as a video showing before and after the trigger. There is about a half-second gap in the video right at the trigger, as the camera changes modes for the full-res still frame, but I think that’s a limitation of the GPU firmware and nothing to do with PiKrellCam.

jbeale’s complete pikrellcam.conf file:

Archive script
and a later version:

Mount windows drive

How to change media location

I’m not sure about mpack usage of port 25, but /etc/ssmtp/ssmtp.conf needs to be setup to send to a mailhub that works with mpack.

If the mounting is done by pikrellcam by editing the ~/pikrellcam/scripts/startup script or by however you are doing the mounting, a umask should be specified for the mount.

For example, if you want pikrellcam to do the mounting of a FAT32 filesystem on /dev/sda1, uncomment the MOUNT_DISK=sda1 line in the startup script and change this line:


sudo mount -t vfat $DISK_DEVICE $MEDIA_DIR -o rw,user,umask=0002

Otherwise, however you are mounting the nas, you need the umask to be set.

Check if pikrellcam is running:
ps -e | grep pikrellcam

Check nginx:
sudo service nginx status

nginx.conf is now in /etc/nginx/

There are many ways to do this. What I do is have the Pi save files on the SD card short-term, then at some schedule (hourly, daily…) I use ‘rsync’ to copy the local Pi files to the remote server (could be another Pi or any other machine). Then I have separate ‘cron’ jobs on each machine that delete the oldest files to maintain a certain % disk usage or certain number of days. This is standard Unix/Linux file stuff, nothing specific to RPi. For example usage of ‘rsync’ try http://www.thegeekstuff.com/2010/09/rsy … d-examples or some other pages google will show.

The only trick here is that you need to set up the Pi to be able to ssh into the remote server without using a password, but that is easy to set up as explained here: http://www.thegeekstuff.com/2008/11/3-s … h-copy-id/

on_motion_begin $C/motion_send_alarm

What do you have configured for media_dir and archive_dir in pikrellcam.conf?
It looks like you should have:
media_dir /home/pi/shared/mount/pikrellcam/media
archive_dir /home/pi/shared/mount/pikrellcam/archive

The pikrellcam.conf values force the www directory links and manually changing them will not work. Pikrellcam tries to mount only if the MOUNT_DISK line in scripts/startup is uncommented.

Test www-data read/write access. Log in as root, then:
runuser -u www-data touch /home/pi/NAS/pikrellcam/media/testfile

add your NFS shares as
192.168.nfs.nfs:/shared /shared nfs defaults,noatime,x-systemd.automount 0 0

When I tried command line mpack it failed because ssmtp was not installed on this Pi.
A: ssmtp is just one way of configuring email sending in the console. There are other possible software like exim4 or postfix but i think ssmtp is a very easy way.

Make sure you are using an adequate power supply and a good USB cable

If you are running headless and don’t need the HDMI circuitry powered up, you can reallocate about 30mA to other resources by adding this line to your /etc/rc.local file:
/usr/bin/tvservice -o

You can also gain another 10mA by disabling the PIs power and act LEDs by adding the following to your /boot/config.txt file
# Disable the ACT LED.

# Disable the PWR LED.

Also disable the sound in your /boot/config.txt file since you aren’t really using it and it just uses more power and memory that the pi can use elsewhere.

After running several PiKrellCam devices for more than a year (starting when it was released in July 2015) I have come to the conclusion that flash memory (both microSD card, and USB stick) will likely become unreliable and fail after about a year of regular use recording motion video clips.

I moved /tmp and /var/log to a ramdisk because these are the most frequent written directories for the native linux system.

How to set these to RAM disk: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=115583&start=925

PiKrellCam will randomly spring into life for a while then stop
A: Could be inadequate power source.