diff --git a/RESOURCES/OPTIONS/webcam/webcam.sh b/RESOURCES/OPTIONS/camera/camera.sh similarity index 89% rename from RESOURCES/OPTIONS/webcam/webcam.sh rename to RESOURCES/OPTIONS/camera/camera.sh index a5f660c..eb74596 100755 --- a/RESOURCES/OPTIONS/webcam/webcam.sh +++ b/RESOURCES/OPTIONS/camera/camera.sh @@ -13,6 +13,12 @@ fi project_root="$1" webcam_package="$2" +auto_start="N" +if [ "$webcam_package" == "default.run" ]; then + webcam_package="default" + auto_start="Y" +fi + # check the required tools app_version_tool=$(which app_version.sh) app_model_tool=$(which app_model.sh) @@ -43,14 +49,14 @@ if [ ! -d "$project_root" ]; then fi # check the webcam package folder -webcam_package_folder="${project_root}/RESOURCES/OPTIONS/webcam/${webcam_package}" +webcam_package_folder="${project_root}/RESOURCES/OPTIONS/camera/${webcam_package}" if [ ! -d "$webcam_package_folder" ]; then echo -e "${RED}ERROR: Cannot find the folder '$webcam_package_folder' ${NC}" exit 4 fi # check the webcam package file -webcam_package_file="${webcam_package_folder}/webcam.zip" +webcam_package_file="${webcam_package_folder}/camera.zip" if [ ! -f "$webcam_package_file" ]; then echo -e "${RED}ERROR: Cannot find the file '$webcam_package_file' ${NC}" exit 5 @@ -69,6 +75,11 @@ cd "$target_folder" || exit 7 unzip -o "$webcam_package_file" cd "$current_folder" || exit 8 +if [ "$auto_start" == "N" ]; then + # auto start not requested, remove the auto start + rm -f "$project_root/unpacked/squashfs-root/opt/etc/init.d/S55camera" +fi + # try to find out the app version (like app_ver="309") def_target="$project_root/unpacked/squashfs-root/app/app" app_ver=$("$app_version_tool" "$def_target") @@ -87,6 +98,7 @@ fi # patch the app based on the model and the version if [ "$app_ver" == "3.0.9" ]; then + # stop the app for looking for inserted webcam sed -i 's/video4linux/videoXlinux/g' "$def_target" if [ "$app_model" == "K2Pro" ]; then diff --git a/RESOURCES/OPTIONS/webcam/default/webcam.zip b/RESOURCES/OPTIONS/camera/default/camera.zip similarity index 77% rename from RESOURCES/OPTIONS/webcam/default/webcam.zip rename to RESOURCES/OPTIONS/camera/default/camera.zip index 4abbb26..14941fd 100644 Binary files a/RESOURCES/OPTIONS/webcam/default/webcam.zip and b/RESOURCES/OPTIONS/camera/default/camera.zip differ diff --git a/options.cfg b/options.cfg index 75b1e66..e602f87 100644 --- a/options.cfg +++ b/options.cfg @@ -43,14 +43,20 @@ python="3.11" # Webcam cli tool for taking pictures from a connected USB web camera fswebcam="default" -# Enable custom web camera support. Use the 'default' package. +# Enable custom web camera support. Use the 'default' or 'default.run' package. # Support for firmware ver 3.0.9+ only +# +# Use "default" for install the package but not run the process # When you need remote video monitoring from the ssh shell execute # 'camera.py' to start the webserver -# It requires a compatible USB camera to be inserted in any of the USB slots -# From your browser navigate to: http://your_printer_address:8000 # Use CTRL-C or close the ssh shell to stop the webserver -webcam="default" [python] [fswebcam] +# +# Use "default.run" for install the package and auto run the process at startup +# +# From your browser navigate to: http://your_printer_address:8000 +# +# It requires a compatible USB camera to be inserted in any of the USB slots +camera="default.run" [python] [fswebcam] # Enable the web interface Kobra Unleashed # More information: https://github.com/anjomro/kobra-unleashed