Instead of trashing old or broken iPhones, why not turn them into wireless IP cameras to add to a Zoneminder video security system? Assuming you already have a Zoneminder system, all you need is $1.19 for the app and an old iPhone or iPod.
Collect Old Phones
Ask your friends, family, and co-workers, or put a call out on social media or Craigslist. Phones that no longer hold a charge, or phones with broken screens are great candidates. If you’re handy, pickup a cheap iPhone repair kit and fix phones others have given up on, and add a waterproof case if you’re installing your camera outdoors.
Without going to extraordinary measures, you will need the old lock-screen pass code, iTunes login, and/or SIM card to erase and re-activate the device, so if you don’t own the old phone, be sure to do this on-the-spot while the former owner can do this for you.
Reset the phone to factory settings (Settings -> General -> Reset -> Erase All Content and Settings). During the setup process, you may want to avoid signing in with your iTunes account, as this will link the phone to your iMessage, iCloud, and iWhatever.
Find a Good IP Camera App
Searching iTunes for apps that turn iOS devices into streaming IP cameras is difficult and frustrating. The majority of apps are for viewing camera feeds, not producing them. The apps that do stream video do so either to cloud-based services (for a fee), to other apps, or to browser-only feeds. For example, Instant Webcam looked promising, and is indeed a very nicely implemented solution, but one that just won’t work with Zoneminder because the video frames are wrapped up inside websockets.
The iPCamera – High-End Network Camera app is the best solution found so-far. Launch the app and configure it for your needs. I chose 480×360 resolution, medium quality, and 10 frames-per-second, but you can adjust according to your needs, network, and Zoneminder server load. You should also setup a static IP or DHCP reservation for the iPhone, so you can have a consistent IP address to use with Zoneminder.
Once you’ve purchased the iPCamera app, you can install it on all your other devices for free, even if you did not setup the phone with your iTunes account. Go to the App store and “buy” the app. Enter your iTunes account info when prompted, and the app will re-download without incurring additional charges.
With the app running, visit the URL shown on screen to confirm everything is working and to fine-tune any required settings using the web interface.
Add a Zoneminder Monitor
Open the Zoneminder web interface and add a new monitor with the following settings:
- Source Type = Remote
- Maximum FPS = 10 (or whatever you have set in the iPhone app)
- Remote Protocol = HTTP
- Remote Method = Simple
- Remote Host Name = <iphone-ip>
- Remote Host Port = 80
- Remote Host Path = /live
- Capture Width = 480 (or whatever you have set in the iPhone app)
- Capture Height = 360 (or whatever you have set in the iPhone app)
Important Notes / Troubleshooting Tips:
- Setting the Remote Host Path to /live ensures that Zoneminder receives the MJPEG stream, not the HTML page that contains the config settings and other irrelevant parts.
- If the Zoneminder live view of the camera is blue, verify the resolution is the same in Zoneminder and in the iPhone app.
- Even though the phone will rotate the video output to the correct orientation, a horizontal phone will have a resolution of (Width x Height = 480×360), while a vertical phone will have a resolution of (Width x Height = 360×480). If the Zoneminder live view is squiggly, overlapped, and/or duplicated, rotate the phone or swap the Capture Height and Capture Width settings.
Further Fiddling
- Tweak quality, frame rate, and resolution to find optimal settings.
- Have Zoneminder trigger the iPhone’s flash when detecting motion at night.
- Automatically reconnect if the phone drops the WiFi