我用qt opencv在开发板实现帧间差分法的时候 ,设置程序自启动,触摸屏可以用但是摄像头初始化一直不能识别
搞了好久发现了错误
现在记录下来
自启动首先
1 在/bin 中cp qt4 setqt4env 将最后的路径与执行文件改为自己的路径与执行文件名
保存退出
2修改/etc/.init.d/rcS
#vi /etc/init.d/rcS
把文件中/bin/qtopia & 改成/bin/setqt4env &
这个时候是可以自启动的但是摄像头没有用
打开setqt4env文件对比下开始的那个qtopia文件找到不同 一一修改就好了。这里我复制下原来的setqt4env和修改后的
3.修改前
#!/bin/sh
if [ -e /etc/friendlyarm-ts-input.conf ] ; then
. /etc/friendlyarm-ts-input.conf
fi
true ${TSLIB_TSDEVICE:=/dev/touchscreen}
TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_TSDEVICE
export TSLIB_CONFFILE
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export QWS_DISPLAY=:1
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin
if [ -c ${TSLIB_TSDEVICE} ]; then
export QWS_MOUSE_PROTO="Tslib MouseMan:/dev/input/mice"
if [ ! -s /etc/pointercal ] ; then
rm /etc/pointercal
/usr/bin/ts_calibrate
fi
else
export QWS_MOUSE_PROTO="MouseMan:/dev/input/mice"
fi
export QWS_KEYBOARD=TTY:/dev/tty1
export HOME=/root
cd /usr/local/Trolltech/QtEmbedded-4.7.0-arm/demos/embedded/fluidlauncher
./fluidlauncher -qws
hotplug
~~
4 修改后
#!/bin/sh
if [ -e /etc/friendlyarm-ts-input.conf ] ; then
. /etc/friendlyarm-ts-input.conf
fi
true ${TSLIB_TSDEVICE:=/dev/touchscreen}
TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_TSDEVICE
export TSLIB_CONFFILE
export CAMERA_DEVICE=/dev/video2
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export QTDIR=/opt/Qtopia
export QPEDIR=/opt/Qtopia
export QWS_DISPLAY=:1
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH
export PATH=$QTDIR/bin:/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin
if [ -c ${TSLIB_TSDEVICE} ]; then
export QWS_MOUSE_PROTO="Tslib MouseMan:/dev/input/mice"
if [ ! -s /etc/pointercal ] ; then
rm /etc/pointercal
/usr/bin/ts_calibrate
fi
else
export QWS_MOUSE_PROTO="MouseMan:/dev/input/mice"
fi
export QWS_KEYBOARD=TTY:/dev/tty1
export HOME=/root
cd /home/plg/
./yundong -qws
hotplug
~
5 你会发现添加了不少东西,特别是
export CAMERA_DEVICE=/dev/video2
。重启就可以使用触摸屏并且有摄像头初始化