I’ve started to accumulate quite a heap of old smartphones, and would really like them to either get useful or get gone. It was my initial intent to “simply” hook one up as a networked webcam, and have it serve images via HTTP, not unlike the units sold by everyone from Axis to Panasonic. Sadly, however, this proved more complicated than I’d imagined.
After quite a bit of procrastination and some help from the guys down at the Makery, I found a package called WebCamera Plus, which only partly fit the bill. Half of this packages’ functionality requires a client installed on a PC, where the actual web serving happens. Without that “server” PC, the best it can do is FTP photos out on a timed basis.
Adding insult to injury, about the time I was ready to bite the bullet and spend the $20 on this thing, the company sorta disappeared. On the upside, the company’s website did resurface a few weeks later, with the software now priced at $9.99. The decision had already been made, however, to go in a different direction.
One of the features of the Makery (now the defacto name for the Omaha Maker Group’s space) is a standing webcam that publishes live photos of the space to the Internet. We have a few USB webcams hooked up to a PC running YawCam, which is a free (as in beer) webcam package written in Java. We run one copy of the software per camera (Copied into separate directories, as the config is file-based) and each serves its image on a separate port.
Initially, people were having problems accessing HTTP on non-standard ports, but we weren’t inclined to “use up” port 80 on our only IP address with just one webcam; With some help from the mailing list, I hacked together a Perl script that runs on our website hosting provider and proxies requests to the camera server’s separate nonstandard ports. It then re-serves the images on port 80 and also uses GD to return text images in the event of an error (like a timeout fetching the webcam image). This setup has the added benefit of masking the firewall’s IP address from the website, and would even support cameras on multiple IP addresses that look like a single image.
At Dave’s request, I also included “indicator pixels”, to coordinate with his “are the lights on” python script.
Overall (for my part, at least), it’s sort of a hackjob, but it seems to work pretty well.