Skip to content

Latest commit

 

History

History
154 lines (105 loc) · 3.95 KB

installation.md

File metadata and controls

154 lines (105 loc) · 3.95 KB

Installation Guide

This guide will explain step by step how to set up your Raspberry PI to run the pimotion application.

Raspberry PI Setup

Hardware

The camera module is required for this application to run. For the installation of the hardware I refer to the official guide.

Operating System

I recommend the [operating system name] OS, this is the OS that the pimotion application has been developed on.

Enabling the camera module

There are 2 ways of enabling the camera module:

  1. During the OS installation During the installation of the operating system, you will be promted for additional actions to take. In this menu, one of the options is to enable/disable the camera module.

  2. After installation If your Raspberry PI already has a running operating system you can call up the same setup menu by running the following command:

    $ sudo raspi-config
    

    Select Enable camera and hit Enter, then go to Finish and you'll be prompted to reboot.

Testing the camera

Make sure your Raspberry PI is connected to a monitor/tv with an hdmi cable and login to the shell. Make sure to login on the PI itself, not through SSH.

In the shell, run the following command to trigger the preview window of the camera:

$ raspistill -d

You should see a preview window for a couple of seconds which closes by itself. If you see this, your camera module is working correctly.

In case the preview does not show or you receive an error, refer to the troubleshooting guide on the Raspberry PI website.

Preparing the system

Required packages

Run the following command to install the required system packages:

$ sudo apt-get update
$ sudo apt-get install -y python-dev python-pip imagemagick libffi-dev libssl-dev git

Pimotion application installation

Python

Confirm that python is installed on the system.

$ python --version
Python 2.7.3

Getting the source code

Run the following command to pull the latest version of Pimotion:

$ mkdir ~/projects
$ cd ~/projects
$ git clone https://github.com/citrusbyte/pimotion.git

Dependency installation

In the pimotion folder run the following commands to install all the dependent python packages:

$ sudo pip install http://effbot.org/downloads/Imaging-1.1.7.tar.gz
$ sudo pip install -r requirements.txt

Additional setup

Create the tmp folder that will hold the captured images:

$ mkdir ~/projects/pimotion/captures

Configuration

Make a copy of the provided settings.cfg.example configuration file:

$ cd ~/projects/pimotion
$ cp settings.cfg.example settings.cfg

Open up the settings.cfg file in your favorite editor and update the configuration values.

cloudapp:

  • username: Your CloudApp username
  • password: Your CloudApp password

m2x:

  • api_key: Your master API key or the device specific API key
  • device_id: The Device ID
  • stream: The name of the stream in your M2X device

Running pimotion

Make sure you are in the correct working directory:

$ cd ~/projects/pimotion

Start the application with the following command:

$ python pimotion/main.py

Example output of a correct running pimotion application:

$ python pimotion/main.py 
Waiting 2 seconds for the camera to warm up
Started recording
Started working on capturing
Captured detected-01.jpg
Captured detected-02.jpg
Captured detected-03.jpg
Captured detected-04.jpg
Captured detected-05.jpg
Captured detected-06.jpg
Captured detected-07.jpg
Captured detected-08.jpg
Captured detected-09.jpg
Captured detected-10.jpg
Captured detected-11.jpg
Captured detected-12.jpg
Captured detected-13.jpg
Captured detected-14.jpg
Captured detected-15.jpg
Generating the montage
Finished capturing
Public URL: http://cl.ly/image/*******/download/montage.jpg
Posted URL to M2X channel motion-photos