fix(hwhandler.sh): fix error in device logging (#169)
* fix(hwhandler.sh): fix error in device logging If device is a Raspberry Pi and does not have libcamera-hello, it does not log devices Error occurs in Line 93 of logging.sh Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> * fix: remove unnecessary double funtion calls Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com> --------- Signed-off-by: Patrick Gehrsitz <58853838+mryel00@users.noreply.github.com>
This commit is contained in:
parent
f6e2156ab3
commit
5333a62498
@ -69,8 +69,7 @@ detect_libcamera() {
|
|||||||
else
|
else
|
||||||
echo "0"
|
echo "0"
|
||||||
fi
|
fi
|
||||||
fi
|
else
|
||||||
if [[ "$(is_raspberry_pi)" = "0" ]]; then
|
|
||||||
echo "0"
|
echo "0"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -90,17 +90,19 @@ function print_cfg {
|
|||||||
function print_cams {
|
function print_cams {
|
||||||
local total v4l
|
local total v4l
|
||||||
v4l="$(find /dev/v4l/by-id/ -iname "*index0" 2> /dev/null | wc -l)"
|
v4l="$(find /dev/v4l/by-id/ -iname "*index0" 2> /dev/null | wc -l)"
|
||||||
total="$((v4l+($(detect_libcamera))+($(detect_legacy))))"
|
libcamera="$(detect_libcamera)"
|
||||||
|
legacy="$(detect_legacy)"
|
||||||
|
total="$((v4l+libcamera+legacy))"
|
||||||
if [ "${total}" -eq 0 ]; then
|
if [ "${total}" -eq 0 ]; then
|
||||||
log_msg "ERROR: No usable Devices Found. Stopping $(basename "${0}")."
|
log_msg "ERROR: No usable Devices Found. Stopping $(basename "${0}")."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
log_msg "INFO: Found ${total} total available Device(s)"
|
log_msg "INFO: Found ${total} total available Device(s)"
|
||||||
fi
|
fi
|
||||||
if [[ "$(detect_libcamera)" -ne 0 ]]; then
|
if [[ "${libcamera}" -ne 0 ]]; then
|
||||||
log_msg "Detected 'libcamera' device -> $(get_libcamera_path)"
|
log_msg "Detected 'libcamera' device -> $(get_libcamera_path)"
|
||||||
fi
|
fi
|
||||||
if [[ "$(detect_legacy)" -ne 0 ]]; then
|
if [[ "${legacy}" -ne 0 ]]; then
|
||||||
raspicam="$(v4l2-ctl --list-devices | grep -A1 -e 'mmal' | \
|
raspicam="$(v4l2-ctl --list-devices | grep -A1 -e 'mmal' | \
|
||||||
awk 'NR==2 {print $1}')"
|
awk 'NR==2 {print $1}')"
|
||||||
log_msg "Detected 'Raspicam' Device -> ${raspicam}"
|
log_msg "Detected 'Raspicam' Device -> ${raspicam}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user