Tuesday, February 21, 2012

Motion Tracking on a wireless router (OpenWRT)

Setup: TP LINK WR703N (installed OpenWRT), a USB camera (UVC compatible)

The WR703N comes with a USB host, so let's connect a USB camera to it. Usually a modern usb camera should work without problem, let's telnet to the router (e.g. telnet

opkg update
opkg install kmode-video-core kmod-video-uvc 

Once the kmod-video-uvc is installed, you can now attach the USB camera to the router, and then you will find a device file appears: /dev/video0

That's mean the camera should ready to go.

so let's install the motion package:
opkg install motion

The WR703N doesn't have enough flash memory, so I copy the motion configuration file to /tmp (RAM), and then you have to edit the motion.conf:

change stream_localhost on to off
change locate_motion_mode off  to on

run it:
motion -c /tmp/motion.conf

View it:

Open a browser with the URL:

Demo Video:


Anonymous said...

Have you tested how big framerate tp-link can handle? and with what picture resolution?

Bitartist said...

I cannot remember the resolution, but it should be 640x480 or 320x240.

I did record the frame rate, but I can tell you that it is very slow, it is at most 5fps.

Janis Alnis said...

Very impressive result.
What Philips cam model are you using?

I tried Logitech C270 and pictures are cut in rectangular pieces. Impossible with that cam.

I am trying to collect things about WR703N:

Janis Alnis said...

is it POhilips webcam pro
Have you tested with other newer models

Bitartist said...

the openWRT kernel is using UVC driver, so any camera can work with UVC driver would work.

You can just grep a Linux box, and test your camera with UVC driver, if it works, i think the openwrt would just work also

PD said...

Hello, is it possible to watch stream from webcam when motion detection is activated? If Yes, on which URL address? Thank you.