forgot to fix variables with config changes, fixed and added v2 webcam support

This commit is contained in:
Alfonso Gamboa 2022-06-04 00:52:47 -07:00
parent be2ca75dfc
commit 6bedd478b5

View File

@ -12,21 +12,33 @@ fi
touch -- "$LOG_NAME".log touch -- "$LOG_NAME".log
exec 1> $LOG_NAME.log 2>&1 exec 1> $LOG_NAME.log 2>&1
export WZMINI_CFG=/opt/wz_mini/wz_mini.conf
[ -f $WZMINI_CFG ] && source $WZMINI_CFG
set -x set -x
echo "welcome to wz_cam.sh" echo "welcome to wz_cam.sh"
echo "PID $$" echo "PID $$"
#test for v2
if [ -b /dev/mtdblock9 ]; then
mount -t jffs2 /dev/mtdblock9 /params
if cat /params/config/.product_config | grep WYZEC1-JZ; then
V2="true"
fi
fi
if [ "$V2" == "false" ]; then
cp /opt/wz_mini/etc/uvc.config /opt/wz_mini/usr/bin/uvc.config cp /opt/wz_mini/etc/uvc.config /opt/wz_mini/usr/bin/uvc.config
if [[ $(cat /opt/wz_mini/run_mmc.sh | grep "WEB_CAM_FPS_RATE\=") != "" ]]; then if [[ "WEB_CAM_FPS_RATE" != "" ]]; then
WEB_CAM_FPS_RATE=$(cat /opt/wz_mini/run_mmc.sh | grep "WEB_CAM_FPS_RATE\=" | cut -d'"' -f 2)
echo RATE IS $WEB_CAM_FPS_RATE
sed -i "s/fps_num :30/fps_num :$WEB_CAM_FPS_RATE/" "/opt/wz_mini/usr/bin/uvc.config" sed -i "s/fps_num :30/fps_num :$WEB_CAM_FPS_RATE/" "/opt/wz_mini/usr/bin/uvc.config"
fi fi
if [[ $(cat /opt/wz_mini/run_mmc.sh | grep "WEB_CAM_BIT_RATE\=") != "" ]]; then if [[ "WEB_CAM_BIT_RATE" != "" ]]; then
WEB_CAM_BIT_RATE=$(cat /opt/wz_mini/run_mmc.sh | grep "WEB_CAM_BIT_RATE\=" | cut -d'"' -f 2)
sed -i "s/bitrate :8000/bitrate :$WEB_CAM_BIT_RATE/" "/opt/wz_mini/usr/bin/uvc.config" sed -i "s/bitrate :8000/bitrate :$WEB_CAM_BIT_RATE/" "/opt/wz_mini/usr/bin/uvc.config"
fi fi
@ -61,4 +73,44 @@ echo out > direction
echo 0 > active_low echo 0 > active_low
echo 0 > value echo 0 > value
/opt/wz_mini/bin/audioplay_t31 /usr/share/notify/binbin.wav 30 /opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/binbin_v3.wav 30
else
cp /opt/wz_mini/etc/uvc_v2.config /opt/wz_mini/usr/bin/uvc.config
if [[ "WEB_CAM_FPS_RATE" != "" ]]; then
sed -i "s/fps_num :30/fps_num :$WEB_CAM_FPS_RATE/" "/opt/wz_mini/usr/bin/uvc.config"
fi
if [[ "WEB_CAM_BIT_RATE" != "" ]]; then
sed -i "s/bitrate :8000/bitrate :$WEB_CAM_BIT_RATE/" "/opt/wz_mini/usr/bin/uvc.config"
fi
mount --bind /opt/wz_mini/usr/bin /system/bin
insmod /driver/tx-isp.ko isp_clk=100000000
insmod /driver/exfat.ko
insmod /driver/sample_motor.ko
insmod /system/audio.ko
insmod /driver/sinfo.ko
insmod /driver/sample_pwm_core.ko
insmod /driver/sample_pwm_hal.ko
insmod /opt/wz_mini/lib/modules/3.10.14_v2/kernel/libcomposite.ko
insmod /opt/wz_mini/lib/modules/3.10.14_v2/kernel/videobuf2-vmalloc.ko
insmod /opt/wz_mini/lib/modules/3.10.14_v2/kernel/usbcamera.ko
sh /system/bin/led.sh &
/opt/wz_mini/usr/bin/getSensorType
/opt/wz_mini/usr/bin/ucamera_v2 &
devmem 0x10000040 32 0x0b000096
devmem 0x10000040 32 0x0b800096
devmem 0x13500000 32 0x001100cc
/opt/wz_mini/bin/audioplay_t31 /opt/wz_mini/usr/share/audio/binbin_v3.wav 30
fi