-
Uses the Advanced Python Scheduler to background schedule the three main interval jobs implemented in rpicam, rpimgdir and rpimgdb.
-
Schedule an additional background timer job to collect/combine the status messages from the rpi scheduled jobs, and to send/receive remote control commands via ThingSpeak TalkBack App. All classes described below have a remote control interface to this timer job.
-
The module notifies the systemd (when available) with: READY=1, STATUS=, WATCHDOG=1 (read env variable WATCHDOG_USEC=), STOPPING=1.
-
Gracefull exit is implemented for SIGINT, SIGTERM and SIGABRT.
-
Raspberry PI camera using libcamera-still (new libcamera stack, preferred), or
-
Raspberry PI camera using the picamera python module, or
-
Raspberry PI camera using the raspistill utility, or
-
USB web camera using fswebcam utility.
-
Implement infra-red (IR) or visible light (VL) reflector control via GPIO (configured with
use_irl
andbcm_irlport
parameters) -
Implement PIR sensor as external trigger for the camera job, which replaces the job scheduler (configured with
use_pir
andbcm_pirport
parameters)
The image file names are: '%d%m%y-%H%M%S-CAMID.jpg', where CAMID is the image/camera identification string image_id
specified in the configuration file.
The images are saved locally in a sub-folder under the root image_dir
folder specified in the cofiguration file. The sub-folder name is the current date %d%m%y
.
When using picamera module, the images are automatically rotated with the image_rot
angle (degrees) specified in the configuration file.
The libcamera-still (LIBCAMERA
) is the preferred/recommended option since Debian Bullseye, Nov 2021.
When libcamera-still is used a tunning file (--tuning-file) must be configured by setting the LIBCAMERA_JSON
in the rpicam.py module.
See https://www.raspberrypi.com/documentation/accessories/camera.html
The rpicam module implements a 'dark' time long exposure time or an IR/VL reflector ON/OFF switch.
The 'dark' time period (start and stop) can be configured manually using the hour/min parameters set in the configuration file.
Alternatively, the 'dark' time period can be configured automatically using the PyEphem
and the location parameters (latitude and longitude) set in the configuration file.
During the 'dark' time period the IR light is controlled via the GPIO BCM port number bcm_irport
when use_ir=1
set in the configuration file.
The images are saved remotely in a sub-folder under the root image_dir
folder specified in the cofiguration file. The sub-folder name is the current date %d%m%y
.
The implementation of the thingspk module follows the ThingSpeak API documentation and the TalkBack API documentation The REST client implementation follows the model of the older Python Xively API client.
rpicamsch.service.user: systemd service unit, run with --user (to be copied to $HOME/.config/systemd/user/rpicamsch.service)
PIP: requirements.txt, to be used with sudo pip3 install -r requirements.txt --upgrade
-
RPi.GPIO; the module is installed by default in Raspbian/Wheezy; see alternative below
APT-GET:
-
libopenjp2-7 and libtiff5 (required by Pillow)
-
fontconfig (provides Dejavu fonts)