My wife raises dairy goats.

Yes, she kisses them.

Yes, she even kisses them.

If I sound matter-of-fact, it’s only that I’m continually reminded of this by the 365 days-a-year bleating of the teeming masses, especially cacophonic around mealtimes (and yes, cacophonic is a word). What makes it relevant here is that something the wife asks me for has been a “goat webcam” so that she can monitor the goat mommas when they are pregnant and about to give birth. She’s gone so far as to throw a good amount of money at “solutions” (I use the word so very mockingly) that didn’t work. In particular I refer to one “wireless” camera that only transmitted an analog picture, very bad sound, and had a range so short, you basically had to be in the room with the transmitter to get a decent picture.

And so I simmered the idea on the back burner for some time to create a goat webcam that streams wirelessly (perhaps even in HD, we shall see) to a live streaming site like USTREAM or Livestream or Justin.TV (like Justin.TV wants to have baby goats being born on their site — but we’ll just see about that, won’t we).

I won’t bore you with Crazy Goat Lady™ data about goat gestation periods, but suffice it to say for now that having the lady-goats visiting their boyfriends back in the autumn time means that we will soon have baby goats to watch for. This means the goat webcam project is officially on. And seeing as you have read the title of this post, you can guess that I’ll be using a Raspberry Pi (complete with the super tiny and super handy camera module) as the basis of this build.

I bought a couple RPi’s back in 2013, when they were almost impossible to get your hands on (much like BeagleBone Blacks are today),

Beaglebone Black: Element 14 don't got em. Adafruit, Sparkfun, Maker Shed: nope, none of them.

Beaglebone Black: Element 14 don’t got em. Adafruit, Sparkfun, Maker Shed: nope, none of them.

and then did absolutely nothing with either of them, thinking that one of them would get used for a hacked up Macintosh Classic chassis (the other alternative is a fishbowl for the damn thing). One of them eventually got donated (basically) to the local hackerspace in Sebastopol for their RFID entry control system. And so I now have one, and it has now been earmarked for this webcam project.

With that all in mind, here’s the plan:

  • Raspberry Pi with the Camera add-on
  • WiFi over dual band (2.4GHz and 5GHz, but mostly 5GHz if I can make it happen) 802.11n (non-trivial, it turns out)
  • USB microphone (still TBD)
  • Powered USB  hub
  • Clever case for all the electronics and a hole for the damn camera and the damn microphone (though the mic may end up external to the case)
  • A way to mount this in the barn to enable the wife’s voyeuristic needs

And the webcam will be using this software stack:

  • Raspbian Linux
  • Raspivid into a FIFO pipe
  • ALSA to pick up audio from USB
  • FFMPEG to stream to a RTSP endpoint (ostensibly at USTREAM or wherever I can get it going)
  • Tune the bejeeezus out of it until everything works satisfactorily.

Sorry to say, the build has already started (somewhat), so I’ll be retroactively blogging the trials and tribulations so far, so don’t freak on me. It’s not like I did that much.

For this webcam, I’ll content myself to have picture and sound *somewhat* in sync. If I’m able to tune it to where picture and sound will encode to a stream one time, all the better for keeping it going. This is most likely used in the style of a “baby monitor” by the wife if there are nighttime goat births happening. I’m buying earplugs, I hope it’s enough to keep me sleeping through the night, and that they’ll last until the webcam shuts down until next Spring.

As breakthroughs or setbacks happen, you’ll get to see the damned thing develop. Copious photos to come, just not this time, because it’s dark and flash photos look lame to me.