I have wanted to put a security camera in my office for a long time now. Only recently did I find that I had all of the necessary means to do so. Come along on a journey of monotony across about two or three hours of my day. That’s the thing with being a sysadmin, you’re either running around with your head chopped off or you’re on reddit for four hours and your chair smells funny when you leave at 5:00 on the dot.
Like I mentioned in the Raspberry Pi Kiosk post, we had an oldish Dell Latitude tablet lying around, not getting any use, along with a nice little mounting arm. Since it’s still just lying around, nobody will miss it if I decide to set it up as a very unsubtle camera.
There are a lot of free services out there to turn your old Android device into an improvised IP Webcam, but this is a full-fledged Windows 8 tablet. Services catered to that target audience are considerably more limited. As it turns out, the WeatherUnderground (the weather reporting website, not those hippies that– well, you can read about them on your own) / DIY weather station community is very involved in this kind of thing. They seem like a really nice group of people, and seem to actually try to help each other troubleshoot problems on their boards. That’s always nice to see.
As such, they’ve been doing this for years and years. What my setup boils down to is what they’ve been doing since dial-up. It’s just a webcam passing an image through to a FTP connection every so often. My situation differs from theirs a little, because I’m dealing with my own web host and their idea of SFTP.
I use 1and1.com for hosting. Not because they’re anything special (at all), but because the first year was something stupid like one dollar, and I forgot to look into billing before it renewed for another year, for something stupid like 80 dollars. They give you some decent information about FTP uploading, allow you to create an additional 19 accounts on top of your default account, and seem to work well with Filezilla. Or perhaps Filezilla works well with everyone. I’m inclined to believe the latter. If you know how FTP works and how to use it, you’re basically halfway there already.
Then I found a nice little piece of freeware called YAWCam. It seems to be well-supported; the last update was in June of this year. That’s not a Microsoft Update Tuesday level of upkeep, but it’s damn impressive for a pet project from someone who has a life outside their work. The DIY weather community seems to like another software called WebcamXP, for the folks who take it seriously. The enthusiasts. It’s got a price tag of over $100, so it’s out of my range of justifiable expenses for a passing hobby. I think there are others online that do something similar, but YAWCam supports FTP, automatic file saving, an embedded web server, streaming capabilities, and did I mention it’s free?
The only problem I’ve had with YAWCam is the FTP function. For whatever reason, I just can’t get it to connect to my server for any amount of time. But YAWCam has another function that helps bridge the gap. You can set up the software to automatically take a photo at set intervals, overwriting the oldest photo, with standardized naming conventions. You set how many photos you want it to store at one time, how often you want it to take a photo, and where you want it to save.
I went with saving the photos to a networked drive that I can access both from the tablet as well as my normal workstation. I’m going to change where it saves, but more on that in a minute. Next, I needed to make sure that the folder containing the pictures was staying up-to-date with the directory online. For that, I went with WinSCP as referred to in this StackOverflow thread. It really makes a breeze of synchronizing folders for something just like this.
One distinction I want to make—if you’re using WinSCP, the ‘Synchronization Direction’ option refers to which folder you want to be playing catchup. If you select Remote, your online directory will be watching for changes on your local directory, and alter itself accordingly.
Next, you’ll want to create a page that will display your images and update automatically. Since the photos in your directory are now being updated an overwritten every 15 seconds, you’ll want your page to reload every 15 seconds. For that, use the following between your <head> tags:
<META HTTP-EQUIV=”refresh” CONTENT=”15″>
Then the body can be anything you want. I went with a minimalist approach, ending up with something like this:
<center> Last 45 seconds of images:<br>
You’ll end up with something like this:
And that about sums it up. To finish it off and make it as hands-off as possible, I moved my install of WinSCP to the tablet itself, and changed the default save location to a local storage folder, rather than a networked location.