Skip to content
/ gocam Public

Open source security camera project for cheap security surveillance with data resiliency and accessibility in mind.

License

Notifications You must be signed in to change notification settings

zcking/gocam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoCam

GoCam is a free, open-source security camera software solution. The intent of GoCam is to provide a more accessible, resilient solution to video surveillance.

I run GoCam on a Raspberry Pi 3 Model B with an attached NO-IR Camera module. For a full shopping list of parts, see below (prices subject to change):

Total Cost: $79.00 (excluding taxes)

Note: I chose to use a No-IR camera simply because they are cheap and operate in both day and night (although daytime colors tend to be a bit washed out), and they do not require any additional filters or special lenses.


Running GoCam

Once you have a binary of GoCam to run, you can start it like any other program, by simply executing ./gocam.

Note: GoCam expects a YAML configuration file at ./config/default.yaml by default. You may refer to the configuration file in this repository for an example.


Building

Currently, this project is an infant and I haven't set up any Docker images, Vagrant files, or anything of the sort. However, if you have golang installed, compiling is very simple: go build.

If you would like to build the application for Raspbian (OS), please note you must already be on an ARM architecture to compile it, since this application requires the CGO bindings due to the GoCV dependency. For now, building for raspberry pi is quite tedious as it requires building Go 1.11 and OpenCV from source:

  1. Install legacy Golang (required to compile Golang 1.11)
apt update -y
apt-get install golang
  1. Build Golang 1.11 from source
git clone https://go.googlesource.com/go
cd go
git checkout go1.11
cd src
./all.bash
cd ../..
mv go /usr/local/go
  1. Add Go 1.11 to system PATH
echo -e export PATH="\$PATH:/usr/local/go/bin" >> /etc/profile
export PATH="$PATH:/usr/local/go/bin"
  1. Set your GOPATH system environment variable
echo -e export GOPATH=$HOME >> ~/.profile
export GOPATH=$HOME
  1. Build OpenCV from source
go get -u -d gocv.io/x/gocv
cd $GOPATH/src/gocv.io/x/gocv
make install
  1. Finally...build GoCam!
go install github.com/zcking/gocam

Remote Access: Networking Setup

To allow you to access the web server on the GoCam, you'll need to modify your firewall. You can do this with traditional iptables like so:

# This will allow TCP traffic to port 80 
# on the PI, from anywhere.
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT

If you don't need SSH access to the GoCam, after creating the previous rule, you can restrict access to prevent any unauthorized access with the following:

# This will drop all other input traffic
sudo iptables -A INPUT -j DROP

To make the above iptables changes persistent on reboots, you can run the following:

sudo /sbin/iptables-save

About

Open source security camera project for cheap security surveillance with data resiliency and accessibility in mind.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published