====== Pi Camera Board ====== First of all, we'll have to connect the camera ribbon to the Pi's camera port, refer to the official [[https://www.raspberrypi.org/documentation/usage/camera/README.md|Raspberry Pi website article]] explaining how to: * Physically connect it * Enable it using ''sudo raspi-config'' * Use the camera via [[https://www.raspberrypi.org/documentation/usage/camera/raspicam/README.md|a shell]] or [[https://www.raspberrypi.org/documentation/usage/camera/python/README.md|using python]] ===== Activating the Camera ===== On **Raspbian** you could use the ''raspi-config'' command to activate the camera. If using another distribution (like [[:os:minibian|Minibian]] you might have to manually edit ''/boot/config.txt'' to have the following lines: <Code:bash> > nano /boot/config.txt </Code> <Code:bash |/boot/config.txt> gpu_mem=128 start_x=1 </Code> The reboot the Pi, and test that the camera is accessible with: <Code:bash |Test capture:> > raspistill -o cam.jpg </Code> ===== PiCamera ===== There are a couple of python libraries available for the Pi Camera, the applications hereunder are real-life usage samples of the [[http://picamera.readthedocs.io|picamera library]]: To make picamera available **for all users** on the system: <Code:bash> > sudo apt-get update > sudo apt-get install python-picamera [> sudo apt-get install python3-picamera] </Code> to remove your installation: <Code:bash> > sudo apt-get remove python-picamera [> sudo apt-get remove python3-picamera] </Code> To install picamera in a **Virtualenv**: <Code:bash> > sudo apt-get install python-pip python-virtualenv > virtualenv sandbox [> virtualenv -p python3 sandbox] > source sandbox/bin/activate (sandbox) $ pip install picamera [(sandbox) $ pip-3.2 install picamera] </Code> More about [[http://picamera.readthedocs.io/en/release-1.10/install2.html#virtualenv-installation|upgrading, removing picamera from a virtualenv]]. ===== Applications ===== | [[peripherals:camera:timelapse|{{ :peripherals:camera:timelapse-icon.png?nolink |}}]] | | [[peripherals:camera:timelapse|Timelapse]] |