Now that the Raspberry Pi (RPI) is set up, it’s time to get the BeeCam up-and-running, quickly and inexpensively. For my project, I wanted the ability to view the bees at various times throughout the day. For this project, I’m not interested in saving pictures or videos (like a security camera might do).
Prerequisites
- The RPI is powered on and up-and-running on the home WiFi
- The “headless RPI” is accessible via VNC or SSH (more info here if needed)
- RPI software is up-to-date (info here if needed)
- You know how to get to a command line on the RPI (aka LXTerminal) (info here if needed)
Hardware
I had an old USB webcam sitting in my stash of outdated computer equipment, which is what I used to get started. The original BeeCam picture was grainy but it worked just fine to view things like swarming signs. That said, my husband graciously donated his high definition webcam to the project. Honestly, the picture is so much better, especially when I view it on my phone, but you will have decide what’s best for you.
If you don’t have a stash that includes a webcam, you can purchase a new one for as little as $8. Or, check your local Good Will to get a used one.
Note: Here is a link to the HD webcam we have installed now: Microsoft LifeCam Cinema
Once you get the webcam sorted, simply plug it into one of the open USB ports on your RPI.
Software
Motion
Motion is an open source, command line tool designed to work with Linux and various cameras. It detects motion and can record images and videos.
To install motion, type the following:
sudo apt-get install motion
press ENTER
Once installation is complete, you need to configure motion according to your needs and interests. There are several things you need to validate and/or change. During this initial update, you should peruse the options in the config file so that you can plan for your future projects.
Now, let’s update the motion configuration. Type the following:
sudo nano /etc/motion/motion.conf
press ENTER
You can now edit the motion.conf file. Find, review, and update the settings following the guidelines the list below.
daemon on
log_level 1
stream_port 8081
stream_localhost off
webcontrol_localhost off
quality 100
width 1280 (or 640-depending on resolution of your webcam)
height 1024 (or 480-depending on resolution of your webcam)
output_pictures off (to save space)
ffmpeg_output_movies off (to save space)
framerate 4 (or your choice)
target_dir /home/pi/yourdirectoryname (iff you are saving files)
⊕ Note: The motion.conf file is big, so the easiest way to find each of the settings for the above list is to search for the term. To do that, in edit mode, press CTRL + W and then type the setting name as shown in bold letters below; update the setting as show in red text below. Example – press together the CTRL key and the W key. Then type daemon and press ENTER. Your cursor will now be situated on “daemon”
Once you have completed the motion.conf updates, press CTRL + X to exit the motion.conf file. You will be prompted to type Y to save. Then press ENTER to save changes to motion.conf.
Now, type the following command
sudo nano /etc/default/motion
press ENTER and update the setting as follows:
start_motion_daemon yes
Once you have completed the updates, press CTRL + X. You will be prompted to type Y to save. Press ENTER to save changes.
Start the BeeCam
Type: sudo service motion restart
press ENTER
Type: sudo motion
press ENTER
Yay! Your BeeCam is now ready!
View your BeeCam.
Open up your browser.
⊕ Note: At the time of this publishing, Edge doesn’t work so I’m using Firefox.
In your browser, type the IP address of your RPI and the port number, like this: 192.168.1.17:8081
Now bookmark this site because you’re gonna love viewing your bees at anytime!!
⊕ Note: If you need to find the IP Address, on your RPI, open LXTerminal. Type: sudo ifconfig and look for the wlan0 entry to find the inet address, which is the IP address for your RPI.

Here is a snapshot from my phone on a hot July evening — the bees are trying to take in some cool breeze.
Summary of Motion commands
- To edit config file: sudo nano /etc/motion/motion.conf
- To start motion: sudo motion
- To stop motion $sudo service motion stop
- To restart motion: $sudo service motion start


One Comment
Comments are closed.