Sasquatchcam

  • Post by Adam Driscoll
  • Nov 17, 2020
post-thumb

Sasquatchcam is website to track the how well the large, furry beast is fairing in the current Idaho winter. He lives in Hailey, ID. We had a large, early snow storm that dropped about a foot of snow around the fella' and that prompted me to create this website.

Build

This is what Sasquatchcam is made out of.

Hardware

Software

  • fswebcam
  • PowerShell
  • crontab

Setup

Before moving the Raspberry Pi outside, I configured the hardware and software inside. I flashed the memory card with Raspberry Pi OS using the Raspberry Pi Imager.

I then setup SSH by creating an SSH file on the card because the Pi was headless. I plugged the card into the Pi, connected a CAT5 cable to my router and booted it up. From there, I used PuTTY to connect to the Pi. The default host name is raspberrypi, the user name is pi and the password is raspberry.

Once connected, I installed and setup fswebcam. I followed this guide.

The commands I executed were as follows.

sudo apt install fswebcam
sudo usermod -a -G video pi

I was actually able to take pictures without any hassle using this command. It automatically found my camera and wrote the image to the file system.

fswebcam image.jpeg

I’m a PowerShell nerd so my next step was to install PowerShell 7 on my Pi. This script was taken from the Microsoft Documentation.

###################################
# Prerequisites

# Update package lists
sudo apt-get update

# Install libunwind8 and libssl1.0
# Regex is used to ensure that we do not install libssl1.0-dev, as it is a variant that is not required
sudo apt-get install '^libssl1.0.[0-9]$' libunwind8 -y

###################################
# Download and extract PowerShell

# Grab the latest tar.gz
wget https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-linux-arm32.tar.gz

# Make folder to put powershell
mkdir ~/powershell

# Unpack the tar.gz file
tar -xvf ./powershell-7.1.0-linux-arm32.tar.gz -C ~/powershell

# Start PowerShell
~/powershell/pwsh

Next, I created a GitHub repository to store the images I was to upload. My plan was to take a picture every hour and upload it to the GitHub repo and publish it with GitHub Pages. I followed this guide from GitHub to create a SSH key on my Pi.

Here are the commands I ran.

ssh-keygen -t ed25519 -C "your_email@example.com"
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa

From there, I added the public key to my GitHub account.

I cloned the repo using git. Next, I used nano to create a PowerShell script to take an image and upload the file to GitHub. I probably have done just done this in bash.

Set-Location $PSScriptRoot
fswebcam -r 1280x720 ./squatch.jpg
git pull
git add .
git commit -m "New image"
git push

Finally, I setup a crontab schedule to run my PowerShell script. You can open the crontab editor with the following command.

sudo crontab -e

My schedule looks like this.

30 * * * * pwsh /home/pi/squatch/webcam.ps1 2>&1

Boom! Sasquatch has his mug taken every hour.

Installation

I’ve mounted the camera on the overhead beam of our porch and placed the Raspberry Pi on top of it. The camera is just hooked up via USB as well as the WiFi adapter.

Now Sasquatchcam is rocking and rolling.