Turning old mini-routers into useful remote cameras


I’ve had a few of these tp-link TL-WR703N, little blue boxes laying around for some time now. I used quite a few in a previous gig sometime ago where they proved quite useful. Since then, I’ve not had a lot of use for them. They languished for some time in the future projects box, until now!

As part of a bigger project, I need some remote cameras. From my 3D Scanning dome project I also had a bunch of Logitech c910 cameras and so I wondered, would it be possible to create a remote webcam using the tp-link and the c910s? Something I could just plug into the mains and it would work, over wifi, with no further user intervention? Turns out it is indeed possible though it requires a small amount of faff.

Some might think this is a silly project, but I’ve a few good reasons for giving this a go, which I’ll talk about at the end. I’m glad I started and finished this project and I hope that it might be useful for some folks.

Building the right OpenWRT

I use OpenWRT on most of my projects. At one point this project branched off into something called LEDE but is now back to OpenWRT again. One of the older versions still support the TL-WR703N so I figured this was the place to start. OpenWRT has a lot of cool features, software and documentation through it’s wiki. It’s an excellent resource for these wanting to mess with their network hardware, and their page on the WR703N is excellent.

The biggest problem is the amount of memory these things contain. They have 4MB of flash memory and 32M of RAM, so not an awful lot! This means that we need to cut down on some of the packages included in OpenWRT by default. With some space freed up, we can install the bits we need for the webcam, perform setup over SSH and we shoud be done.

Version 17.01.07 is the version of OpenWRT you can use with this box. You can download it from http://downloads.openwrt.org/releases/17.01.7/targets/ar71xx/generic/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64.tar.xz. Once you’ve decompressed the archive, I ran the following command:

It’s worth breaking this down a little. I’m removing all the web-based configuration packages — called Luci — along with the lua scripting language and andy themes, plus support for ipv6 (as I doubt I can make use of that yet). This should free up a bit of space.

The packages I need for the webcam include kmod-video-uvc, motion and mjpg-streamer. Motion probably isn’t essentially but I’ve used it before and I can be fun!

We should check the size of the resulting image. We can do that with the following command:

The next bit depends on what is already installed on your little tp-link. I had a previous version of OpenWRT installed so I used scp to copy the image to the /tmp directory on the router. It’s important it goes into /tmp as the following command relies on that. If you have another operating system on this router, you can follow whatever image upgrade steps that OS suggests.

The command I used was:

The process so far could be adapted to whatever circumstance you are using the router in. There are quite a few software packages one can install in the base image. In fact, I believe one can customise the kernel and do all sorts of things if one desired. For our purposes though, this should be enough.

Setting up the networking

The next process is to ssh into our router (using root as the username. I believe the password is password or just blank at this point). OpenWRT tends to default to so use an ethernet cable and set your interface accordingly. Wifi isn’t enabled by default, so the next step is to turn it on:

We can then scan for wifi networks, making sure we can see the one we want to use.

Now we should setup the default wifi and all the credentials, by editing /etc/config/wireless

Change the and to these for your network. We now need to make this router visible to the rest of the world over the wifi and setup the ethernet to something a little more useful so it doesn’t interfere with anything else on the network. I’m setting this router to have a static ip on which I write onto the case with a sharpie so I never forget in the future. Some of these routers still have IP addresses I don’t know! Edit /etc/config/network

Finally, we can set a hostname and restart all the things:

Video time

Sometimes, I’ve noticed that the video packages aren’t actually installed. When I try to run mjpg-streamer or motion, the system complains. If that happens, then one can fix it as follows:

Your router needs to be connected to the internet at this point. Hopefully it should be.

We should be ready to run mjpg-streamer and actually see something. Plug in the camera and run the following command:

This runs the program, looking for the first video device, spitting the output to a webserver. Remember that there isn’t a lot of memory available on this device, so saving video or even images is probably not going to work,

You can then open a web-browser and type in the following address:

If these don’t work, use the IP address that the router has picked up from your wifi network. this page has some good advice on using webcams with the WR703N. It’s worth a look.

We should check the firewall at this point too as that might be stopping your connection. We want to allow certain ports to be accessible from the outside world:

We want mjpg-streamer to start with the right options every time we turn on the router. We should start by editing the mjpg-streamer config files. There are two of them:

The options in these files are self-explanatory, though pay attention to the resolution and FPS. I found that 640x480 and 5fps was fairly stable. High resolutions and frame-rates seemed to work for a short time, but the router would then stop responding. Not entirely sure why but there is a lot of data to process and shift and these routers aren’t exactly power-houses.

Finally, run the following command:

This sets up mjpg-streamer to launch at boot. At this point, it should all be working. You can setup port forwards or do something more interesting with the camera, but all that should be needed is a power socket and you are good to go.

Why do this?

There are products on the market that are much easier to setup, probably higher resolution and more reliable. But I place more trust in these little routers I’ve setup. OpenWRT is a pretty good project that I personally trust. I can tell where all the data is going, how secure these cameras are and most importantly, I have complete control over them.

Some of the big problems we face in computing and technology at the moment include who-owns-the-data, security, surveillance culture and e-waste. This project tackles all of these problems head-on. By putting all the pieces together, I’ve saved some tech ending up in landfill. I’ve learned a bit more about OpenWRT and above all, I’ve brought a little more joy into my life.

Recently, I’ve been travelling around the UK a lot, and sometimes, it’s just nice to be able to look at how your back-garden is turning out. Rather than being afraid and angry at all the surveillance cameras around London, this one cheers me up. Proof that we can turn our tech-negatives into positives.

Freelance Research Software Engineer and Bioinformatics Student.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store