Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
alienzhangyw edited this page May 15, 2020 · 1 revision

BlockPi v1.1.4 added support for Raspberry Pi Camera Module.

Connect and enable the Camera Module

Ensure your Raspberry Pi is turned off, plug in the Camera Module as follows:

It looks like this when connected:

PS: There are different versions of Pi Camera Modules.

Turn on your Raspberry Pi and find the Raspberry Pi configuration in the main menu.

Enables the camera in the Interfaces tab then click OK.

Take a picture

Use the blocks in PiCamera category to build a simple program:

The preview window can only be displayed on HDMI displays. Sleep for 2 seconds is recommended to warm up the camera. The picture is saved in the Desktop folder by default, you can change the path by modifying the file name.

Sample picture:

You can use different sensors to decide when to take a picture, and you can use the professional blocks to change the camera's setting.

Take pictures in a row

Use a loop to take pictures in a row and name them with numbers:

Add annotation

You can add an annotation to the picture on the top, with selected text size and color.

It works like this:

Image Effects

You can change the image effects of the camera:

For example, sketch effect:

or oil paint effect:

Record a video

The camera can record videos in H264 format:

PS: Some image effects are also available in videos.

You can open the video files with a video player like VLC or PotPlayer, on your Raspberry Pi or Windows PC.

HTTP web stream

Start web streaming easily:

The url of the stream is http://your-rpi-ip:port/stream.mjpg, you can open it with any web browser, or video player like PotPlayer which support web streams.

PS: Higher resolution and framerate means higher bandwidth usage, so choose them wisely.

About autorun on boot

It's easy to do if you want to run your code build in BlockPi on boot. When you have build your code blocks in BlockPi, just run it once and there will be a code.py file in your Desktop folder. Open the file browser, locate to /etc folder and find the rc.local. Open it with a text editor, add "sudo python3 code.py's path" before "exit 0", for example:

sudo python3 /home/pi/Desktop/code.py

Save the file and reboot your Raspberry Pi.