Skip to content

Commit 4d3e65a

Browse files
authored
feat: add dual picam detection (#229)
Signed-off-by: Stephan Wendel <[email protected]>
1 parent 1fbeddd commit 4d3e65a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

libs/hwhandler.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ detect_libcamera() {
6565
[[ -x "$(command -v libcamera-hello)" ]]; then
6666
avail="$(libcamera-hello --list-cameras | sed '/^\[.*\].*/d' | awk 'NR==1 {print $1}')"
6767
if [[ "${avail}" = "Available" ]]; then
68-
echo "1"
68+
get_libcamera_path | wc -l
6969
else
7070
echo "0"
7171
fi

libs/logging.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function print_cfg {
8888
}
8989

9090
function print_cams {
91-
local total v4l
91+
local device total v4l
9292
v4l="$(find /dev/v4l/by-id/ -iname "*index0" 2> /dev/null | wc -l)"
9393
libcamera="$(detect_libcamera)"
9494
legacy="$(detect_legacy)"
@@ -100,7 +100,9 @@ function print_cams {
100100
log_msg "INFO: Found ${total} total available Device(s)"
101101
fi
102102
if [[ "${libcamera}" -ne 0 ]]; then
103-
log_msg "Detected 'libcamera' device -> $(get_libcamera_path)"
103+
for device in $(get_libcamera_path); do
104+
log_msg "Detected 'libcamera' device -> ${device}"
105+
done
104106
fi
105107
if [[ "${legacy}" -ne 0 ]]; then
106108
raspicam="$(v4l2-ctl --list-devices | grep -A1 -e 'mmal' | \

0 commit comments

Comments
 (0)