diff --git a/yocto/meta-tvis-app/recipes/hvgo-tvis/files/hvgo.c b/yocto/meta-tvis-app/recipes/hvgo-tvis/files/hvgo.c index 8983cf5d36..39734a0265 100755 --- a/yocto/meta-tvis-app/recipes/hvgo-tvis/files/hvgo.c +++ b/yocto/meta-tvis-app/recipes/hvgo-tvis/files/hvgo.c @@ -8,6 +8,7 @@ typedef struct } version; static version versions[] = { + {"V1.21 20240801", "1. 添加开机自动获取流数据的操作; 2. 添加 process-monitor.sh 进程监控脚本; 3. 更新rtsp-server程序; "}, {"V1.20 20240730", "1. 解决找不到 multimedia 模块的问题; 2. RS485控制IO修改为TP19, 解决无法正常收发的问题; 3. 网络初始化脚本新增10s延时; 4, USB 3.0 开机默认为host模式; "}, {"V1.19 20240722", "1. 删除 network-initialization, rtsp-server 服务, 新增 autostart.service 服务实现自启动脚本; 2. 更新 netcore 环境位置; "}, {"V1.18 20240720", "1. 更新automountsdcard.sh 脚本, 修改硬盘挂载点为: /media/harddisk* U盘: /media/udisk* SD卡: /media/sdcard; 2. 修改network-config脚本; 3. 支持U盘升级固件的功能; 4. 支持hddtemp sysstat 工具;"}, diff --git a/yocto/meta-tvis-app/recipes/system-environment-tvis/files/autostart/autostart.sh b/yocto/meta-tvis-app/recipes/system-environment-tvis/files/autostart/autostart.sh index 70e6a01154..9caa4c79fd 100644 --- a/yocto/meta-tvis-app/recipes/system-environment-tvis/files/autostart/autostart.sh +++ b/yocto/meta-tvis-app/recipes/system-environment-tvis/files/autostart/autostart.sh @@ -1,7 +1,13 @@ #!/bin/bash +# 开机先做一次取流操作 +v4l2-ctl --verbose -d /dev/video0 --set-fmt-video=width=640,height=360,pixelformat=NV12 --stream-mmap=16 --stream-count=10 --stream-to=/userdata/cap0.yuv --stream-poll & +v4l2-ctl --verbose -d /dev/video1 --set-fmt-video=width=640,height=360,pixelformat=NV12 --stream-mmap=16 --stream-count=10 --stream-to=/userdata/cap1.yuv --stream-poll & +v4l2-ctl --verbose -d /dev/video2 --set-fmt-video=width=640,height=360,pixelformat=NV12 --stream-mmap=16 --stream-count=10 --stream-to=/userdata/cap2.yuv --stream-poll & +v4l2-ctl --verbose -d /dev/video3 --set-fmt-video=width=640,height=360,pixelformat=NV12 --stream-mmap=16 --stream-count=10 --stream-to=/userdata/cap3.yuv --stream-poll & + #hvgo set-network false 192.168.1.249 & # 测试,修改外网IP地址为 249 echo "host" >/sys/devices/platform/fe8a0000.usb2-phy/otg_mode & # 切换成host模式 # echo "peripheral" >/sys/devices/platform/fe8a0000.usb2-phy/otg_mode & # 切换成peripheral模式 -rtsp-server & # RTSP-SERVER 程序 -/etc/tvis/network/initialization.sh & # eth0、WIFI 网络初始化脚本 \ No newline at end of file +/etc/tvis/network/initialization.sh & # eth0、WIFI 网络初始化脚本 +process-monitor.sh rtsp-server & # RTSP-SERVER 程序 \ No newline at end of file diff --git a/yocto/meta-tvis-app/recipes/system-environment-tvis/files/process-monitor/process-monitor.sh b/yocto/meta-tvis-app/recipes/system-environment-tvis/files/process-monitor/process-monitor.sh new file mode 100644 index 0000000000..ce4dc5c0dc --- /dev/null +++ b/yocto/meta-tvis-app/recipes/system-environment-tvis/files/process-monitor/process-monitor.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +APP=$1 # 进程名称 + +if [ ! -n "$APP" ];then + exit 1 +fi + +while true; do + if ! pgrep -x $APP > /dev/null; then + eval $* + fi + sleep 1 +done \ No newline at end of file diff --git a/yocto/meta-tvis-app/recipes/system-environment-tvis/files/rtsp-server/rtsp-server b/yocto/meta-tvis-app/recipes/system-environment-tvis/files/rtsp-server/rtsp-server index cf8de7eb2f..8750413ce5 100644 Binary files a/yocto/meta-tvis-app/recipes/system-environment-tvis/files/rtsp-server/rtsp-server and b/yocto/meta-tvis-app/recipes/system-environment-tvis/files/rtsp-server/rtsp-server differ diff --git a/yocto/meta-tvis-app/recipes/system-environment-tvis/system-environment-tvis.bb b/yocto/meta-tvis-app/recipes/system-environment-tvis/system-environment-tvis.bb index 252203da7c..ed5bab7dd4 100644 --- a/yocto/meta-tvis-app/recipes/system-environment-tvis/system-environment-tvis.bb +++ b/yocto/meta-tvis-app/recipes/system-environment-tvis/system-environment-tvis.bb @@ -6,6 +6,7 @@ LICENSE = "CLOSED" SRC_URI += "file://.dotnet" SRC_URI += "file://autostart" SRC_URI += "file://network" +SRC_URI += "file://process-monitor" SRC_URI += "file://rtsp-server" S = "${WORKDIR}" @@ -23,9 +24,12 @@ do_install() { chmod 777 -R ${D}/etc/tvis/.dotnet ln -sf /etc/tvis/.dotnet/dotnet ${D}/usr/bin/dotnet - # autostart 脚本 + # autostart, process-monitor 脚本 install -d ${D}/etc/tvis/ install -m 0755 ${WORKDIR}/autostart/autostart.sh -D ${D}/etc/tvis/autostart.sh + install -m 0755 ${WORKDIR}/process-monitor/process-monitor.sh -D ${D}/etc/tvis/process-monitor.sh + ln -sf /etc/tvis/autostart.sh ${D}/usr/bin/autostart.sh + ln -sf /etc/tvis/process-monitor.sh ${D}/usr/bin/process-monitor.sh # 网络初始化脚本 install -d ${D}/etc/systemd/system/ @@ -41,9 +45,11 @@ do_install() { install -m 0755 ${WORKDIR}/network/config.sh -D ${D}/etc/NetworkManager/dispatcher.d/10-network-config.sh # rtsp-server 工具 - install -d ${D}${bindir} - install -m 0755 ${WORKDIR}/rtsp-server/rtsp-server ${D}${bindir} - install -m 0755 ${WORKDIR}/rtsp-server/mkv-rtsp-server ${D}${bindir} + install -d ${D}/etc/tvis/rtsp-server + cp -rf ${S}/rtsp-server/* ${D}/etc/tvis/rtsp-server + chmod 777 -R ${D}/etc/tvis/rtsp-server + ln -sf /etc/tvis/rtsp-server/rtsp-server ${D}/usr/bin/rtsp-server + ln -sf /etc/tvis/rtsp-server/mkv-rtsp-server ${D}/usr/bin/mkv-rtsp-server } FILES_${PN} += "/etc/*"