Installing MotionEyeOS on a Raspberry Pi Zero W

Published By

If you've ever wanted a security camera system for your home or office, you have many options, features, and capabilities from which to choose. If, however, you want near-total control of how your camera works, and access to a plethora of advanced features, MotionEyeOS for the Raspberry Pi may be just what you're looking for.

MotionEyeOS_IMAGE 2-min 1

MotionEyeOS_IMAGE 3-min 1

While the HDMI and OTG USB adapter aren't strictly necessary, they can be quite helpful. The official Raspberry Pi Zero case includes space for a camera.

MotionEyeOS Setup: Items You'll Need

To use MotionEyeOS, you'll need a Raspberry Pi board with Wi-Fi capabilities (or a Wi-Fi dongle) and a camera. For this build, I chose the Raspberry Pi Zero W because of its low price and compact size, along with a Pi Camera V2.1. For storage, I used a 16 GB SD card, with power provided via a 2.5 amp Micro USB power supply.

I also used a monitor (with a mini HDMI adapter) for troubleshooting purposes. Using a monitor isn't necessary, but it turned out to be very helpful. During setup, the monitor allowed me to see where things weren't booting correctly. If you want to use a webcam without a camera serial interface (CSI) connector―like the official Pi camera―you'll also need an OTG USB adapter.

MotionEyeOS_IMAGE 4-min

To keep all these components together, I used an official Pi Zero case. Happily, this case also accommodates the Pi Camera unit. With the design base complete, I constructed a suction cup and zip tie mount for my Pi and camera, which worked much better than simply setting the case down and hoping it didn't flop out of position. If you want to print your own, here's the suction cup model and STL file you'll need.

Installing MotionEyeOS Software

To install MotionEyeOS, follow these steps:

  1. Download the latest MotionEyeOS software release, listed under Raspberry PI (A, B, A+, B+, Compute Module, Zero, and Zero W models). As of this writing, the newest version was 20190427.
  2. Save the program, then extract the file. I needed an extra software package to handle this compression format and found an app called Easy 7-Zip to perform the extraction.
  3. Using balenaEtcher, burn the disk image to your card, making sure to extract everything in the file first. Do not burn the compressed file; it will not work correctly.
  4. With the disk image burned, open up an advanced text editor like Notepad++ (the stock Windows Notepad does not work properly).
  5. Create a new file in the ~30MB part of the disk that you can still access on Windows called supplicant.conf. This file tells the Pi how your network is set up and will read as follows:

    country=US

    update_config=1

    ctrl_interface=/var/run/wpa_supplicant

    network={
                scan_ssid=1
                ssid="your network's SSID"
                psk="your network's password"
    }

    To be clear, you will need to put quotation marks around "SSID" and "password," as shown in the text above. Also, US indicates that your device is in the United States. This and other country codes are based around the ISO 3166-1 alpha-2 standard, which may be relevant if your Pi will reside elsewhere.

  6. Modify the file to fit your needs, then store it on the setup partition of the disk.
  7. Eject the card safely and pop it into your Pi with the power off.

You'll need to decline any pop-up invitations to format the disk as you set up this small partition.

MotionEyeOS_IMAGE 5

Booting Up MotionEyeOS with Raspberry Pi

Follow these steps to start up MotionEyeOS:

  1. Connect your Pi camera via the CSI connector or plug in a USB webcam using a Micro USB OTG adapter, then apply power. If your setup is correct, the Pi will boot up into MotionEyeOS, and you can use a network scanner like this one to find its IP address.
  2. The device will have a default name, such as MEYE-12345678. Once you find the device name, navigate to the IP address on a web browser connected to the same network. A local website will appear, giving you a nice graphic interface on which to access your camera and settings.
  3. To log in as a user, input user as the username with a blank password, or admin with a blank password as well. If you're setting up the system for the first time, use the admin username.

Even if everything goes smoothly, you'll be waiting for what seems like a long time—a few minutes—for your system to appear on the network. If any problems occur (I initially experienced a few), you might want to set up a computer screen to see where things are going awry. As a bonus, the computer screen will give you the IP address. Instead of scanning around, you can just type it into your computer.

Adding a Camera to MotionEyeOS & More Options

MotionEyeOS_IMAGE 6-min

One camera good, two cameras better.

Once you're booted up, you'll need to tackle two important tasks.

  • If necessary, add a camera or cameras. If you don't have any available, you'll be greeted with a clickable message allowing you to add one.>
  • If you prefer, you can change the admin username and password, along with the surveillance credentials.

MotionEyeOS Static IP: Advanced Settings

  1. Log in as an admin.
  2. Under general settings, toggle Advanced Settings on to expand what you're able to set up.
  3. If you'd like to set up a static IP address (so you don't have to figure out how to find your camera), click on the IP Configuration box to switch it to Manual (Static IP) and type in your preferred address. Try to select an address within a range with relatively low use. You can identify this range by poking around on your scanner.

If you see on the wireless network monitor that, for instance, 192.168.0.2 through 192.168.0.15 are used frequently, choose an assignment such as 192.168.0.30. You'll also want to change the default gateway to your router's IP address, though this shouldn't be critical if you're not sending data outside your network. On a Windows machine, you can find your router's IP address (labeled as Default Gateway) by typing ipconfig from the command prompt. Once you change the default gateway, the system will restart. You'll then find your camera at the static IP address that you set up.

MotionEyeOS_IMAGE 7

Motion capture settings

Taking Pictures With a MotionEyeOS Raspberry Pi Camera

Once you have installed MotionEyeOS, started it up and found somewhere to place your Pi/camera, turn your attention to how it actually takes pictures. I chose the suction cup mounting setup to mount mine, but feel free to explore other solutions or come up with your own. Adjust the focus with the provided wheel and view your changes through the generated website.

Next, you can record continuously or configure video or still image recording based on a motion trigger. If you do opt for a motion trigger, you'll need to set things up correctly so that you capture what you need without catching false positive after false positive.

MotionEyeOS_IMAGE 8

You never know what you might capture!

Why Choose MotionEyeOS?

At this point, you have even more options to customize your text overlay, remote storage, and scheduling. Perhaps this is where such a system really shines, as you can program it to behave in nearly any manner that suits you, leaving you in charge of your data.

If you're willing to invest in MotionEyeOS and put in the effort required to set it up, you'll have an impressively wide range of controls at your disposal for your next application. Given the low hardware price and the free software, this setup is certainly worth a look.

Related Products


newsletter 1


Latest News

Sorry, your filter selection returned no results.

We've updated our privacy policy. Please take a moment to review these changes. By clicking I Agree to Arrow Electronics Terms Of Use  and have read and understand the Privacy Policy and Cookie Policy.

Our website places cookies on your device to improve your experience and to improve our site. Read more about the cookies we use and how to disable them here. Cookies and tracking technologies may be used for marketing purposes.
By clicking “Accept”, you are consenting to placement of cookies on your device and to our use of tracking technologies. Click “Read More” below for more information and instructions on how to disable cookies and tracking technologies. While acceptance of cookies and tracking technologies is voluntary, disabling them may result in the website not working properly, and certain advertisements may be less relevant to you.
We respect your privacy. Read our privacy policy here