Security Cameras Part 1: The Hardware

Something I have been vaguely looking into over the years is a DIY solution to home security and automation.  There are several places you can pay to have this sot of thing installed and they often include a subscription for monitoring and leasing the equipment.

We’ve been having some issues lately with kids in the neighborhood knocking on doors and windows and running off late at night.  I had set up a temporary measure using my Sony Handicam on a tripod and even caught one of them once but the video was not clear enough due tot he darkness to really see anything.  Plus, filling the memory card on a daily nightly basis is not likely very good for the camera, nor is leaving the thing plugged in constantly good for the battery.

I could also use my Panasonic DV100 to capture the low light video pretty easily but it takes tapes and would only record an hour max.  Plus I don’t have an AC adaptor for it, so even if I hooked it up to a VCR or something, I’m still only looking at 2 hours max.  Not to mention wear and tear on the camera.

What I really needed was a dedicated camera designed for this sort of thing, one with night vision.  I’d tried using webcams hooked to PCs in the past but that doesn’t work in the dark either and the webcams I own are all ancient.  Plus I am tethered to a PC by a USB cable.  Amazon had a daily deal on some D-Link DCS-932L wireless cameras (which wasn’t as amazing as it seemed on paper due to Amazon’s pricing screweyness but whatever).  They were wireless, they were day/night capable and for the price I could get 2-3 of them compared to one of the other cameras I had been looking at.

IMGP0903

The cameras themselves are decent.  They were cheap, which I liked, and thought they are not super cheap in quality, they are SD only, which I was aware of but its a bit more of a letdown than I expected.  They were easy to set up, I plugged each into the router using the network cable, scanned for the IP address, and opened the GUI.  From there was was simple enough to assign IPs to each camera and connect them to the WiFi.  There is a myDlink service included for “anywhere access” but the cameras can be used independently from myDlink.  I found some software which lets me view multiple cameras at once and may set it up on a TV using an old broken Netbook I have laying around for quick access.

After ordering and receiving the cameras, I had a realization that I had neglected to consider.  These cameras are NOT outdoor cameras.  Specifically, they are not deigned to be outdoor cameras.  In my research, I knew simply placing the cameras in a window sill this would be a problem due to light reflection from the windows.  Just because I can’t see the infrared light at night doesn’t mean it wouldn’t create a massive glare on the window.

It’s still light.

I didn’t even get far enough for that to be an issue, the cameras during the day were horribly obscured by the window screens and the street lights outside, while not bright, created a massive amount of reflection from the blinds.

Oh well, at the very least, I could use them indoors, though the point was to watch the doors and driveway at night.

Still, I didn’t give up.  I did some research online and found many people had used these outside, for at least months and in one case years.  The main concern was condensation and humidity, and to a lesser extent, temperature.  One video even put the camera out on a table in the pouring rain for an hour with no ill effects.

So I set out to build a weather resistant enclosure for the cameras.  I’ve used plastic electrical boxes in the past for other projects and this one was pretty much just drilling a few holes in some plastic.  The boxes I found at Lowes came in 4×4 and 6×6 sizes.  I had my wife measure the camera and she said it was not quite 4 inches tall minus the base, so I opted for the 6×6 box.  The boxes themselves are pretty thick and I wasn’t sure the inner cavity was actually 4″x4″ on the smaller boxes.  Plus going with 6×6 gives the cameras room to breathe a bit, since it is still an electronic device and will generate some heat.  My main irritation wads that the 6×6 boxes were almost twice the cost of the 4×4 option.

I started by measuring out the center along one axis of the box lid, then measuring out the placement of the camera’s circular lens ring on the other axis.  I then found the center point of the circular areas and marked the counterpoint of the hold I was going to drill.  I measure the camera camera ring at 2″ in diameter and used a 2″ drill bit put apparently came up off somewhere because the hole was about an eigth of an inch larger all around.  Slightly annoying because I wanted a tight fit but it was workable and I can always seal it later with some caulking or even just some foam weather sealing that I have laying around.

Next I drilled holes in the bottom of the box to match the screw hole mounts on the bottom of the DSC-932L camera mount.  This size was dependant on the bolts I had handy that would fix in the screw holes.  This would allow the camera to be bolted into place inside the box.  Finally, I needed to get the power cord through.  The largest normal drill bit I had was not quite large enough to make a hole for the power cord to fit through but I was able to ream out the hold enough to get the plug through.  The benefit of this tight push was that the hole would be smaller and easier to seal up.

IMGP0902

So after mounting the camera with bolts and pushing the power through and assembling the cover around the lens, I hade a self contained weather sealed box (the electrical box has a nice rubber seal between the lid and box).   I am not real sure yet on the best way to mount the box but I placed it outside last night on a plant stand and let it run through a rain storm.  Worked out fine and the video from outside the window worked fine.

This project definitely isn’t done but it’s off to a good start.  Next will be finding an effective way to mount the boxes under the soffits, and, more important, providing power.  The cameras are wireless to the network but they still plug in.  I had some ideas about running extension cords through the soffits to the garage but I’m thinking it will be better to just install some outlets in the attic at the appropriate points.  I have a motion activated light I took off of our rental property after the fire that I plan to install on the front door, so the front door cam may just get a hook up right there on the light, since the motion light will need to be on all the time anyway.

The project is working out pretty well though despite a few hiccups.

Learning Python with Udacity

udacity_cs101

Just a note, this is not any sort of advertisement…

So I know some basic programming syntax, generally centered around C and C++ which I learned in college.  The C was through several Engineering based classes and the C++ was from a single Computer Science course I took when I had a semester to fill before transferring schools and didn’t want to completely lapse on the studying, schooling lifestyle.  I also know how to code HTML but that is barely programming by any stretch. 

I have tried various self taught methods to teach myself more C++ and some Java with little success.  I have some books to make Android apps but I have yet to get anywhere with them.  Then, I believe through the Windows Weekly podcast, I found out about this deal called Udacity. The first course offering is to learn how to code a basic Search Engine using Python.  I’ve found it pretty well designed though a handful of the examples were a little too abstract to be meaningful (I’m looking at the one about cost and RAM and memory and compute cycles which I still don’t understand).

Anyway, I’m done three out of the seven modules and I’m rather proud of the fact that I’ve actually managed to stick with it and learn some things.  I’ve got a little script now that I could use to extract links from any webpage or even a number of webpages, though right now all I know how to do is display them.  Presumably we’ll learn how to compile them into some sort of file or database.  My biggest hurdle really is I keep wanting to use C and C++ syntax.  Things like adding ; at the end of lines or 1++ or variable++.

It’s not a terrible problem really.

Building a Better Dance Pad

So a while ago, I designed and built my own Dance Dance Revolution Dance Pad.  I’m not going to go too much into the details behind that, but for a variety of reasons, I’ve actually used it considerably less than I’d hoped.  I also found recently that the arrows don’t detect properly anymore since they are connected to the Directional Pad which reads as analogue not digital.

So, I fixed it.  While I was fixing it, I finally added the button box I’d been meaning to add.

IMGP5404

The button presses of a Playstation Controller are simply the creation of an electrical contact.  This can be replicated on any similar button by soldering wires to either side of the PVC board’s pads inside the controller.

Anyway,  the first task was to rewire the pad’s “buttons” to the shoulder buttons of the controller board.  Simple enough.  Now they show up as “buttons” and not analog pulls in the PC.

Step two was to make the box removable from the pad for easy storage.  This also allowed me to replace the ball of wire that I’d ended up with when building it the first time.

IMGP5406 This mess becomes a network cable and a network jack.IMGP5405 The network cable is the one used for the new connections tot he shoulder buttons.

Next is the box, which I wired to the four face buttons of the controller.  It really doesn’t matter if I use the “start” and “select” buttons since in the end, the Playstation shell is tossed out and I simply map the buttons to whatever I want in game (I have yet to see how this will affect it if i use it on the Playstation).

IMGP5408

The end result is much cleaner and much more reliable all around.  I will probably add some stickers or something to the box to make it look prettier.

Procrastination Isn’t Always Bad

I almost always have a couple of dozen projects I’m working on.  These are not projects for work or even household projects that my wife wants me to take care of.  These are personal projects of varying importance though generally of little overall *real* importance.  For example, at the moment I am working on:

– Building a solid automated online streaming radio service.

– Playing through several video games.

– Burning old family VHS tapes to DVDs

– Building a small corner shelf for putting my games and DVDs on in the bedroom to reduce the clutter in the closet.

– Repairing several laptops i have that don’t work.

Etc…

Anyway, Several of these projects I’m “working on” are continual, like playing through various games.  Others I have not even started on, though I still would say I’m “working on them”.  Some I may never start.  The point is that I tend to think about a large string of projects in the back of my mind almost constantly.

Often when i have “free time” I do something completely different when I should be doing “a project”.  I have a tendency to procrastinate on these things.  Often this procrastination though is good because inevitably, I get an epiphany on some project that makes it extremely simple and quick and it’s the best possible solution.

The latest example, which inspired this rambling blog post involves my home network.  It’s not huge but it is larger than most people’s home networks and it “evolves” much more than most people’s home networks.  Currently, the phone line feeds the cable box thing (we’ll call this the Residential Gateway or RG for lack of  better term though I’m not sure it’s actually accurate).  It comes out of the RG and feeds a router.  This router was put in by the cable guy when he came out to replace the RG when it broke.  The thing is, he left the old router in place (also provided by the phone company).  This initially created some issues since it gave me two IP address sets which is annoying when you’re doing a lot of NAT translations for things like streaming radio and VNC access to half a dozen machines as well as hosting FTP, HTTP, etc.  I also own a switch and a hub, though I don’t use the Hub because "hubs suck”. 

I lived with forwarding all ports to the internal router for a while but inevitably I swapped the Hub for the switched, changed the IPs of all my machines and rebuilt the NAT table.  it was a one time pain but it makes things simpler.

I put the old router aside until I discovered the the new router does not support the older less secure Wireless protocols that my Nintendo DS requires.  So the old router went back in almost exclusively for use of the NDS, whoes IP address I don’t care about.  It also serves as an access point for guests or whatever to keep them off of the main network.

The issue I had recently however involves a remote location in the house in my wife’s office.  She has a PC out there for “office use” and I put a second PC out there recently with a KVM for my “experimenting etc” use.  Currently it hosts Lameazoid Radio, an OpenSIM server, a session of Outlook that is attached to archives of all of my old email PST files and I use it for downloading Torrents.  The main point is, it creates a lot of network traffic.  The problem is, there’s only one physical cable running to the office and running a second one would be a pain.  the obvious answer is, put in a switch.  I could use the hub but I fear the high traffic of the one machine would cause lots of issues for the office computer and visa versa.

I’d pretty much resolved myself that I can afford a 30 dollar switch to throw out there.  The problem is that i just got off of a huge backup with my “personal budget” from buying several expensive items “in advance” and then paying back the budget.  I’m tired of being broke for the past 2 months on my personal budget.  Also, Black Friday is coming up and I intend to have a chunk of change to spend on good deals.

So I can drop money and be short on BF, or i can wait a few weeks and listen to my wife occasionally complain that the office PC doesn’t have internet access.  So I decided to “sit on” or procrastinate this project.

Then I had the epiphany.  I can move the main Router over to where the switch is now and swap them out.  The only thing plugged into the main router besides the long network cable running across the room tot he switch is an old laptop I was trying to project but i can’t keep running anyway.  It can be dropped.  I was going to plug a media center PC into it for Hulu but Netflix on the Wii eliminates the need for that and I already have a long cable running back to the TV area from before the newer Router was there anyway I can use.

The point is, that I don’t NEED it to be where it is.  Then I get my switch back.

The real point is, because I didn’t rush into putting in the hub or rush out to buy a switch, i came up with the best solution AND it doesn’t cost me anything. I do this a lot.  I did it at my old job all the time.   I’d sit on a project until I’d realize I can combine two obsolete items into something useful or whatever.  The point is, sometimes it’s good to procrastinate.

Project: Radio DJ Automation

If I earned a nickel for everything I’ve ever created that no one else cares about I’d probably be about to earn another nickel with this next post.

Anyway, one of my many pet projects has been setting up a private internet radio stream.  I actually toyed with the idea for a bit of building a small FM transmitter and going full on Pirate Radio but I decided that the current state of media doesn’t necessitate the need for radio waves when the internet is right there just waiting with a much broader reach.  The real issue is that it mostly just reaches me.

The nice part is, I don’t really mind.

I plan to put up a little page for Lameazoid Radio, but I’m still fleshing out the details.  A few people know the URL of the stream (hint: stream DOT) but I have no idea if they remember it and I doubt anyone listens.  I suppose the question is, why would anyone want to listen?  Can’t you get the same thing from your iPod?

This question includes myself.  Wouldn’t it be more beneficial to just load up the iPod and let it rip?  I do have some answer to this.  For example, my iPod isn’t large enough to hold my entire music library if I want it to.  It also is incredibly poor at shuffling music in a meaningful manner.  The Radio Automation software I’m using lets me sort things into nice themed play rotations.  i can interject little funny clips in at intervals as well to help break up the flow. 

I also run a lot of Podcasts.  The problem with using the iPod for Podcasts is that when it’s in my iTunes library, waiting to be played, I feel obligated to listen.  If it’s out of my control and playing on it’s own I can forgive and forget the playout if I miss one or come in partway through and leave early.  It’s expected I guess with radio that I may miss something.  It’s basically a subtle psychological point that works behind the scenes.

Anyway, I’ve managed to work the kinks out of the automated updates on Podcasts which leaves a few other projects that I want to implement on the table. 

First, I need to record some promos.  I want to make a few music based tags and a few others promoting the shows on the stream.  This basically requires time and a microphone.

Second I need to finish fleshing out the lineup.  I want to run new shows 7 days a week at 4 and 7.  I’ve got both slots about half filled now.  I also would like to find another short bit repeating news segment to compliment Tech 5 which plays every hour where there isn’t a show right now.

I also need to come up with something for the over night.  It’s likely no one will ever listen in the overnight so just running music all night is the easiest bet but I do like the idea of having some sort of “programming” there.  I’m thinking of pushing some audiobooks or something for lengthy periods but missing part of an audiobook is worse than missing part of a podcast.  I’m also thinking of compiling together my longform Techno mixes and running those.  Also possible some concerts in order.  Basically I’m looking to run longer blocks of related content in the overnight.

Thirdly i want to add Live Reporting.  I’ve set up Skype on this PC with auto answer for known callers.  This means i can call in and it’ll pick up.  Right now doing this kills the stream audio and it doesn’t return.  I have some software (freeware) that I believe I can use to create a gate that will shut off the stream when a call comes in and then resume it afterwards.  This would mean if I wanted to do “live reporting (to no one) I could call in through Skype on my phone.  Or better yet, if say, the GNR crew wanted to broadcast live they would simply call into the Skype and it would play.  On top of this I want to set up Skype to auto record and possibly auto rotate these short news bits.

Finally, at least on the list now, is to set up an automatic “now playing” Tweet.  I’m not sure the best way to accomplish this yet though the software does support a now playing.txt that is used by Icecast to set the title.  What wil be more likely is I’ll set up timed tweets for the time each show starts, like on @lameazoid.