Raspberry Pi Camera Module


In order to enable user access to vchiq, do the following as root:

echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules
usermod -aGvideo USERNAME

To disable the red camera LED, add the following to /boot/config.txt

disable_camera_led=1

As example of a python program to control the LED state:

#!/usr/bin/env python
import time
import RPi.GPIO as GPIO
 
# Use GPIO numbering
GPIO.setmode(GPIO.BCM)
 
# Set GPIO for camera LED
CAMLED = 5
 
# Set GPIO to output
GPIO.setup(CAMLED, GPIO.OUT, initial=False)
 
# Five iterations with half a second
# between on and off
for i in range(5):
  GPIO.output(CAMLED,True)  # On
  time.sleep(0.5)
  GPIO.output(CAMLED,False) # Off
  time.sleep(0.5)

Streaming video from one Raspberry Pi to another:

On the Raspberry Pi that will be receiving the video stream, do the following:

mkfifo buffer
nc -p 5001 -l > buffer | omxplayer buffer

On the Raspberry Pi with the camera, run the following (substituting IPADDRESS with the IP address of the client):

raspivid -t 999999 -o - | nc IPADDRESS 5001

Leave a Reply