add a few more files

This commit is contained in:
Cyberes 2023-03-31 23:16:47 -06:00
parent 8c8ebdbb45
commit da17e3709a
3 changed files with 189 additions and 0 deletions

156
bin/sensordetect.sh Executable file
View File

@ -0,0 +1,156 @@
#!/bin/sh
#ssp目前仅能处理sony, 其他的还要改
. /etc/sysenv.conf
if [ ! -e ${SENSOR_CONF} ]
then
if [ ! -e ${SENSOR_CONF_DEFAULT} ]
then
echo "Not Exist sensorconf, set as AUTO"
echo "sensortype=AUTO" > ${SENSOR_CONF}
else
echo "Use default sensor conf"
cp -f ${SENSOR_CONF_DEFAULT} ${SENSOR_CONF}
fi
fsync ${SENSOR_CONF}
sleep 1
else
. ${SENSOR_CONF}
if [ $sensortype = "AUTO" ] && [ -e ${SENSOR_CONF_DEFAULT} ]
then
cp -f ${SENSOR_CONF_DEFAULT} ${SENSOR_CONF}
fsync ${SENSOR_CONF}
echo "Use default sensor conf"
sleep 1
fi
fi
. ${SENSOR_CONF}
if [ $sensordetect"AA" = "N""AA" ]
then
echo "Not Detect AUTO, CurrSensor: $sensordetect"
exit
fi
sensor_curr_conf=$sensortype
sensor_detect=`/bin/sensord`
### 如果链接失效. 新建一个指向ov9712的链接, 是的vs_server 可以跑起来. 然后强制进行检测
if [ ! -r ${SENSOR_SO} ]
then
rm ${SENSOR_SO} -fr
ln -s /usr/lib/libsns_ov9712.so ${SENSOR_SO}
sensor_curr_conf=AUTO
fi
if [ $1"A" = "force""A" ]
then
echo "force redetect"
sensor_curr_conf=AUTO
fi
echo "Sensor Detect $sensor_detect AA"
echo sensor_cfg 111
if [ $sensor_detect = "$sensor_curr_conf" ] || [ $sensor_detect = "unknown" ]
then
echo "Sensor is $sensor_detect, do nothing"
exit
fi
echo sensor_cfg 222a
echo "echo sensor_curr_conf $sensor_curr_conf, sensor_detect is $sensor_detect"
if [ "$sensor_curr_conf" = "AUTO" -o $sensor_curr_conf"A" = "A" -o $sensor_detect != $sensor_curr_conf ]
then
if [ $sensor_detect = "gc1034" ]
then
sensor_detect_ar0130_conf="720P"
if [ -f /etc/ipcamera/config_capability.ini ]
then
. /etc/ipcamera/config_capability.ini
if [ ! -z "$sensor_detect_ar0130" ]
then
sensor_detect_ar0130_conf=$sensor_detect_ar0130
fi
fi
if [ $sensor_detect_ar0130_conf == "960P" ] && [ $sensor_detect == "ar0130" ]
then
echo "AR0130 Default Model 960P"
sensor_detect=ar0130_960p
echo "sensortype=$sensor_detect" > ${SENSOR_CONF}
if [ $conf_backup = "Y" ]
then
cp -f /etc/ipcamera/conf_960p/config_cfgaccess.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_960p/config_devm.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_960p/config_mpmng.ini /etc/ipcamera/ipc6000/
cp -f /etc/ipcamera/conf_960p/config_enc.ini /etc/ipcamera/ipc6000/
cp -f /etc/ipcamera/conf_960p/config_p2pstream.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_960p/config_av.ini /etc/ipcamera/ipc6000/
fi
set_mediamem 44M
else
echo "sensor $sensor_detect Default Model 720P"
echo "sensortype=$sensor_detect" > ${SENSOR_CONF}
if [ $conf_backup = "Y" ]
then
cp -f /etc/ipcamera/conf_720p/config_cfgaccess.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_720p/config_devm.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_720p/config_mpmng.ini /etc/ipcamera/ipc6000/
cp -f /etc/ipcamera/conf_720p/config_p2pstream.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_720p/config_av.ini /etc/ipcamera/ipc6000/
fi
set_mediamem 47M
fi
elif [ $sensor_detect = "gc2053" ]
then
echo "Set Sensor $sensor_detect 1080P"
echo "sensortype=$sensor_detect" > ${SENSOR_CONF}
#set_mediamem 43M
if [ $conf_backup = "Y" ]
then
cp -f /etc/ipcamera/conf_1080p/config_cfgaccess.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_1080p/config_enc.ini /etc/ipcamera/ipc1080p/
cp -f /etc/ipcamera/conf_1080p/config_devm.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_1080p/config_mpmng.ini /etc/ipcamera/ipc1080p/
cp -f /etc/ipcamera/conf_1080p/config_p2pstream.ini /etc/ipcamera/
cp -f /etc/ipcamera/conf_1080p/config_av.ini /etc/ipcamera/ipc1080p/
fi
else
echo "sensortype=$sensor_detect" > ${SENSOR_CONF}
fi
else
echo "sensor $sensor_detect, store only"
echo "sensortype=$sensor_detect" > ${SENSOR_CONF}
fi
chmod +x ${SENSOR_CONF}
sync
sleep 1
echo "Reconfig Sensor as $sensor_detect"
/bin/sensorenv.sh
sleep 3
sync
echo sensor_cfg DONE
### 一般情况下, sensor改变, 是因为升级, 所以这里休眠时间长点, 让系统有时间做flash重整
### 130W <-> 100W 之间的切换, 也会花这么长时间. 待优化
echo "curr:$sensor_curr_conf detect:$sensor_detect reboot after 3 sec"
sleep 3
reboot

29
bin/sensorenv.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
#### /etc/sysenv.conf
##RT_PATH=/rt
##SENSOR_CONF=/etc/sensor.conf
##SENSOR_SO=/rt/lib/libSensor.so
. /etc/sysenv.conf
. ${SENSOR_CONF}
SensorType=${sensortype}
sensorso=${SENSOR_SO}
rm ${sensorso} 2>/dev/null
echo "set sensorenv ,sensor as $SensorType"
rm ${sensorso} -rf
case $SensorType in
gc2053)
ln -s /usr/lib/libsns_gc2053.so ${sensorso}
;;
*)
ln -s /usr/lib/libsns_gc2053.so ${sensorso}
echo "xxxx Invalid sensor type $SNS_A xxxx"
;;
esac
sync
exit

4
bin/zzz Executable file
View File

@ -0,0 +1,4 @@
if [ -e /bin/vslocal/vs_server ];
then
mv /bin/vslocal/vs_server /bin/vslocal/vs_server.safe
fi