Installing MotionEye on a Linksys WRT3200ACM With OpenWrt

by bass_head in Circuits > Linux

5076 Views, 5 Favorites, 0 Comments

Installing MotionEye on a Linksys WRT3200ACM With OpenWrt

Linksys WRT3200ACM.png
openwrt_lede.png
motioneye-256x256.png

Needing a security camera system for my house I visited the inter-webs for an open source option. This led me to the Motioneye's web frontend to the Motion daemon for linux. This project by Calin Crisan (MotionEye) is just what the doctored ordered. It has advanced feature and is easy to setup and use.

Next setting out to find a suitable platform to run MotionEye's on it's wiki states you can run it on a plethora of Linux OS's so I initially thought, great, I'll use my PI. At the same time I just bought a Linksys WRT3200ACM router for which I installed OpenWrt on it. So while setting up OpenWrt and installing packages, I remembered that there were instructions on the MotionEye's wiki to "Install On Other Distributions". Following the wiki's instructions and with a few modifications, voilĂ , I had Motioneye working right on my Linksys WRT3200ACM router, cool!

This guide will show the steps to install Motioneye's on a Linksys WRT3200ACM router which could possibly work for other routers too.

Getting Started:

ssh.png

I installed everything through command line, you can also use Luci to install packages but will have ssh into the router to finish this guide.

SSH into your router, from a fresh install of OpenWrt it's 192.168.1.1

Copy and paste these commnds below:

ssh root@192.168.1.1


Use Opkg to Install Needed Packages:

update package.png
1-install python.png
3-install motion.png
4-install ffmpeg.png
5-install v4l-utils.png
6-install python-pip.png
7-install python-dev.png
8-install python-curl.png
9-install pillow.png
4-install nano.png

These are the minimum number of packages requied to run MotionEye.

Copy and paste these commnds below:

opkg update

opkg install python

opkg install curl

opkg install motion

opkg install ffmpeg

opkg install v4l-utils

opkg install python-pip

opkg install python-dev

opkg install python-curl

opkg install pillow

# optional for this tutorial

opkg install nano

Upgrade 'setuptools' and Install Motioneye:

10-install setuptools.png
11-install motioneye.png

MotionEye's is written in python, use PIP to download and install it.

Copy and paste these commnds below:

pip install --upgrade setuptools

pip install motioneye

Create the Configuration Directory and Copy the Sample Configuration to It:

12-config motioneye.png

Here we have to create a directory to store a copy of the sample configuration file.

Copy and paste these commnds below:

mkdir -p /etc/motioneye

cp /usr/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf

Create the Media Directory:

12.1-nano motioneye_conf.png

To store any meaniful amount of media files you will have to connect to the router some type storage. The default directory MotionEye uses is provided below but remember this router has limited amount of space.

The command below will be fine for just to see if it is working but change it to an external storage directory if you plan to save any media files. MotionEye's media directory can be changed in the web interface after testing.

Copy and paste these commnds below:

mkdir -p /var/lib/motioneye


# If this default media directory is not going to be used the change must be updated in /etc/motioneye/motioneye.conf.

# Using nano, open /etc/motioneye/motioneye.conf

# Find 'media_path' entry and change the path to your external storage. This is shown in the picture above.

Start the MotionEye Server:

start server.png

Here is the start up command for MotionEye. The -b parameter makes MotionEye run in the background and what will be needed to have it start up at boot. If you want to debug, remove the -b parameter and use -d.

Copy and paste these commnds below:

meyectl startserver -c /etc/motioneye/motioneye.conf -b

You can add this command to the startup items in Luci to start at boot.

Open MotionEye Website:

13-motioneye web password.png

Now that MotionEye is installed and running in your browser goto address: 192.168.1.1:8765

Thats it!!!

Now use the MotionEye tutorial to configure it!