From ef5722dbe6511c504f9b4b2a6ee0bb3ee8e10a2b Mon Sep 17 00:00:00 2001 From: paukstelis Date: Tue, 27 Sep 2022 21:21:36 -0400 Subject: [PATCH] camera to dmesg --- octoprint_deploy.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/octoprint_deploy.sh b/octoprint_deploy.sh index 0bccb9a..3ec0cc6 100755 --- a/octoprint_deploy.sh +++ b/octoprint_deploy.sh @@ -187,7 +187,7 @@ new_instance () { if prompt_confirm "Do you want to use the physical USB port to assign the udev entry? If you use this any USB hubs and printers detected this way must stay plugged into the same USB positions on your machine as they are right now"; then echo USB=$TEMPUSB - echo -e "Your printer will be setup at the following usb address:\033[0;34m $USB\033[0m" | log + echo -e "Your printer will be setup at the following usb address: $USB" | log echo else main_menu @@ -379,13 +379,14 @@ add_camera() { done fi - journalctl --rotate > /dev/null 2>&1 - journalctl --vacuum-time=1seconds > /dev/null 2>&1 + #journalctl --rotate > /dev/null 2>&1 + #journalctl --vacuum-time=1seconds > /dev/null 2>&1 + dmesg -C echo "Plug your camera in via USB now (detection time-out in 1 min)" counter=0 while [[ -z "$CAM" ]] && [[ $counter -lt 30 ]]; do - CAM=$(timeout 1s journalctl -kf | sed -n -e 's/^.*SerialNumber: //p') - TEMPUSBCAM=$(timeout 1s journalctl -kf | sed -n -e 's|^.*input:.*/\(.*\)/input/input.*|\1|p') + CAM=$(timeout 1s dmesg -w | sed -n -e 's/^.*SerialNumber: //p') + TEMPUSBCAM=$(timeout 1s dmesg -w | sed -n -e 's|^.*input:.*/\(.*\)/input/input.*|\1|p') counter=$(( $counter + 1 )) done #Failed state. Nothing detected