Raspberry Pi Webcam Server

Raspberry Pi Webcam Server - Raspberry Pi Logo

Raspberry Pi Webcam Server Project

 

The Raspberry Pi is a small, cheap mini-computer that runs Linux.  It’s great for tinkering with, and there are many projects online to try.  In this project, I have used Linux ‘motion’ software to setup the device as a Raspberry Pi Webcam Server.

Raspberry Pi Webcam Server - Raspberry Pi

 

Project Definition

The Raspberry Pi Webcam Server will need to monitor and detect movement and will initially be set to record .AVI video files to its 16GB SD Card.  This folder will be open to the network for easy viewing, transferring & deleting of the recorded video files.

Logitech_c615_general_view_4_1In a future revision, the Raspberry Pi Webcam Server will be modified to save directly to either an attached USB hard drive or another networked PC share folder.

The video footage will also be streamed live to my local network and available through the browser on any device.

 

Ingredients

To complete this project I used:

  1. A Raspberry Pi
  2. A SanDisk Ultra 16 GB Class 10 SD Card
  3. A Logitech C615 HD webcam
  4. An externally powered 4 port USB hub
  5. A Logitech MK320 Wireless keyboard & mouse

 

Raspberry Pi Webcam Server Project - SD Card

Booting the Raspberry Pi Webcam Server

I chose to prepare the SD card using a Windows PC.  This involved downloading an SD card image from the Raspberry Pi website for free.

To place the image on to the SD card, I used Win32DiskImager for Windows.

Once completed, I inserted the SD Card into the Raspberry Pi and connected the externally-powered USB hub, Keyboard adapter and LAN cable, then I turned on the Raspberry Pi.

 

Setting up the Raspberry Pi Webcam Server

The standard Login and password for the system is username: pi and the password: raspberry

After logging into the Raspberry Pi, the first step was to configure the Raspberry Pi using the Raspi-Config tool.  I expanded the Root FileSystem, set the correct Time Zone and Locale, Enabled SSH, and set the device to Boot to Desktop option.

Tip: The Raspberry Pi can be reconfigured by running the following command from a terminal window:

sudo raspi-config

I also experimented with overclocking the Raspberry Pi and settled on the medium overclocking choice of 900MHz.

 

Now that the Raspberry Pi boots to the desktop, the next step was to ensure the Raspberry Pi operating system is up to date, using:

sudo apt-get update
sudo apt-get upgrade

I then downloaded and installed motion and ffmpeg

sudo apt-get install motion ffmpeg

and installed samba

sudo apt-get install samba samba-common-bin

 

I created a folder on the Raspberry Pi SD Card where motion will save the .AVI videos to.

sudo mkdir /home/pi/motion

sudo chmod 777 /home/pi/motion

I then edited the Samba configuration file to add the motion folder as a Network Share.

sudo nano /etc/samba/smb.conf

After entering the correct network details near the top of the Samba configuration file:

workgroup = MyNetwork

wins support = YES

I then added the following text to the bottom of the Samba configuration file.

[motion]

 comment=RaspberryPi Motion Share

 path=/home/pi/motion

 browseable = yes

 writeable = yes

 guest ok = yes

 

A quick check from another PC on the network confirms the folder is now visible.

Raspberry Pi Webcam Server - Network Share

 

Configuring the Raspberry Webcam Server

Now the Raspberry Pi is ready for me to setup the Motion configuration file:

sudo nano /etc/motion/motion.conf

I set the following items

daemon on

framerate 2

output_normal off

ffmpeg_cap_new on

ffmpeg_video_codec mpeg4

target_dir /home/pi/motion

webcam_port 8081

webcam_quality 90 

webcam_localhost off

control_port 8080

control_localhost off

Here’s a copy of my completed motion.conf

The full list of Motion Configuration Options are listed here:

http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions

 

Next, I enabled the motion daemon by editing this configuration file:

sudo nano /etc/default/motion

and I changed start_motion_daemon=NO  to

start_motion_daemon=yes

 

Now start the Motion server service:

sudo service motion start

 

To restart the motion software following changes:

sudo /etc/init.d/motion restart

 

Rather than using a WiFi adapter, I have chosen to use an existing Netcomm NP-204 Broadband Over Powerline adapter, which will provide power and LAN cable internet connection to the Raspberry Pi.

 

Netcomm

 

I had already set my Network Router to provide the Raspberry Pi with a static IP address of 192.168.1.20 for previous projects.  The picture below shows that Address Reservation in the Router Configuration webpage.

 

Raspberry Pi Webcam Server - Router Addresses

 

Now any network connected device, including PCs, Tablets and Smart Phones can now browse to 192.168.1.20:8081 to view the live stream of images from the Webcam.

To remotely configure the motion server, I browse to 192.168.1.20:8081.  The image below is a screenshot taken on a Samsung Galaxy running Firefox for Android.

 

Raspberry Pi Webcam Server - Android Feed

The Raspberry Pi Webcam Server project is now complete.

Raspberry Pi Webcam Server - Setup

Overheating PC tips

Overheating PC - Hot LaptopIn this hot weather we know to keep ourselves, our children and our pets cool, but its also a good time to check on your PC’s health – perhaps its an overheating pc

 

Computers will shutdown when they are too hot, in an attempt to protect themselves from excessive heat damage, but permanent damage can still occur.

 

How do you check the PC’s temperatures ?

The majority of PC’s show their temperatures in the BIOS screen, but this requires a reboot to access it.  It’s much easier to view the PC’s temperatures by downloading and installing SpeedFan v4.49, a FREE tool available from the Tailormade IT Solutions website:

http://www.tailormadeitsolutions.com.au/tools/SpeedFan-v449-Installer.exe

“SpeedFan is a program that monitors voltages, fan speeds and temperatures in computers with hardware monitor chips.”  Source: http://www.almico.com/speedfan.php

 

If you do notice high temperatures, or are experiencing strange shutdowns and outages, this can result in permanent damage to your PC, and reduce its life span.

Overheating PC - Adding Thermal Paste to the CPU

Thermal Paste being applied to a CPU

 

Tailormade IT Solutions recommends and provides PC maintenance services that investigate and resolve overheating PC issues, including:

Dust Removal Dust is a great insulator, and cleaning out that build up of dust inside the PC will help it breathe better and run cooler.

Fan ChecksEnsuring your internal PC fans are not damaged, and are working correctly and effectively removing heat from the PC.

CPU Thermal PasteThe PC’s brain, or CPU, generates a lot of heat.  Checking and reapplying the Thermal Paste on the CPU can assist heat removal from this important component.

Additional CoolingInstalling upgraded or additional heatsinks and fans, including water cooling for extreme desktop PCs.  Laptop owners can also purchase laptop cooler pads.

 

 

Please note that the following method of cooling your PC is NOT recommended.

Overheating PC - How NOT to cool your PC

 

Overheating PC - Tailormade IT Solutions

Surfing Safe on the Road

Surfing Safe on the Road

Explore more infographics like this one on the web’s largest information design community – Visually.

Backup

Backup Routines

 

BitTorrent Labs has just released a new tool called BitTorrent Sync, which is used to sync files/folders from one PC directly to another.  It works differently to cloud based products like Dropbox, Google Drive, and Microsoft Skydrive.

With a variety of backup options now available, its surprising that many users don’t consider backing up important data until its too late.

In this post, Tailormade IT Solutions discusses backup options and some of their pros and cons, including their ease of use, safety, security and suitability.

 

Tailormade IT Solutions can configure a backup routine that ensures your data is safe.

 

Copy Files Locally

I’ve met users who simply plug in a USB drive and copy data from their computer manually.  For example, copying the My Documents folder to a USB drive, CD or DVD.Backup to USB stick

Pros:

  • Simple.

Cons:

  • User has to remember to backup regularly;
  • backup data is held on-site and susceptible to physical loss.

 

Automated Backup – Locally

The next step would be an automated backup solution.  Data is a lot safer if the backup routine is automated and regular.  These backup routines typically work at a certain time, and copy information to a USB drive.  Users should disconnect the backup drive when not in use.

Pros:

  • Set and forget peace of mind.

Cons:

  • Data held on-site.

 

Automated Backup/Sync over Network

If you have multiple computers, your can set one aside as a backup PC, and configure all other computers to backup at a certain time to that location.  This can work locally or through the internet, using the new BitTorrent Sync tool.

BitTorrent Sync Logo

Pros:

  • Set and forget peace of mind.

Cons:

  • Data held on-site.

 

Automated Backup/Sync to Cloud

Using cloud storage providers (such as DropBox, SkyDrive or Google Drive) to syncing folders has become very popular.  These services allow you to automatically sync a folder from your computer to a internet server.  With your login details, the server can be accessed from any computer in the world.

Cloud storage providers offer varying levels of service and security, but they also retain ownership of your data in the fine print, and  commonly limit the sizes of files you can upload, and/or total server size.

Pros:Backup - Cloud Storage providers

  • Data is held off site, and accessible from anywhere in the world.

Cons:

  • Data held by cloud providers is owned by cloud providers.

 

 

 

If you need an IT professional to configure a backup routine for you, contact Tailormade IT Solutions

TPB AFK

TPB AFK logo

 

On 8th February 2013, a new documentary was released directed by Simon Klose.  The documentary “TPB AFK – The Pirate Bay Away From Keyboard” is based on the lives of the three founders of The Pirate Bay – Peter Sunde, Fredrik Neij and Gottfrid Svartholm.

Of course, The Pirate Bay is one of the best known file-sharing brands and the site has a well-earned place in Internet history.  Swedish filmmaker Simon Klose has documented part of their struggle as they are targeted by several court cases over the years.

What not many people know is that the three founders of The Pirate Bay often pretended to get along in public, but had some big fallouts in private. This becomes quite apparent in the documentary.

TPB-AFK is the first film to premiere both online and at a major film festival, and can be downloaded and shared for free.  The full film is released under a Creative Commons license onto The Pirate Bay and other BitTorrent sites.  3 versions of this documentary are legally available for download from the Pirate Bay website.

The film runs for 122 mins.

YouTube Link: http://www.youtube.com/watch?v=eTOKXCEwo_8

Torrent Link: https://oldpiratebay.org/torrent/6243351/TPB-AFK-2013-720p-h264-SimonKlose

Here is the trailer for the documentary, called TPB AFK.

TIS Logo

Raspberry Pi Media Centre

R-Pi Logo

After a long wait for delivery, I finally received my Raspberry Pi just before Christmas.  Although the Raspberry Pi is being used for all sorts of interesting projects, my first project is to set the Raspberry Pi up as a networked media centre pc, with remote control from a smart phone.  This will essentially turn an old, dumb TV into a smart TV.

Raspberry Pi

Existing Media Server 

I already have a Windows 8 Media Centre PC, connected to a 42″ Kogan TV, which handles Live TV and recording, plus storage of movies, TV and music files.  Live TV signals are handled using a Winfast DTV200DS dual digital TV tuner.

XBMC Screen

This Windows 8 PC runs XBMC 11 (Eden) with PVR support, and is called AMD-XBMC.  It has a static IP address of 192.168.1.3

I setup AMD-XBMC to allow remote control using port 9999.

Installed MediaPortal TV Server to stream Live TV to other instances of XBMC.

 

Raspberry Pi

SanDisk Ultra 16GB SD CardThe Raspberry Pi comes with 2x USB ports, which will be populated with a TP-Link WN821N 300M Wireless adapter, a Logitech MK320 Wireless KB/Mouse dongle.

Using the Windows 8 PC, I downloaded and installed Raspbmc on to a 16GB Class 10 SD Card.  Although a little more expensive, a Class 10 SD Card is designed for HD Video use.

 

Raspbmc Logo

After installing Raspbmc, I inserted the SD Card into the Raspberry Pi and booted it.  After the normal Raspbmc setup procedure, XBMC started and I renamed this instance of XBMC to Pi-XBMC.

I assigned a static IP address to the Pi-XBMC of 192.168.1.4 using the Router administration page, and setup network details inside XBMC.

I purchased licence keys for MPG and WMV codecs from Raspberry Pi store, which cost AU$4.85.  I input the codec details into the Raspbmc settings inside XBMC, which updates the Raspberry Pi’s config.txt file.

I setup Pi-XBMC to allow remote control using port 9999.

 

Toshiba L650 Laptop

I also have a Toshiba L650 Laptop running Ubuntu 12.04 which will be used to display media at times.

xbmc logo

I downloaded and installed XBMC (Frodo) and named this instance of XBMC as Toshy-XBMC.

I assigned a static IP address to the Toshy-XBMC of 192.168.1.5 using the Router administration page.

I setup Toshy-XBMC to allow remote control using port 9999.

 

Samsung Galaxy S2XBMC Remote

I am controlling the XBMC using a Samsung Galaxy S2, running the Official XBMC Remote app for Android.

XBMC Remote logo

Within the XBMC Remote app, I setup AMD-XBMC on 192.168.1.3, the Pi-XBMC on 192.168.1.4, and the TOSHY-XBMC on 192.168.1.5 – with all 3 using port 9999.

I note that the XBMC Remote app is still in Beta form and therefore has a few error messages popping up on screen from time to time, but remote control functionality is perfect.

 

Currently streaming media from AMD-XBMC to Pi-XBMC, using the smart phone as a remote control.

[Project in progress – updates to come]

 

Cheaper Printing

Canon MX410

Canon Pixma MX410

New inkjet printers are very affordable, and include scanners and fax machines – but the cost of replacement ink cartridges soon ads up.

Canon Ink Combo

The Canon Pixma MX410 printer shown above normally uses Canon PG510 (Black) and CL511 (Colour) ink cartridges, available in a combo pack for $51.99 at OfficeWorks.

These cartridges contain just 9ml of precious ink, and have a page yield of 200-250 pages (approx), which is why they run out so often.

 

Looking for a cheaper option ?? 

I purchased a Rihac Constant Ink Supply Solution (CISS) for $115 which includes a 100ml refillable ink tank (pre-filled with High Grade UV Dye ink) which allows for countless refills.

Rihac CISS

Although a little fiddly to install initially, the system is mess free and the tank can be eventually be topped up using 100ml bottles of ink.

The savings speak for themselves.

According to Rihac, this system saves up to 90-95% on your printing costs!  “*Equivalent to approximately 60 standard cartridges. Epson cartridges have approximately 10 mls of usable ink inside. Our CISS allows you to print continuously. Epson cartridges are approximately $23.52 each (officeworks). Our CISS is pre-filled with 100mls of each coloured ink, so in dollar terms that is approximately $1,400.00 worth of cartridges if bought separately.”

 

Rihac CISS - OutsideRihac CISS - Inside

Click on the pictures above to see the Rihac CISS installed.

 

The Rihac CISS works with a range of Brother, Canon, Epson & HP printers.  If you are looking for cheaper printing, I recommend using a Rihac Continuous Ink Supply Solution.

To see if your printer can use a Rihac CISS, visit: http://www.rihac.com.au/inklink8482-ciss-units-c-26.html

Checking remote control batteries

Quick Tip: If you need to check the batteries on your remote control, you can do it easily with a smar phone camera.

Many households have 5 or 6 remote controls lying around the house. Sometimes, they stop working and you don’t know what happened.

Most remote controls use infrared light to transmit the signal. The human eye cannot see this light, however a camera can.

 

Remote Control Check

 

Simply open your smartphone camera and point it at the business end of the remote control.  Press a few buttons on the remote and you should see a light emitting from the remote control.

If you fail to see a light emitting from the remote, then swap the batteries and repeat the test.

 

Remote Control Checker

Human eyes can’t see infra-red colour, but our phone cameras can.

Disabling Browser Autocomplete

Browser Autocomplete is a feature in most modern web browsers.  It’s a handy feature which saves time by storing passwords for later use.

 

Firefox Browser Autocomplete

 Firefox Browser Autocomplete

In this short example, I’ll use Internet Explorer to log into a Google account.  As you can see, Internet Explorer asks if I want it to remember this password.

Should I remember this password ?

Internet Explorer Browser Autocomplete

 

While this feature can be handy, it does present a security issue as a freely available hackers tool will mine these stored passwords and display them.

 

Hacker tool mines stored passwords

Hacker tool displays stored passwords

 

Disabling Browser Autocomplete is a simple process, which is shown below.

 

Turning off the Auto-Complete feature:

The Internet Explorer Auto-Complete feature can be disabled by following these steps.

  1. Open Microsoft Internet Explorer.
  2. Click Tools and then Internet Options.
  3. In the Internet Options window click the Content tab.
  4. Click the Auto-Complete Settings button.
  5. Uncheck the option User names and passwords on forms.

The Firefox Auto-Complete feature can be disabled by following these steps.

  1. Open Mozilla Firefox.
  2.  Click Firefox/Tools and then Options.
  3.  In the Firefox Options window click the Security tab.
  4. Click Saved passwords to view and clear history.
  5.  Uncheck the Remember passwords for sites option.

 

 

Avoiding dodgy emails

Avoiding dodgy emails

Phishing is an attack used by hackers to gain access to private information such as credit card numbers and user passwords.

Phishing is a social engineering attack where targets are typically duped into providing this information directly to false versions of legitimate websites run by the hackers. Personal information can then be used for fraudulent purchases, resale to third parties and even identity theft.

 

Pictured is a screenshot from a phishing email I recently received from a client who was suspicious.



 

What would the natural reaction from an account holder be?

“I never sent Nickolas Sims $498 – I’d better click the link and put a stop to this” Of course that sense of emergency may mean you get flustered and click the link and fall for the fake PayPal site. Enter your details and the bad guys have it.

 

So let’s have a look at the warning signs:

Incorrect recipient address information

The email is addressed to multiple recipients, as if this payment was made by you AND all your friends (I’ve obscured the email addresses for privacy)

Impersonal greeting

The email says “Dear PayPal Customer” – Phishing scams rarely know the real names of its targets and tend to rely on general greetings like Dear user. PayPal know your name and use it when emailing you.

Convoluted hyperlink

Hyperlinks in email messages should be distrusted in general, but long and convoluted hyperlinks like the one below should cause heightened suspicion.

Normally PayPal resides at the URL PayPal.com. If you hover over one of the links (as shown below) you will notice the link actually goes to a website in .com.ar – that’s Argentina.

No offer of additional information

There is a “Help Centre” link but that link goes to the same website address based in Argentina. In fact ALL links go to exactly the same address!

Warnings from email client

A well-designed email client may detect many of the irregularities listed as well as check for suspicious points of origin (e.g. spoofed emails) and links to insecure servers.

Warnings from web browser

If for some reason you actually clicked on the URL, your web browser might give another warning, alerting you that the URL has already been reported as a forgery, or is not secure.

 

Summary

Most phishing email messages wont contain all of the above characteristics and probably will contain other defining characteristics not mentioned. Phishing is an evolving practice due to its lucrativeness and increased usage by organized crime.

If you receive an email that contains one of the above characteristics then be extremely cautious. If the email is threatening the termination of a service, simply let it happen. No company worth doing business with is going to maintain its records by firing off thousands of email messages to various Hotmail and Yahoo accounts in hopes of reconciling its financials.

How can I protect myself from a phishing attack?

 

There are several steps you can take to protect your computer from today’s cyber threats. Following the simple guidelines below will help minimise the risk of attack.

 

  • Be very wary of any email messages asking for personal information. It’s highly unlikely that your bank will request such information by email. If in doubt, call them to check!
  • Don’t complete a form in an email message asking for personal information. Only enter such information using a secure website. Check that the URL starts with ‘https://’, rather than just ‘http://’. Look for the lock symbol on the lower right-hand corner of the web browser and double-click it to check the validity of the digital certificate. Or, alternatively, use the telephone to conduct your banking and report anything suspicious to your bank immediately.
  • Don’t use links in an email message to load a web page. Instead, type the URL into your web browser.
  • Check if your anti-virus program blocks phishing sites, or consider installing Kaspersky Internet Security (links below) or other antivirus software that alerts you to known phishing attacks.
  • Check your bank accounts regularly (including debit and credit cards, bank statements, etc.), to make sure that listed transactions are legitimate.
  • Make sure that you use the latest version of your web browser and that any security patches have been applied.

 

Protect your identity from phishing attacks

Prevent cybercriminals from stealing your digital identity thanks to anti-phishing protection technologies inside Kaspersky Lab’s Internet security software which leverage lists of known phishing websites, proactive anti-phishing technologies and the latest information from the cloud.

PC


Kaspersky Internet Security 2012

MAC


Kaspersky Anti-Virus 2011 for Mac

MOBILE


Kaspersky Mobile Security 9