[Automated] Merged develop into target master
This commit is contained in:
commit
ea6ab64d9e
@ -32,10 +32,10 @@ CLONE_FLAGS=(--depth=1 --single-branch)
|
|||||||
# Ustreamer repo
|
# Ustreamer repo
|
||||||
USTREAMER_PATH="ustreamer"
|
USTREAMER_PATH="ustreamer"
|
||||||
if [[ -z "${CROWSNEST_USTREAMER_REPO_SHIP}" ]]; then
|
if [[ -z "${CROWSNEST_USTREAMER_REPO_SHIP}" ]]; then
|
||||||
CROWSNEST_USTREAMER_REPO_SHIP="https://github.com/mryel00/ustreamer.git"
|
CROWSNEST_USTREAMER_REPO_SHIP="https://github.com/pikvm/ustreamer.git"
|
||||||
fi
|
fi
|
||||||
if [[ -z "${CROWSNEST_USTREAMER_REPO_BRANCH}" ]]; then
|
if [[ -z "${CROWSNEST_USTREAMER_REPO_BRANCH}" ]]; then
|
||||||
CROWSNEST_USTREAMER_REPO_BRANCH="master"
|
CROWSNEST_USTREAMER_REPO_BRANCH="v6.10"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Camera-streamer repo
|
# Camera-streamer repo
|
||||||
|
13
libs/core.sh
13
libs/core.sh
@ -82,18 +82,15 @@ function check_dep {
|
|||||||
|
|
||||||
function check_apps {
|
function check_apps {
|
||||||
local cstreamer ustreamer
|
local cstreamer ustreamer
|
||||||
ustreamer_base="bin/ustreamer"
|
ustreamer="bin/ustreamer/src/ustreamer.bin"
|
||||||
ustreamer="$(find "${BASE_CN_PATH}"/"${ustreamer_base}" \
|
|
||||||
-iname 'ustreamer.bin' 2> /dev/null | sed '1q')"
|
|
||||||
cstreamer="bin/camera-streamer/camera-streamer"
|
cstreamer="bin/camera-streamer/camera-streamer"
|
||||||
|
if [[ -x "${BASE_CN_PATH}/${ustreamer}" ]]; then
|
||||||
if [[ -x "${ustreamer}" ]]; then
|
log_msg "Dependency: 'ustreamer' found in ${ustreamer}."
|
||||||
log_msg "Dependency: '${ustreamer##*/}' found in ${ustreamer_base}/${ustreamer##*/}."
|
UST_BIN="${BASE_CN_PATH}/${ustreamer}"
|
||||||
UST_BIN="${ustreamer}"
|
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
declare -r UST_BIN
|
declare -r UST_BIN
|
||||||
else
|
else
|
||||||
log_msg "Dependency: '${ustreamer##*/}' not found. Exiting!"
|
log_msg "Dependency: 'ustreamer' not found. Exiting!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -21,8 +21,7 @@ detect_avail_cams() {
|
|||||||
local avail realpath
|
local avail realpath
|
||||||
avail="$(find /dev/v4l/by-id/ -iname "*index0" 2> /dev/null)"
|
avail="$(find /dev/v4l/by-id/ -iname "*index0" 2> /dev/null)"
|
||||||
count="$(echo "${avail}" | wc -l)"
|
count="$(echo "${avail}" | wc -l)"
|
||||||
if [[ -d "/dev/v4l/by-id/" ]] &&
|
if [[ -d "/dev/v4l/by-id/" ]] && [[ -n "${avail}" ]]; then
|
||||||
[[ -n "${avail}" ]]; then
|
|
||||||
log_msg "INFO: Found ${count} available v4l2 (UVC) camera(s)"
|
log_msg "INFO: Found ${count} available v4l2 (UVC) camera(s)"
|
||||||
echo "${avail}" | while read -r v4l; do
|
echo "${avail}" | while read -r v4l; do
|
||||||
realpath=$(readlink -e "${v4l}")
|
realpath=$(readlink -e "${v4l}")
|
||||||
@ -63,8 +62,8 @@ detect_libcamera() {
|
|||||||
local avail
|
local avail
|
||||||
if [[ "$(is_raspberry_pi)" = "1" ]] &&
|
if [[ "$(is_raspberry_pi)" = "1" ]] &&
|
||||||
[[ -x "$(command -v libcamera-hello)" ]]; then
|
[[ -x "$(command -v libcamera-hello)" ]]; then
|
||||||
avail="$(libcamera-hello --list-cameras | sed '/^\[.*\].*/d' | awk 'NR==1 {print $1}')"
|
avail="$(libcamera-hello --list-cameras | grep -c "Available")"
|
||||||
if [[ "${avail}" = "Available" ]]; then
|
if [[ "${avail}" = "1" ]]; then
|
||||||
get_libcamera_path | wc -l
|
get_libcamera_path | wc -l
|
||||||
else
|
else
|
||||||
echo "0"
|
echo "0"
|
||||||
@ -83,23 +82,61 @@ get_libcamera_path() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# print libcamera resolutions
|
||||||
|
list_picam_resolution() {
|
||||||
|
local prefix
|
||||||
|
prefix="$(date +'[%D %T]') crowsnest:"
|
||||||
|
log_msg "'libcamera' device(s) resolution(s) :"
|
||||||
|
while read -r i; do
|
||||||
|
printf "%s\t\t%s\n" "${prefix}" "${i}" >> "${CROWSNEST_LOG_PATH}"
|
||||||
|
done < <(libcamera-hello --list-cameras | sed '1,2d;s/Modes:/Colorspace:/')
|
||||||
|
}
|
||||||
|
|
||||||
|
get_libcamera_controls() {
|
||||||
|
local ust_bin flags
|
||||||
|
flags=( --camera-type=libcamera --camera-list_options )
|
||||||
|
ust_bin="${BASE_CN_PATH}/bin/camera-streamer/camera-streamer"
|
||||||
|
if [[ -x "${ust_bin}" ]]; then
|
||||||
|
"${ust_bin}" "${flags[@]}" --camera-path="$(get_libcamera_path)" 2> /dev/null | \
|
||||||
|
sed 's/device//g;/^SNAPSHOT/q' | sed '/^SNAPSHOT/d' | \
|
||||||
|
sed '/^CAMERA/d;/- property/d' | sed '/camera-streamer Version:/d' | \
|
||||||
|
sed 's/- available option: //g' | sed '/^$/d;' | \
|
||||||
|
sed 's/([0-9]*[a-z,0-9]\,//g' | sed '/type=7/d;/type=4/d' | \
|
||||||
|
sed 's/type=1/ (bool/g;s/type=3/ (int/g;s/type=5/ (float/g' | \
|
||||||
|
sed 's/\[/min=/g;s/\.\./ max=/g;s/\]$//g'
|
||||||
|
else
|
||||||
|
log_msg "WARN: 'libcamera' device option can not be displayed, because"
|
||||||
|
log_msg "WARN: camera-streamer is not installed"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
list_picam_controls() {
|
||||||
|
local prefix
|
||||||
|
prefix="$(date +'[%D %T]') crowsnest:"
|
||||||
|
log_msg "'libcamera' device controls :"
|
||||||
|
while read -r i; do
|
||||||
|
if [[ ! "${i}" =~ "INFO" ]]; then
|
||||||
|
printf "%s\t\t%s\n" "${prefix}" "${i}" >>"${CROWSNEST_LOG_PATH}"
|
||||||
|
fi
|
||||||
|
done < <(get_libcamera_controls)
|
||||||
|
# blank line workaround
|
||||||
|
log_msg ""
|
||||||
|
}
|
||||||
|
|
||||||
# Determine connected "legacy" device
|
# Determine connected "legacy" device
|
||||||
function detect_legacy {
|
function detect_legacy {
|
||||||
local avail
|
local avail
|
||||||
if [[ "$(is_raspberry_pi)" = "1" ]] &&
|
if [[ "$(is_raspberry_pi)" = "1" ]] &&
|
||||||
command -v vcgencmd &> /dev/null; then
|
command -v vcgencmd &> /dev/null; then
|
||||||
if vcgencmd get_camera &> /dev/null ; then
|
if vcgencmd get_camera &> /dev/null; then
|
||||||
avail="$(vcgencmd get_camera \
|
avail="$( vcgencmd get_camera | awk -F '=' '{ print $3 }' | cut -d',' -f1)"
|
||||||
| awk -F '=' '{ print $3 }' \
|
|
||||||
| cut -d',' -f1 \
|
|
||||||
)"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "${avail:-0}"
|
echo "${avail:-0}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function dev_is_legacy {
|
function dev_is_legacy {
|
||||||
v4l2-ctl --list-devices | grep -A1 -e 'mmal' | \
|
v4l2-ctl --list-devices | grep -A1 -e 'mmal' | \
|
||||||
awk 'NR==2 {print $1}'
|
awk 'NR==2 {print $1}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,9 +108,13 @@ function print_cams {
|
|||||||
for device in $(get_libcamera_path); do
|
for device in $(get_libcamera_path); do
|
||||||
log_msg "Detected 'libcamera' device -> ${device}"
|
log_msg "Detected 'libcamera' device -> ${device}"
|
||||||
done
|
done
|
||||||
|
if [[ "$(is_pi5)" = "0" ]]; then
|
||||||
|
list_picam_resolution
|
||||||
|
list_picam_controls
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${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}"
|
||||||
if [[ ! "${CROWSNEST_LOG_LEVEL}" = "quiet" ]]; then
|
if [[ ! "${CROWSNEST_LOG_LEVEL}" = "quiet" ]]; then
|
||||||
|
@ -26,8 +26,8 @@ CN_CONFIG_CONFIGPATH="${CN_CONFIG_ROOTPATH}/config"
|
|||||||
CN_CONFIG_LOGPATH="${CN_CONFIG_ROOTPATH}/logs"
|
CN_CONFIG_LOGPATH="${CN_CONFIG_ROOTPATH}/logs"
|
||||||
CN_CONFIG_ENVPATH="${CN_CONFIG_ROOTPATH}/systemd"
|
CN_CONFIG_ENVPATH="${CN_CONFIG_ROOTPATH}/systemd"
|
||||||
CN_MOONRAKER_CONFIG_PATH="${CN_CONFIG_CONFIGPATH}/moonraker.conf"
|
CN_MOONRAKER_CONFIG_PATH="${CN_CONFIG_CONFIGPATH}/moonraker.conf"
|
||||||
CN_USTREAMER_REPO="https://github.com/mryel00/ustreamer.git"
|
CN_USTREAMER_REPO="https://github.com/pikvm/ustreamer.git"
|
||||||
CN_USTREAMER_BRANCH="master"
|
CN_USTREAMER_BRANCH="v6.10"
|
||||||
CN_CAMERA_STREAMER_REPO="https://github.com/ayufan/camera-streamer.git"
|
CN_CAMERA_STREAMER_REPO="https://github.com/ayufan/camera-streamer.git"
|
||||||
CN_CAMERA_STREAMER_BRANCH="master"
|
CN_CAMERA_STREAMER_BRANCH="master"
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ import_config() {
|
|||||||
[[ -n "${CROWSNEST_CONFIG_PATH}" ]] || CROWSNEST_CONFIG_PATH="/home/${BASE_USER}/printer_data/config"
|
[[ -n "${CROWSNEST_CONFIG_PATH}" ]] || CROWSNEST_CONFIG_PATH="/home/${BASE_USER}/printer_data/config"
|
||||||
[[ -n "${CROWSNEST_LOG_PATH}" ]] || CROWSNEST_LOG_PATH="/home/${BASE_USER}/printer_data/logs"
|
[[ -n "${CROWSNEST_LOG_PATH}" ]] || CROWSNEST_LOG_PATH="/home/${BASE_USER}/printer_data/logs"
|
||||||
[[ -n "${CROWSNEST_ENV_PATH}" ]] || CROWSNEST_ENV_PATH="/home/${BASE_USER}/printer_data/systemd"
|
[[ -n "${CROWSNEST_ENV_PATH}" ]] || CROWSNEST_ENV_PATH="/home/${BASE_USER}/printer_data/systemd"
|
||||||
[[ -n "${CROWSNEST_USTREAMER_REPO_SHIP}" ]] || CROWSNEST_USTREAMER_REPO_SHIP="https://github.com/mryel00/ustreamer.git"
|
[[ -n "${CROWSNEST_USTREAMER_REPO_SHIP}" ]] || CROWSNEST_USTREAMER_REPO_SHIP="https://github.com/pikvm/ustreamer.git"
|
||||||
[[ -n "${CROWSNEST_USTREAMER_REPO_BRANCH}" ]] || CROWSNEST_USTREAMER_REPO_BRANCH="master"
|
[[ -n "${CROWSNEST_USTREAMER_REPO_BRANCH}" ]] || CROWSNEST_USTREAMER_REPO_BRANCH="v6.10"
|
||||||
[[ -n "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" ]] || CROWSNEST_CAMERA_STREAMER_REPO_SHIP="https://github.com/ayufan/camera-streamer.git"
|
[[ -n "${CROWSNEST_CAMERA_STREAMER_REPO_SHIP}" ]] || CROWSNEST_CAMERA_STREAMER_REPO_SHIP="https://github.com/ayufan/camera-streamer.git"
|
||||||
[[ -n "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" ]] || CROWSNEST_CAMERA_STREAMER_REPO_BRANCH="master"
|
[[ -n "${CROWSNEST_CAMERA_STREAMER_REPO_BRANCH}" ]] || CROWSNEST_CAMERA_STREAMER_REPO_BRANCH="master"
|
||||||
status_msg "Using default configuration ..." "0"
|
status_msg "Using default configuration ..." "0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user