@brdk/node-red-picamera2 1.0.0
Node-RED node for taking photos on a Raspberry Pi using picamera2 library
@brdk/node-red-picamera2
A Node-RED node to take still photos on a Raspberry Pi using the picamera2 library. This node will only work on a Raspberry Pi with a camera module enabled.
Prerequisites on the Raspberry Pi
First, make sure your Raspberry Pi Camera is physically connected and detected. On Raspberry Pi OS Bookworm or later, the libcamera stack is enabled by default.
Install picamera2 if not already available:
sudo apt-get update
sudo apt-get install python3-picamera2
For 90°/270° rotation support, install Pillow:
pip3 install Pillow
If you are using the default path during the file option set - the path ~/Pictures will be used.
Runtime information
This node requires Raspberry Pi OS bookworm or later with the libcamera camera stack. Tested with a docker container running Python 3, Node.js 22, and Node-RED 4.x+.
Quick start
- Drag
picamera2-takephotointo your flow. - Connect an
injectnode to trigger captures. - Connect a
debugnode to inspect output. - Select file mode: use
Buffered Modefor in-memory processing, or useDefaultandAuto File Nameto save to disk. - Deploy and trigger.
Example flow idea:
inject->picamera2-takephoto (Buffered Mode)->function (base64 encode)-> storage/API node
Screenshot:

Configuration fields
File settings
File Mode:0Buffered Mode,1Default,2Auto File NameImage Name(autoname): used in auto mode as base name (no extension)File Name(filename): used in default mode as base name (no extension)File Path(filepath): output folder, default~/Pictures/File Format(fileformat):jpeg,png,bmp
Capture settings
Image Resolution: predefined list from320x240up to3280x2464Rotation:0,90,180,270Image Flip: horizontal and verticalBrightness:0to100(mapped internally to libcamera range)Contrast:-100to100Sharpness:-100to100Quality: JPEG quality0to100(ignored for non-JPEG formats)ISO:0(auto) or fixed values100to800Exposure:autoormanualAWB:auto,daylight,cloudy,tungsten,fluorescent,incandescent,indoorWait for AGC(agcwait): delay before capture in seconds