This page intends to collect information on how to deal with errors which may occur while running raspiCamSrv.
-
No Connection to server although server has been started as service.
This may happen (see raspi-cam-srv Issue #8) if the service has been started before the network interfaces are ready.
The systemd journal will indicate that the Flask server is only listening to localhost (127.0.0.1)
In this case, more restrictive settings in the After clause of the service configuration file may be required (see systemd Network Configuration Synchronization Points) -
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.
Currently, it can be ignored because the missing SensorConfiguration class has currently no impact on raspiCamSrv functionality.
SensorConfiguration is a class in Picamera2 which is referenced in the CameraConfiguration (see Picamera2 Manual chapter 4.3)
It includes information on the output size and bit depth of a stream.
In Bullseye systems, this class is missing.
Currently, raspiCamSrv does not require the SensorConfigiuration but it is included in the data model because Picamera2 uses it.
The error occurs when trying to import the class. -
WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
This is just a warning from the libcamera system that the tuning file should be updated.
It is currently not known that there is an impact on raspiCamSrv functionality. -
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.