Capturing stills from Android mobilewebcam app on Debian server

The next mini project for my Debian server was to display a still image from a remote webcam, i.e. one that was not connected to my home network. To further complicate matters I wanted to show a picture from our allotment. This meant coming up with a solution that provided power and network connectivity in a place that had neither.

allotment shed

allotment shed

My first thoughts were to use my Raspberry Pi and connect it to a solar charged battery system and install a 3G card for data access. After researching solar powered systems that would work completely autonomously for a substantial length of time I concluded that this would prove prohibitively expensive for what was, after all, just a temporary home project. Therefore, I didn’t pursue 3G card connectivity on the Raspberry Pi.

Non-solar powered Raspberry Pi

Non-solar powered Raspberry Pi

So, having another Android smartphone lying around, I decided to have a look at using that. Low powered smartphones are almost perfect for these type of projects as they provide a webcam, data connectivity and have their own power (albeit for a limited amount of time).

I installed a pay as you go sim card in a Sony Xperia Tipo (ST21i) on the Three network as the data tariff is only 1p per MB. I only wanted a still image rather than a constant stream so I thought this would not prove too expensive.

Sony Xperia Tipo

Sony Xperia Tipo

The next thing was getting a suitable Android app. I came across mobilewebcam which would take a picture at any specified interval and upload that picture to Dropbox. I tested this at the allotment, had a good mobile signal and got a successful upload.

Power was the next thing and I purchased a cheap Chinese 10000mAh USB battery pack for £8.99 on Ebay. This managed to keep the phone going for about 8 days, enough for testing purposes. The battery pack has a solar panel built in but it will not allow current to be drawn from it while it is charging.

 

10000mAh USB battery pack

10000mAh USB battery pack

Having a way of powering the phone, taking a picture and getting it to Dropbox I then needed to display it on the web page served up by the Debian web server.

I installed Dropbox on the Debian server as detailed here.

In the mobilewebcam app you can specify how to name the images as they are taken, either with a specific filename, which will be overwritten every time a picture is taken, or with a datetime filename, which won’t be overwritten. I went for a filename of current.jpg so that my cronjob could just copy the file into the web directory and the web page would always show the latest image.

*/30 * * * * cp /root/Dropbox/Public/current.jpg /websites/mysite/www/

 

An example is shown below showing the view from the allotment shed.

current.jpg

current.jpg

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s