Accessories
Description
Looking for accessories to enhance your Brainy Pi product building experience? Our accessories page provides documentation and tutorials to help you get these accessories set up . From raspberry pi sensors and cameras to displays and motors, everything should directly work on Brainy Pi and wherever there is a difference in usage steps this page covers those accessories .
INFO
This documentation is for Rbian OS version: 0.7.2-beta
To check the version of Rbian run the command in terminal
os-version
Note: If the command fails or gives error then Rbian version is < 0.7.2-beta.
Camera
Connecting CSI Camera
1. BrainyPi supports Raspi cam v1.3 CSI camera (OV5647)
2. Connect the CSI camera to the CSI port.
3. Enable the camera, by running the commands
sudo sed -i 's/#intfc:dtoverlay=ov5647/intfc:dtoverlay=ov5647/g' /boot/hw_intfc.conf
sudo reboot
4. Now your camera should be connected. Check connection by running the command
sudo media-ctl -p
You should see the camera sensor
ov5647
in the output
Using CSI camera
CLI
Python
CLI
To capture video from the camera run the command
<code">gst-launch-1.0 rkisp device=/dev/video0 path-iqf=/etc/iqfiles/ov5647_default_default.xml ! videoconvert ! video/x-raw,format=NV12,width=1280,height=720 ! videoconvert ! x264enc ! flvmux ! filesink location=./test.flv
This will capture the camera output to a video file test.flv
Python
BrainyPi supports Picamera python library for capturing images from CSI camera.
CAUTION
Support for Picamera library is very limited. For now the library supports only capturing the images form CSI camera.
Program to capture the image from CSI camera
# Import required packages import picamera import time # Create PiCamera Object cam = picamera.PiCamera() # Capture the image of resolution 1920x1080 cam.resolution = (1920, 1080) # Flip image horizontally cam.hflip = True # Flip image vertically cam.vflip = True # Set the camera output rotation value which can be 0, 90, # 180 or 270. cam.rotation = 270 # Capture image and store it in .jpeg file cam.capture('image.jpeg')
Save the program in file picamera-capture.py
Run the program by running command
sudo python3 picamera-capture.py
NEED SUPPORT ?
First, Ensure version of OS installed and the version this document is intended for match. If they match and yet problem persists. Please use this Forum link for community help.
If you are an enterprise customer please use the ticketing system login provided to you for priority support.
Previous
Next