Advertisements

Archive for March 20th, 2017

Raspberry Pi Yard Camera

The yard camera I mentioned a few days ago consists of a Raspberry Pi 3 with an Official V2 Pi Camera peering through two layers of 1955-era window glass into our back yard:

Back Yard Camera setup - 2017-03-13

Back Yard Camera setup – 2017-03-13

Yes, that’s black duct tape holding it to the window pane. The extension cord draped across the floor gotta go, too.

This being a made-in-haste lashup, I used the streamEye MJPEG HTTP streamer, started from /etc/rc.local in the usual way:

logger -s Starting camera streamer
sudo -u pi sh -c '/home/pi/yardcam.sh' &
logger -s Camera running

The yardcam.sh script feeds one moderate-quality frame to the streamer every second:

/home/pi/streameye/extras/raspimjpeg.py -w 1280 -h 720 -r 1 -q 80 | streameye

MJPEG has a lot to dislike as a streaming video format. In particular, without any hint of inter-frame compression, the network usage gets way too high for any reasonable frame rate.

But it got the camera up & running in time for the March snowfall:

Fun in Snow - 2017-03-15

Fun in Snow – 2017-03-15

In a nod to IoT security, the Raspberry Pi’s wireless interface sits behind the router’s firewall on our guest network, with no access to the devices on our main network. The router passes a one-port peephole from the Internet to the Pi, which protects all the other services from unwarranted attention.

The router maintains a dynamic DNS record with a (not particularly) mnemonic URL, which seems better than an ever-changing dotted-quad IP address.

Because the router doesn’t support hairpin connections from the main network to the guest network, I can’t monitor the video from my desktop through the outwardly visible URL. Instead, I must fire up a laptop, connect to the guest network, then connect directly to the camera at camera.local.

You do not have a Need To Know for the URL; I’m sure it’ll appear on Shodan. I plan to take it down when the snow melts.

Advertisements

4 Comments