Raspberry Pi Security Camera(s)

webcamwebcam2

I suspected that Max was sitting on the nice white chair in the living room while we were away during the daytime. So I set up a Raspberry Pi webcam system that was accessible via any browser anywhere.

Here’s how to do it:

  1. Get a Raspberry Pi SD image of Raspbian
  2. Boot the Pi
  3. Configure the internationalization options so your keyboard outputs the correct characters
  4. sudo nano /etc/hosts, change your host name to what you want it to be (i.e. “cam-livingroom”)
    127.0.1.1    cam-livingroom
  5. sudo nano /etc/hostname, change your host name to what you want it to be (i.e. “cam-livingroom”)
    cam-livingroom
  6. Set up the wifi SSID & password. Run sudo nano /etc/network/interfaces The interfaces file should look like this in the end:
    auto lo

    iface lo inet loopback
    iface eth0 inet dhcp

    allow-hotplug wlan0
    auto wlan0

    iface wlan0 inet dhcp
        wpa-ssid "ssid"
        wpa-psk "password"

  7. Shut down the Pi, insert the wifi dongle, reboot.
  8. run sudo apt-get update AND sudo apt-get upgrade
  9. sudo apt-get install motion (webcam capture software)
    • during this install there may be some errors. If there are, run sudo apt-get upgrade and/or sudo apt-get update (I can’t remember which one) and then run sudo apt-get install motion again.
  10. Configure camera capture settings: sudo nano /etc/motion/motion.conf
    daemon on
    framerate 2
    minimum_frame_time 5    ## number of seconds between shots
    output_all on    ## output images even when there is no motion
    text_double on    ## enlarges the timestamp overlay
    webcam_port 8081    ## for each webcam, this needs to be a unique number
    webcam_localhost off    ## allows access from other IP addresses

  11. sudo nano /etc/default/motion
    start_motion_daemon = yes
  12. Plug in the webcam (you may need to reboot for the webcam to work)
  13. sudo service motion start
  14. Open Firefox (this is the only browser in which this currently works) and go to 192.168.1.XXX:8081. You should see an image that automatically updates every 5 seconds.
  15. Assign a static IP to the Raspberry Pi from your router
  16. Port-forward port 8081 to the Pi’s IP address on your router
  17. Create an iframe page to host all of your webcams:
    <html>
      <head>
        <style>
          div.cam {
            height: 256px;
            width: 336px;
            border: 4px solid gray;
            float: left;
          }
          
          iframe.cam {
            height: 256px;
            width: 336px;
          }        
        </style>
      </head>
      <body style="background-color: rgb(51,51,51);">
        <div style="margin: 0 auto; padding: 0; width: 1032px;">
          <h1>
            Hi this is my ifram test
          </h1>
          <div class="cam">
            <iframe src="http://spangoria.com:8081" class="cam"></iframe>
          </div>
          <div class="cam">
            <iframe src="http://spangoria.com:8082" class="cam"></iframe>
          </div>
          <div class="cam">
            <iframe src="http://spangoria.com:8083" class="cam"></iframe>
          </div>
          <div class="cam">
            <iframe src="http://spangoria.com:8084" class="cam"></iframe>
          </div>
          <div class="cam">
            <iframe src="http://spangoria.com:8085" class="cam"></iframe>
          </div>
          <div class="cam">
            <iframe src="http://spangoria.com:8086" class="cam"></iframe>
          </div>
          
        </div>
      </body>
    </html>

555 LED Fader – More Complicated Than It Seems

[STUB]

[Insert Fritzing diagram here]
{insert URL reference here]

Resizing RetroPie (Raspbian) SD Card Images in Windows

I bought a MicroCenter brand SD card, and despite it being 16GB, just like the SanDisk 16 GB SD card, the cards had technically different capacities, so I was unable to write the image to the MicroCenter card using Win32DiskImager. I used a program [INSERT NAME OF ACTUAL PROGRAM HERE] to shrink the Ext4 partition on the original SD card by 500 MB (overkill, to be sure to accommodate even the smallest of 16 GB cards), and then another program to extract the SD card’s contents to an image file, and then use that same program [INSERT NAME OF ACTUAL PROGRAM HERE] to write the image file to the new MicroCenter SD card. This whole process was super annoying, tedious and time-consuming, but now that I have a minimzed 16 GB images, I should be able to write that image to any 16 GB SD card now. I could also use the same process to shrink the Ext4 partiton by ~8 GB to fit the image onto an 8 GB card. (I think the smallest card usable with RetroPie is 4 GB.)

Custom Decal Skins for Raspberry Pi Case (RetroPie Project)

[STUB]