Secure Google-Free Baby Cam using an old Android Phone
Written by max on 2013-11-03
Introduction
Chances are if you are geeky enough to be reading this blog post, you have a couple old Android devices laying around. Even if you don’t, I guarantee you know someone who does. Older smart phones have high-resolution cameras and wifi radios, why not use them as baby monitors? This isn’t a new idea, there are many apps in the Play Store (market) that let you do just this.
What I add here are two things :
- Running the Android phone without a google account connected, with only the minimum of apps installed.
- Adding https and password support for the webcam so it can face the Internet with slightly more security.
Preparing Your Old Phone
It’s time to wipe all your old apps, settings, and operating systems off your old phone. Then we’ll install a minimal copy of Android that only has the apps you want. The goal here is to not have to use a google account. There’s no need to have your email account available, and device usage provided to google when this device is only being used as a webcam.
Wiping the SD Card
If you have a removable SD card, let’s wipe it of all your old settings and files. Shutdown your OLD phone, and remove the Mini SD Card. Put it in the SD Card adapter and into your card reader on your computer.
You have two options here :
- Use Windows Format to blank the data. This is not as secure, but good enough for the casual person to not get files back from the SD card. Go to “My Computer” and right click on the SD Card and click Format… Make sure to unclick “Quick Format” so at least everything is wiped with zeros once.
- If you’re more paranoid, or you have a tremendous amount of embarrassing home-made videos on the SD card, you should use a Wiping program such as http://www.roadkil.net/program.php/P14/Disk%20Wipe
If you do not have an SD card, then you will need to just do a “factory wipe” on the internal storage and hope no one really wants to recover your bits.
Install Android
Here you have two options : Cyanogenmod or Replicant. Both are custom versions of Android. mednis.info has a good starter about this that was a helpful reference.
The primary steps are :
- Root your phone
- Install a bootloader / recovery package
- Install your new version of Android
These vary from phone to phone and are not covered here. Aside from googling, the XDA Developer Forums are a great place to find information about this. Although it is a bit like drinking from the firehose. I would google for instructions specific to your device to make it easiest.
In my specific case I had a Motorola Droid 1 (sholes) that was already rooted and with a recovery package installed. Here are the steps I took :
- Download latest Cyanogenmod for my device — Version 7.2.0 Stable
- Copy the zip file to the SD card
- Put the SD Card in the Droid 1 and boot into recovery
- Flash the zip file
- Factory Reset/Wipe
Now, most important, when you boot into the new phone DO NOT enter a google account, just skip that step. For my particular CM version, it didn’t even ask me.
Installing Apps to an Old Phone Without the Market
One obstacle in not having the phone attached to a google account, is that you are unable to directly use the Market / Play Store for apps. Working around this there are two things I needed to do :
Installing the F-Droid Market
The Free Software Foundation Europe has a good starting page called “Liberate Your Device” I recommend you read.
- From there make your way over to the F-Droid Market and download their market app (.apk file).
- Copy the .apk to your SD card. This can be done by either physically putting the SD card into the computer again, or you can plug the phone into the computer and turn on USB storage mode from the notification bar.
- Go to Settings -> Applications or Settings -> Security and allow “Unknown Sources” to be installed. The location of this setting varies depending on what version of Android you’re using.
- Disconnect the USB, Open the file manager app, and find your way to the SD Card where you put the .apk file. Run the file to install the F-Droid app.
Now that you have this new market of free, open-source, ad-free apps, try to find the app you’re looking for. Unfortunately, the selection of apps is much much smaller than the normal Market / Play Store. If you can’t find what you’re looking for, keep reading.
Installing Apps from the Market Manually
The procedure to install an app without the market was illustrated above for F-Droid. However, the real trick is in finding the app to download it. The easiest way is to just google the app name and “apk”.
Warning there is a large risk in that you are downloading and installing apps from unknown 3rd parties, which opens you up to malware. Once you have the .apk file you want, use the same procedure as you used to install F-Droid.
Setting Up the Webcam Software
There are many webcam apps in the market : some of which turn your phone into the camera, and some of which turn your phone into the monitor.
Checking out the FOSS ones available in F-Droid, I only find one at this time : WIFI Camera. Unfortunately, it was not working well enough for me, so I decided to go with the more universal IP Webcam. This means I had to Google for the apk until I found it and use it. Note, that we are only looking for free versions, and this is not stealing the software — it’s simply getting the same free versions from outside the market. However, as noted, this comes at the price of not getting the limited security that the market has to prevent malware.
As for the settings inside IP Webcam, I changed very little:
You can explore these on your own. Make sure audio is turned on and be sure to add a username and password at this point!
Making the Camera Available Over the Internet using https
Please refer to my previous post : Secure Foscam Webcam with Audio Over https for how to front-end your “new” “webcam” with stunnel. This assumes that you have a router or webserver that is Internet-facing that you can run stunnel on. This adds a layer of encryption using https to the connection to the camera, while exposing the camera to the whole Internet. Choose a random port other than 8080 please. Note, that the security of this connection is only as good as the user/pw security inside IP Webcam. Any holes in that program may allow someone to access the camera and audio feeds.
Setting Up the Viewer on Your New Phone
You can view your new webcam / babycam using your phone or tablet, or on a PC. Assuming you are using a different Android device to view, you need to install a webcam viewer on your phone. After testing a few of them to see if audio works over Stunnel, I had best luck with IP Cam Viewer Pro. Note, that the $3-4 you spend on it will be the only money you’ll spend on this whole solution! There is one catch here though! Since this is a purchased app, you can only use the pro version on an Android device that is connected w/ a google account and the Play Store. Otherwise, maybe the free version will be good enough for you — I think there are some limits w/ what the audio will do. Even with the pro version, I occasionally find that the audio stops working. In order to fix this I restart IP Webcam on the old phone and it seems to come back. As always, YMMV.
For my setup I have one real webcam, and the phone webcam. I make four entries and only have two turned on at a time :
- Foscam over the Internet – Uses my router’s address + port I setup w/ stunnel
- Foscam over the WIFI – Uses the internal (eg. 192.168.1.xxx) address to connect the phone directly with the camera. This has less latency than doing it through stunnel, and it works even when the Internet connection is down.
- DroidCam over the Internet – Uses my router’s address + new port as well. Select all vendors -> Android IP Cam Viewer as the device
- Droidcam over the WIFI – same same
With some tinkering you should be able to get access to the camera locally and over the Internet. If you want only local access, then obviously skip the steps where you front-end the webcam w/ stunnel and poke holes in your router’s firewall.