The £20 DIY Security Camera: How to Bypass Subscriptions and Take Full Control

 

How Build a home security system for under £20

Home security systems can be complicated things. If you want to, you can invest in proximity and movement sensors, contacts that detect when doors or windows have been opened and multiple cameras all managed from a central hub.

Not everyone needs a full-scale surveillance system like that, however. Even a single camera can give you a huge boost in protection; while it may not cover every entry point, if you pick the right location it can watch over your most valuable possessions and alert you to any unexpected movement.

The best part is that good cameras can be very cheap, costing – as you might have guessed from our headline – less than £20 apiece. With most models that price even includes easy-to-use surveillance software, but this won’t necessarily let you get the best from your camera: it may lock you into the manufacturer’s cloud storage platform, or insist on saving to an onboard SD card, which is only accessible through the app itself. That’s not ideal if you want full flexibility to manage and review your footage. Luckily, there’s another option.

Provided that your chosen camera supports the industry-standard real-time streaming protocol (RTSP), you can access the feed using third-party streaming software and devices to view the footage on a TV screen, record it over the network and add more cameras over time, to progressively beef up your home security.

Choosing your camera

For our purposes this month we’ll use a TP-Link Tapo C110 camera. This is a great choice for low-cost home security projects, as it has a decent three-megapixel resolution with a wide field of vision, automatic night-sight and integrated Wi-Fi – and you can pick one up on Amazon for just £18. There are, however, plenty of alternatives from many other manufacturers, offering features such as higher resolutions, weatherproof housings and motorised pan, tilt and zoom controls.

Whichever camera type you’re interested in, we’d recommend you choose one with a hard-wired power supply, rather than a battery-powered unit. Battery-only devices can run for weeks or months if they only “wake up” when movement is detected, but if you’re buying a camera for security purposes you don’t want to risk it running out of juice at the wrong time.

The other important thing is to ensure that your chosen camera supports RTSP. This standard was jointly developed by Netscape, RealNetworks (the name behind the RealPlayer media player) and Columbia University back in 1996, and it’s still in use today for controlling streaming media servers of all types. Using RTSP, you can stream your camera footage directly to any device on your home network – and record it too, as we’ll see below.

Most importantly, choosing an RTSP-compliant camera means you’re not locked into platform-specific services or subscriptions. The trade-off is that enabling RTSP often means disabling other native features. Our Tapo C110 camera can upload footage to TP-Link’s cloud storage and record video to a locally installed microSD card, but you can’t have both of these features enabled and use RTSP at the same time.

Set up the camera

If you’re using the same Tapo camera that we’ve chosen, start by installing the Tapo app on your phone – you can get it free from the Apple App Store or Google Play. Once the app is up and running, tap the “+” icon at the top of the screen, followed by Add Device. Tap Indoor Cameras, then Tapo C110.

Now plug in the camera and wait until the LED beneath the lens starts to flash red and green; this may take up to 30 seconds. When it does, return to the app and tap “Already Red and Green”. Now switch to the Android or iPhone settings and open the Wi-Fi controls. Look for a network with a name that starts Tapo_Cam_ and join it. As you can see on the right, our camera is named Tapo_Cam_A0F2.

You’ll know when the camera has connected to your network, as it will say “Wi-Fi connected” out loud. You can then give the camera a meaningful name, specify the room in which you’re using it, and give it an icon.

If you want to save footage to a microSD card as well as streaming it over your local network, insert the card now. TP-Link recommends Class 10 or higher cards with between 8GB and 512GB of storage. To ensure you don’t hit compatibility problems, initialise the card in the app, rather than formatting it on your computer.

Enabling RTSP

You can now check that the camera is up and running by tapping its name in the Tapo app; after some orientation alerts you’ll see a live view of its output. To allow external devices and apps to access this same live stream, you’ll need to set up a username and password that those devices can use to connect to the camera.

To do this, tap the nut icon at the top of the screen to open the camera’s settings, then tap Advanced Settings followed by Camera Account. The app explains what you’re about to do and, on the following screen, warns you about the associated risks. If you’re happy to proceed, tap “Understand and Agree”, then set your credentials.
For security, these should be different to the username and password you use to access the Tapo app or other accounts. Remember what you set, as you’ll need to enter it later.

You’ve now done all you need to do to view your camera’s output via RTSP – so long as you know where to find it on your local network. You can find the camera’s IP address by going into your router’s management interface and browsing the attached devices. If you’re using the Tapo camera, you’ll see its address alongside the name “C110”.

You can use this address to view the stream over your home network – but note that, as your network will probably be using DHCP, this address might change over time, which could cause problems. It’s a good idea therefore to “reserve” this IP address in your router’s settings, to ensure that it’s always assigned to the same device. You can also set a static IP address in the Tapo app; to do this, open the camera’s settings in the Tapo app and tap Advanced Settings. Now tap Network Settings and tap the switch beside Static IP. Leave all other settings as they are and tap Save.

It’s essential that you close the Tapo app at this point – if it’s still communicating with the camera in the background, you may not be able to open the RTSP stream in any other application.

View the stream remotely

At last it’s time to test the remote stream. There are dozens of apps that can display RTSP video, but we’ve chosen VLC as it’s freely available for Windows, macOS and Linux. If you don’t have this app, install it from videolan.org/vlc, launch it and press Ctrl+N to open a new network stream.
Then enter the following address: rtsp://IP_address:554/stream2R eplace the IP address with the address of your camera on your local network, but keep the port number at the end (:554) – this is the standard connection method for RTSP stream.

The Tapo supports three stream types, with stream1 offering the highest quality and stream3 using the least bandwidth. We’ve chosen stream2 as a good compromise for home security.

When VLC asks for your credentials, enter the username and password that you set for the camera account, not the details you use for your Tapo account. The player may now take a few seconds to open the video stream, after which it will start to play. You’ll also hear any audio picked up by the camera’s microphone, but note that this is a one-way stream. Although the Tapo camera does have a small integrated loudspeaker, the RTSP connection doesn’t allow you to talk back to anyone who happens to be on the opposite end of the link.

Embed your feed in a web page

If you don’t want to keep running VLC and entering your credentials to view the camera stream, you can embed it in a web page. Although most browsers can’t natively handle RTSP streams, you can get around this using a free, open-source technology called WebRTC (short for Web Real-Time Communication).

The only slight catch with WebRTC is that it’s not a native extension or Windows app; it requires a little manual setup and configuration. A neat way to get it running is to use a Docker container, so that all of WebRTC’s associated files and settings are kept in one place, and we’re not scattering files across our Windows drive, or adding to the Registry. It also means that if we want to add further cameras, we can just create additional containers.

In Windows, you can install Docker directly from the Microsoft Store. When it’s finished installing, reboot your system and allow Windows to install or update the Windows Subsystem for Linux (WSL), which Docker requires. This may take some time. Once Docker is up and running, wait a few seconds more until the status line at the bottom of the Docker sidebar says “Engine running”.

Now launch PowerShell from the Windows menu and type the following as a single line, replacing the variables in square brackets with your own settings. Replace “username” and “password” with the camera username and password that you set in the Tapo app:

docker run --name webrtc -p 8000:8000 -e RUN_ARGS="-u rtsp://username:password@IP_address:554/stream2" --restart unless-stopped -d mpromonet/webrtc-streamer

PowerShell may warn you that mpromonet/webrtc-streamer isn’t installed locally, but don’t worry: it will download and install all of the necessary components for you.

When it’s completed, you’ll see a new container in the Docker dashboard. This is where the streaming service lives. You can now view the video feed in a web browser, via WebRTC. To do so, just open a new browser window and point it at: 

http://localhost:8000/webrtcstreamer.html?video=rtsp://username:password@IP_address:554/stream2

Again, swap the username, password and IP_address for the credentials that apply to your setup, but leave the port (:554) and the local address (localhost:8000) unchanged. When the page loads, you should immediately see the stream from your camera.

Beyond your PC

You can access the stream from other computers on your local network by swapping “localhost” in the address above for the IP address of the computer managing the stream within Docker. You can find this by opening a command prompt and entering “ipconfig”; this command lists all the addresses associated with your computer’s active wired and wireless network connections.

Look for the entry beside IPv4 Address: in the screenshot on the right, that’s 192.168.0.210. This is what we need to use in place of “localhost” in the address given above to display the stream on another computer on our local network.

Being able to view the stream on your local network is great if you want to see whether it’s worth getting up to answer the front door, but less useful if you’re out and about. To monitor the feed from beyond your network, you’ll need to set up port forwarding to send any incoming connections to the PC managing your stream, or to the camera itself.

The process for doing this depends on your router, so you’ll need to check the documentation; the key is that you need to redirect incoming http/https requests to the PC running Docker, which will need to stay switched on and awake around the clock. Again, it’s a good idea to give it a static IP address, as if an automatically assigned address changes you won’t be able to look it up remotely.

 

Recording footage

Watching footage is one thing, but unless you’re peering at the screen around the clock you’re unlikely to be watching at precisely the moment something notable happens. Recording the feed lets you review any suspicious incidents – and means you have a copy of the evidence.

If you have a NAS appliance, it may have built-in capabilities to record the stream from your camera. Synology’s Surveillance Station software (tinyurl.com/374synnas) supports close to 9,000 IP camera models and other devices, enables mobile access, and can trigger real-time alerts if unexpected movement is detected. QNAP offers its QVR Client Pro (tinyurl.com/374qnapnas) for its own NAS devices, as well as for Windows and macOS.

Otherwise, you can use local software running on a spare PC. Security Eye for Windows (tinyurl.com/374seceye) is a free tool that lets you set up recording schedules, and can alert you via email or SMS when it detects motion. iSpy (ispyconnect.com) is another option with very low system requirements – just 2GB of RAM and 200GB of free drive space should be enough to host up to four cameras at fairly low resolution.

Finally, if you have a spare Raspberry Pi, you can easily install motionEye (tinyurl.com/374motioneye) through DietPi (dietpi.com). As well as supporting standard IP cameras such as our Tap model, it claims compatibility with most USB cameras, and can upload media directly to Google Drive and Dropbox, giving you a safe off-site repository for captured footage.

 

Post a Comment

Previous Post Next Post