Learn more about the full design from my Blog Post Tea and Tech Time: Pieca Camera System
I forked the bulk of this code from eat-sleep-code's camera repo for the software interface to the Pieca camera system. I added Pi GPIO functionality to trigger the shutter, power off the camera, and a simple battery monitor to automatically turn off the camera when the battery is running out.
I also added an auto start script that can be called at boot by placing the .desktop file in the raspberry pi .config/autostart folder.
Due to breaking changes in the Raspberry Pi OS camera stack, this software will not work with the recent Bullseye version of Raspberry Pi OS. A new integration library is currently under development by the Raspberry Pi Foundation with a planned release in early 2022. Our camera software will be updated to take advantage of this integration library when it becomes publicly available.
In the meantime, if you wish to use this software you will need to install the Buster version of Raspberry Pi OS.
This program makes the use of a Raspberry Pi HQ camera a little more powerful and user-friendly. It unleashes easy exposure bracketing, timelapse functionality, etc. It also adds on-screen controls for use with touch screens, additional error handling, and presets for some common settings.
- Use raspi-config to:
- Set the Memory Split value to a value of at least 256MB
- Enable the CSI camera interface
- Set up your WiFi connection
- Connect the Raspberry Pi HQ Camera to your Raspberry Pi
Installation of the program, any software prerequisites, as well as DNG support can be completed with the following two-line install script.
wget -q https://raw.githubusercontent.com/Tschucker/Pieca-camera-software/master/install-camera.sh -O ~/install-camera.sh
sudo chmod +x ~/install-camera.sh && ~/install-camera.sh
camera <options>
- --action : Set the camera action (default: capture)
- --shutter : Set the shutter speed in milliseconds (default: auto)
- --iso : Set the ISO (default: auto)
- --exposure : Set the exposure mode (default: auto)
- --ev : Set the exposure compensation (+/-10) (default: 0)
- --bracket : Set the exposure bracketing value (default: 0)
- --awb : Set the Auto White Balance (AWB) mode (default: auto)
- --outputFolder : Set the folder where images will be saved (default: dcim/)
- --raw : Set whether DNG files are created in addition to JPEG files (default: True)
- --timer : Set the interval for timelapse mode in seconds (default: 0)
- --previewWidth : Set the preview window width (default: 800)
- --previewHeight : Set the preview window height (default: 460)
- Press s+▲ or s+▼ to change shutter speed
- Press i+▲ or i+▲ to change ISO
- Press c+▲ or c+▲ to change exposure compensation
- Press b+▲ or b+▲ to change exposure bracketing
- Press [p] to toggle the preview window
- Press the [space] bar to take photos or begin a timelapse
- Press ␛ to exit
If you need to control your camera via a web-based interface, please see camera.remote.
To autostart the program as soon as the Raspberry Pi OS desktop starts, execute the following command:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Add the following line to the end of the file and then save the file:
@lxterminal --geometry=1x1 -e sudo python3 /home/pi/camera/camera.py
If you are using an infrared (IR) camera, you will need to modify the Auto White Balance (AWB) mode at boot time.
This can be achieved by executing sudo nano /boot/config.txt and adding the following lines.
# Camera Settings
awb_auto_is_greyworld=1
Also note, that while IR cameras utilize "invisible" (outside the spectrum of the human eye) light, they can not magically see in the dark. You will need to illuminate night scenes with one or more IR emitting LEDs to take advantage of an Infrared Camera.
ℹ️ This application was developed using a Raspberry Pi HQ (2020) camera and Raspberry Pi 3B+ and Raspberry Pi 4B boards. Issues may arise if you are using either third party or older hardware.
