December 18, 2008, 1:56 pm
Candy Cam, Part II: Audio & Video
If you haven't seen it already, check out Part I about Seven's Candy CamSince the original idea was just a bell and a camera to watch Seven, I decided to get one of those indoor/outdoor "security" cameras with the IR emitters. That way at night with the lights off Seven would still be visible.
The security cameras output an NTSC composite video feed which doesn't hook directly to a computer. Fortunately I had a KWorld USB thingamabob around which, besides having an ATSC tuner, has S-Video and Composite input. I wasn't sure if the device would be supported on Linux, and since my Linux laptop is old and slow anyway, I chose to use Windoze for the camera.
In the past when I've setup a video feed I always had everyone connecting to my computer at home. Of course that quickly saturated my bandwidth. In this day & age I expected there must be an easier way than me setting up some relay off another of my servers on a fast connection. A quick google search turned up several possibilities. The top of the list was Ustream so I gave them a try. They are free and I liked how they had somehow managed to get Flash to handle everything so I didn't have to install any software. The downside was that they had no way to let me choose which input I wanted to use on the USB capture card. It took quite a bit of battling with the crappy software that came with the USB device before I was finally able to get off the tuner and choose the composite input. Once I did that Ustream was up and running and streaming my camera.
The night vision on the camera didn't work very well though, it tended to make a bright spotlight right in the center. Plus being a cheap camera the colors were very washed out even during the day. The next morning I got out my old Sony Video 8 Pro camera to see if it would look better. It looked a lot better. But unfortunately it had a narrower field of view and I had to set it up right in front of a doorway in order to use it. I had to rearrange the entire dining room in order to turn everything so I could get a good angle with the camera. I also now have to leave the dining room lights on constantly to provide enough light for the camera. Fortunately they are compact fluorescents.Audio
After adding Elmo to the display, I realized I was going to have include audio in the stream. The security camera I had picked up also has a built-in microphone. I patched the audio into the USB capture card too, but because of some bug in Windoze, Flash, or the Ustream software, I couldn't choose the USB device as the audio source. After repatching it into the laptop's built-in sound card I had the audio up and running too.
Elmo however is quite loud. Obnoxiously loud. Plus having the microphone picking up any noise around it bothered me a bit too. In order to deal with both problems I picked up a cheap 4 channel mixer from Radio Shack. I disconnected Elmo's speaker and tied it directly into one channel. I also did the same with Santa. The output was patched straight into the Windoze laptop's sound card. This also had the advantage of making Elmo slightly more understandable in the video stream. Elmo's circuitry tended to cause a lot of pops and clicks on the audio feed though when he wasn't talking. The quickest way I could think of to deal with it was to play music in the background. I patched the output from the Ubuntu laptop and started up a CLI based mp3 player called mp3blaster. Once the music was playing the pops and clicks were much less noticable.One of the things I lost by removing the microphone was the jingling of the bells. The sound you hear now is simulated. When the program triggers the LEGO to jingle the bells, it also plays a sound file so that the video stream hears bells too. I still need to digitize my pachinko machine hitting a jackpot and play that when the candy machine is triggered.
See Also
December 16, 2008, 5:19 pm
Seven's Candy Cam: How it works
I'll be posting this in multiple parts because there's so much going on. If you haven't seen it, check out Seven's Candy CamThis all started out because I was ordering some electronic stuff and decided to order a couple of Arduino boards to see how they worked and what they could do. After I got them I was amazed with how simple they were to setup and started doing some searches of things other people had done with them. I stumbled onto a site where a guy had used a servo to ring a bell whenever someone visited his site. I thought that was cool and I might do something similar with Wishzilla.
A couple of days later I was thinking about it more and I had the idea that maybe it would be fun if I setup a web cam and I rigged up something so whenever the bell rang a treat or something would drop for Seven. And why not throw a webcam on it?
Over the last week this has evolved from bells and a webcam to watch the dog eat into a crazy mess of interactive toys, all controllable by visitors to the site.
Currently the system is using 1 Windoze laptop, 1 Ubuntu laptop, an additional 15" monitor, a LEGO RCX, an Arduino, an Elmo Live! toy, a D.J. Mixin' Santa decoration, a LEGO 9volt train, X10 for the Christmas lights, a little USB TV capture device, an automatic dog feeder, a 4 channel mixer from Radio Shack, and my ancient Sony Video 8 Pro camera. Why do I feel like I left something out?
The web server
An important consideration was making sure that the site would be unaffected by any glitches with my rig at home. This meant I didn't want the processes trying to connect to some IP at home or dependent on a daemon running locally all the time. I wanted to make it as simple as possible so I didn't have to keep coming back and checking which piece of software had crashed.
What I decided to do was make a FIFO on the web server which the Wishzilla software would attempt to open in non-blocking mode and then write a line to. Doing it this way meant it didn't have to open any sockets or have an IP address hardcoded into it that might change. The software running at home does an ssh into the Wishzilla server and does the reading from the FIFO. Very simple.
To be continued...
In the coming parts I'll show how the components are wired up and what software is running on them.
November 18, 2008, 10:26 am
Wishzilla.com: Letter to Santa mode
Letter to Santa mode (aka Wedding Registry mode) is now working. What does this mean? You can sign up on Wishzilla.com and let anyone see and lock your wishlist, without adding them to your family.All you need to do is login, edit your profile and change it to public, then click My Home Page. Up in the address bar will be a URL to your wishlist. Just copy&paste it and email it out, or link it from a web site.
Here's an example: Seven's wish list
November 16, 2008, 8:22 am
Goodbye Gift Box Server... Hello Wishzilla.com!
I'm sure most of you probably already saw the email that we sent out to announce it, but for everyone else: The Gift Box Server has finally got a facelift! The new site is at Wishzilla.com.For those of you who may be new to this thing (or just in need of a refresher), here's how it works: you and your family members each set up an account, and then start making wishes for what YOU want. Whenever you think of something, you can simply add it to your Wishlist. If you see it online, you can just use the new Wishzilla.com magic Wish Getter, right there from any website, no need to go back and forth! Then your family members can look at the things on your list and choose which wish they would like to fulfill for you, and you can do the same for them. But don't worry, this won't eliminate the fun of the surprise, and it's still the thought that counts: you choose which item you would like to give, and when you want to buy it you can lock the item away, so nobody else will buy it... all without the recipient knowing anything about it! This removes the stress from the holiday season and ensures many happy exchanges, without the hassle of dealing with returns later.
Some of the new features are integrated images, mobile devices, and multi-family. Put images on your wishes! Let people see exactly what it is you want. In the store and want to see what someone wants? Well there's iPhone and other mobile device support too. Plus, now you don't need to sign up for multiple accounts, a single account can be a member of multiple families! No longer do you need to maintain several different gift lists.
Come sign up and make gift shopping a lot easier.
June 20, 2008, 8:36 am
New Air Conditioner
5:45pm: It's installed and running
11:50am: Looks like it will be a challenge to get the ductwork to match up


11:30am: Recycler shows up to drag away old unit.

9:15am: Old one goes out

8:15am: Arrival

March 12, 2008, 9:35 pm
Roman numerals and back again
Remember way way way way back in the days of the Apple ][, one of the magazines used to have a contest to write one and two line programs in Applesoft BASIC that did neat things? I think it was Nibble, but I'm not positive. Well anyways, here's a program that I wrote that I should have entered, but never did.The reason I wrote it was because at the time, one of the Apple ][ magazines had included a sample program listing that would convert decimal numbers to roman numerals, as well do the opposite, convert roman to decimal. I was appalled by how long the program was, it went on for page after page after page. It seemed to me it could have been much much shorter. And so there was the challenge.
It turns out I was able to condense the whole thing down into two lines. Yes two! And it still accepts either a roman numeral or a decimal number, and converts it to the other. Sorry about the listing, it was a struggle to get the emulator to even cooperate enough to get the file transferred and get a listing.

I dug this program out because I need a quick & dirty converter for a new program and I thought I'd take a look to see how I did it and how I got it so small. Unfortunately it looks like I used a lot of dirty Applesoft tricks so the code isn't all that re-usable. Oh well, it's still cool.
January 29, 2008, 5:35 pm
Atomic Clock Radio
I have a really old clock radio that my grandparents gave me when I was kid that I still use to keep time in my bedroom. It's so old that it's from before manufacturers figured out to stick batteries in to maintain the clock when there's no power. Every time the power goes out the clock resets itself to 12:00am.The clock only has two ways to set the time: fast and slow. Fast moves ahead about 1 hour every second, and slow is 1 minute every second. If you happen to overshoot on fast then you have to go 24 hours around to try again. It's a pain but the power doesn't go out too often. Usually.
Lately the power has been going out a lot and I've gotten tired of resetting it. I kept thinking it would be nice if the computer could fix it for me. What I decided to do was plug the clock into an X10 appliance module and stuck a Firecracker module on a Linux server I have nearby. Using Heyu and At, I told the computer to turn off the clock at midnight and turn it right back on. It worked great! Now I just have to try not to accidentally push the button on an X10 remote that turns it off...
January 8, 2008, 2:36 pm
I need my own lumber mill
Last Friday I woke up to find 3 large branches had been torn off my maple tree during the big storm that had happened. Looking out the window they didn't seem that big, but when I got out next to them, they were huge!


I don't think the damage to the fence is too severe since it's just a wire fence. But the branches are much much too big for me to drag away. They will need to be cut up before I can move them. I'm hoping I can find a way to slab the bigger parts and save them for woodworking projects.
Just for fun I looked at the free stuff on Craigslist the next day, and it was just full of "Free wood" ads. Lots and lots of trees had been blown down. And not just fir trees, lots of hardwood. Makes me wish I had one of those portable lumber mills so I could go harvest all that free lumber!
January 7, 2008, 5:47 pm
Retaking my mailbox
I've had the same email address for well over 12 years. It's probably on every single spammer's list that's out there. I've been getting over 500 spams a day for a long time and I've had to resort to sorting spam out into another folder because my inbox was constantly alerting me about new mail.Of course, sorting spam into another mailbox doesn't work. All you end up with is a huge mailbox so clogged with junk you'll never find a message that was falsely identified, if you somehow find out it got in there by accident. Plus it still means that you're looking at every single spam, so what's the point? It has been my goal for a long time to get rid of this system and block spam before it even gets to my mailbox.
Over New Year's, I spent a lot of time tweaking and adding new spam blocking systems. I have to say, the new methods were very successful. I was able to go from 500 spams a day to only 40 spams. Over a 90% reduction! At this level I was finally able to get rid of sorting into a spam box. Now I don't have to worry about false positives. Spams that are blocked are also now being blocked at the SMTP level, so if something is falsely identified, the sender will get a bounce back and know that I never got their message.
It's been strange for the last week. I keep expecting a ton of spam, but my mailbox is just as quiet as it was when I was sorting. And yet, there's no sorting and I have no spam box! It's just unbelievable! At this point I'm thinking maybe the couple of clients that are using an anti-spam service should be switched to this setup.
December 6, 2007, 12:57 pm
Warm Floors Cubed
I've had a Rubik's cube floating around the office at Warm Floors since almost as long as I've worked there. It was given to me by the owner of the company after he picked it up at some computer show. It's a fairly standard cube except that it is covered in Microsoft ads. It's slightly harder to solve than a standard cube because you have to make sure the center tile is rotated the right way.The poor cube got trashed because the other people in the office got tired of me always solving it. It ended up covered in red stickers on every side for a while, and then when they tired of that they pulled all the red stickers off which took off several of the original Microsoft stickers too.
Over the weekend I decided it was time to do something new with the cube, so I made new stickers with employee faces on it. I also threw in a Santa face since it happens to be Christmas time and they had just put up decorations at Warm Floors.


