User avatar
mad-hatter
Posts: 419
Joined: Sun Feb 26, 2012 2:58 pm
Location: By the UK seaside

bin/bash - vcgencmd get_camera - show xmessage very slow

Mon Aug 14, 2017 9:21 am

Hello,

I'm running this script from my program, the 'xmessage' takes about 12/15 seconds to appear,
whether the camera is connected or not, the message is correct.
If I run from a terminal, I get this warning.

Code: Select all

[email protected]:~/scripts $ ./WebCam.sh 1
Warning: Missing charsets in String to FontSet conversion
How do I cure the missing charsets?
Maybe this is causing the delay.

Regards

Code: Select all

"WebCam.sh"

#!/bin/bash

s=$(/opt/vc/bin/vcgencmd get_camera)
sb="supported=1 detected=1"
case $sb in
$s)
echo "Camera detected"
;;
*)
xmessage "Camera not detected !" -buttons ok
exit 1
;;
esac

cd /home/pi/RPi_Cam_Web_Interface

case $1 in
	[1]) ./start.sh;;
	[2]) ./stop.sh;;
	*) echo -e "${RED}Error...${STD}" && sleep 2
esac

Return to “General programming discussion”

Who is online

Users browsing this forum: No registered users and 1 guest