This page intends to collect information on how to deal with errors which may occur while running raspiCamSrv.
- SystemError: No cameras were found on the server's device
See raspi-cam-srv Issue #6 - ERROR in camera_pi: Could not import SensorConfiguration from picamera2.configuration. Bypassing sensor configuration
This message may occur when running on Bullseye systems - ERROR V4L2 v4l2_videodevice.cpp:1906 /dev/video4[16:cap]: Failed to start streaming: Broken pipe
See picamera2 Issue #104 from Feb 1, 2024
The recommended solution was to go back to kernel release 6.1.65 withsudo rpi-update d16727d - ModuleNotFoundError: No module named 'picamera2'
See raspi-cam-srv Issue #4 - TypeError: memoryview: casts are restricted to C-contiguous views
See picamera2 Issue #959
The raspiCamSrv server uses Python logging.
Logging is initialized in module __init__.py.
All lines controlling the way of logging or code generation are preceeded with a comment line, starting with
#>>>>>
By default, a StreamingHandler is added to all loggers which outputs log information to sys.stderr.
If desired, the prepared FileHandler can be activated.
The log level for all loggers is initialized with level ERROR.
This can be modified for all or for specific modules.
Flask logging is controlled by app.logger
Werkzeug implements WSGI, the standard Python interface between applications and servers.
Werkzeug logs basic request/response information.
Werkzeug logging is controlled by logging.getLogger("werkzeug").
The log level is initialized in __init__.py with INFO, in order to enable informative logging during server start.
After the server has been started, the log level is raised to ERROR.
This is done in auth.py in function login_required(view).
Logging can be controlled individually for each module.
The libcamera library is the basic C++ camera library on which Picamera2 is based.
The log level is controlled through an environment variable LIBCAMERA_LOG_LEVELS.
This is set in __init__.py to WARNING.
Other allowed log levels are listed in the comment.
For more details, see Picamera2 manual, chapter 8.6.2
Picamera2 logging is initialized in __init__.py with ERROR
For more details, see Picamera2 manual, chapter 8.6.1
The system can generate a file with Python code including the entire interaction of raspiCamSrv with Picamera2.
This file can then be used for debugging and error analysis.
A specific logger ("pc2_prg") with with level DEBUG is used for code generation.
The logger can be activated by setting
prgLogger.setLevel(logging.DEBUG)
in __init___.py
The code file is located in
/home/<user>/prg/raspi-cam-srv/logs
with name
prgLog_YYYYMMDD_hhmmss.log
A new file will be generatet at every server start.
To run the files, you neet to change the file type from .log to .py
Generating the files with .py extension does not work because Flask seems to recognize these files and does strange things.
All photo and video output generated by these files will be located at
/home/<user>/prg/raspi-cam-srv/output
with the same file names as in the original session.
