diff --git a/rootfs/etc/fw_env.config b/rootfs/etc/fw_env.config new file mode 100644 index 0000000..d7a234b --- /dev/null +++ b/rootfs/etc/fw_env.config @@ -0,0 +1 @@ +/dev/mtd0 0x0 0x80000 0x40000 diff --git a/rootfs/link/bin/Encoder b/rootfs/link/bin/Encoder index 3624b0a..44aaac7 100644 Binary files a/rootfs/link/bin/Encoder and b/rootfs/link/bin/Encoder differ diff --git a/rootfs/link/config/rtty.json b/rootfs/link/config/rtty.json new file mode 100644 index 0000000..89d9aa6 --- /dev/null +++ b/rootfs/link/config/rtty.json @@ -0,0 +1 @@ +{"enable":false,"ip":"191.80.63.50","id":"00000001","des":"编码板","token":""} diff --git a/rootfs/link/config/verLogs.json b/rootfs/link/config/verLogs.json index 30ee973..c75c59e 100644 --- a/rootfs/link/config/verLogs.json +++ b/rootfs/link/config/verLogs.json @@ -1,4 +1,15 @@ [ + { + "version": "2.5.0 build 20230831", + "logs": [ + "修正http接口获取/设置水印异常问题", + "修正srt输出,latency参数值不能大于1000的问题", + "优化ENC1V3与ENCSHV2机型的4K输出画质", + "ENC1V3、ENCSHV2、ENC5V2机型,HDMI输出增加水平镜像功能", + "高级设置下远程访问页面,新增Rtty访问设备方式", + "系统底层优化" + ] + }, { "version": "2.4.0 build 20230731", "logs": [ diff --git a/rootfs/link/config/version.json b/rootfs/link/config/version.json index 32d7550..63f4527 100644 --- a/rootfs/link/config/version.json +++ b/rootfs/link/config/version.json @@ -1,5 +1,5 @@ { "app": "2.0.0 build 20220512_869", "sdk": "2.0.0 build 20220518_20716", - "sys": "2.4.0 build 20230731" + "sys": "2.5.0 build 20230831" } diff --git a/rootfs/link/shell/dhcp_echo.sh b/rootfs/link/shell/dhcp_echo.sh new file mode 100644 index 0000000..ece648f --- /dev/null +++ b/rootfs/link/shell/dhcp_echo.sh @@ -0,0 +1,13 @@ +#!/bin/sh +if [ $1 != "bound" ]; then + exit 0 +fi +if [ "$ip" == "" ]; then + exit 0 +fi +echo "dhcp_result" +echo "dev:"$interface +echo "ip:"$ip +echo "mask:"$subnet +echo "gw:"$router +echo "dns:"$dns diff --git a/rootfs/link/shell/init.sh b/rootfs/link/shell/init.sh index 8e00209..dcd250a 100644 --- a/rootfs/link/shell/init.sh +++ b/rootfs/link/shell/init.sh @@ -14,6 +14,7 @@ else /link/shell/netManager.sh /link/shell/init/filesystem.sh /link/shell/init/service.sh +/link/shell/init/rtty.sh /link/shell/app.sh fi diff --git a/rootfs/link/shell/init/rtty.sh b/rootfs/link/shell/init/rtty.sh new file mode 100644 index 0000000..2f2f4cd --- /dev/null +++ b/rootfs/link/shell/init/rtty.sh @@ -0,0 +1,32 @@ +. /link/shell/util/hardware.sh +cfg=/link/config/rtty.json +ver=/link/config/version.json + +#model=${model:4} +sys=`jq -r .sys $ver` +build=`echo $sys | sed 's/\"//g' | awk '{split($1, arr, " "); print arr[1]}'` + +( + while [ true ] + do + enable=`jq -r .enable $cfg` + if [ "$enable" == "true" ] ;then + ip=`jq -r .ip $cfg` + id=`jq -r .id $cfg` + des=`jq -r .des $cfg` + token=`jq -r .token $cfg` + if [ "$des" == "" ];then + des=$model" build "$build + else + des=$des" ( "$model" build "$build" )" + fi + if [ "$token" == "" ] ;then + rtty -I "$id" -h $ip -p 5912 -a -v -d "$des" + else + rtty -I "$id" -h $ip -p 5912 -a -v -d "$des" -t $token + fi + fi + sleep 2 + done +) & + diff --git a/rootfs/link/shell/init/service.sh b/rootfs/link/shell/init/service.sh index cf9ab58..2f2af33 100644 --- a/rootfs/link/shell/init/service.sh +++ b/rootfs/link/shell/init/service.sh @@ -47,3 +47,8 @@ if [ `jget sls` == "true" ]; then fi /link/shell/ntp.sh & + +frp_enable=$(cat /link/config/rproxy/frp_enable |awk '{printf "%s",$1}') +if [ "$frp_enable" == "true" ]; then +/link/shell/frp.sh & +fi diff --git a/rootfs/link/shell/update.sh b/rootfs/link/shell/update.sh index e91a62c..a8bf1dc 100644 --- a/rootfs/link/shell/update.sh +++ b/rootfs/link/shell/update.sh @@ -40,6 +40,11 @@ if [ ! -z "$(ls -A /link/update)" ]; then rm -rf /tmp/history_config rm /link/config/auto/no_user_setting + + if [ -f "/link/config/uboot_env.txt" ]; then + fw_setenv -s /link/config/uboot_env.txt + rm /link/config/uboot_env.txt + fi if [ -f "/link/config/reboot" ]; then rm /link/config/reboot @@ -55,3 +60,5 @@ fi + + diff --git a/rootfs/link/web/func.php b/rootfs/link/web/func.php index 1367546..2156b82 100644 --- a/rootfs/link/web/func.php +++ b/rootfs/link/web/func.php @@ -453,19 +453,21 @@ function formatBytes($total) { function getDiskSpace() { global $result; $mountDir = '/root/usb'; - $output = shell_exec('df ' . $mountDir); + $output = shell_exec('df -h ' . $mountDir); if(strpos($output, $mountDir) != false) { - $totalSpace = disk_total_space($mountDir); - $freeSpace = disk_free_space($mountDir); - $usedSpace = $totalSpace - $freeSpace; +// $totalSpace = disk_total_space($mountDir); +// $freeSpace = disk_free_space($mountDir); +// $usedSpace = $totalSpace - $freeSpace; + $lines = explode("\n", trim($output)); + $dataLine = $lines[count($lines) - 1]; + $totalSpace = preg_split('/\s+/', $dataLine)[1]; + $usedSpace = preg_split('/\s+/', $dataLine)[2]; - $result->total = formatBytes($totalSpace); - $result->free = formatBytes($freeSpace); - $result->used = formatBytes($usedSpace); + $result->total = $totalSpace; + $result->used = $usedSpace; } else { $result->total = 0; - $result->free = 0; $result->used = 0; } } @@ -571,6 +573,10 @@ function getAliase() { $result->result = $ret["data"]; } +function reloadRtty() { + exec("pkill rtty"); +} + function send($url, $data = null){ global $result; $context = null; diff --git a/rootfs/link/web/link/api/overlay.php b/rootfs/link/web/link/api/overlay.php index 0cfe8db..59ffe05 100644 --- a/rootfs/link/web/link/api/overlay.php +++ b/rootfs/link/web/link/api/overlay.php @@ -14,20 +14,27 @@ class Overlay extends Verify $this->link_verify(); $conf = $this->load_conf('/link/config/config.json'); $result = []; - foreach ($conf as $item) { - if (!$item['type'] == 'file') - continue; + $overlayConf = []; + if(file_exists("/link/config/auto/overlay.json")) + $overlayConf = $this->load_conf('/link/config/auto/overlay.json'); + + for($i=0;$i $item['id'], 'name' => $item['name'], 'type' => $item['type'], 'enable'=> $item['enable'], 'enable2'=> $item['enable2'], - 'overlay' => $item['overlay'] ); + if(count($overlayConf) > 0) + $obj['overlay'] = $overlayConf[$i]; + else + $obj['overlay'] = $item['overlay']; array_push($result, $obj); } + return $this->handleRet($result, "success", "执行完成", "execution is completed"); } catch (Exception $ex) { return $this->handleRet('', 'error', $ex->getMessage(), $ex->getMessage()); @@ -42,31 +49,47 @@ class Overlay extends Verify $this->check_args($params); $conf = $this->load_conf('/link/config/config.json'); - for($i=0;$i -1) - $conf[$index] = $chn; + $client = new RpcClient(); + $client->update_overlay($overlayConf); } + else + { + for($i=0;$iupdate_enc($conf); + $id = $param['id']; + + $chn=null;$index=-1; + for($j=0;$j -1) + $conf[$index] = $chn; + } + $client = new RpcClient(); + $client->update_enc($conf); + } return $this->handleRet("","success","执行完成","execution is completed"); } diff --git a/rootfs/link/web/link/monitor.php b/rootfs/link/web/link/monitor.php index 6dabda2..19ed1a9 100644 --- a/rootfs/link/web/link/monitor.php +++ b/rootfs/link/web/link/monitor.php @@ -1,13 +1,5 @@ send(); return $ret; } + + public function update_overlay($param) + { + $client = new Client(self::enc_url); + $client->query('enc.updateOverlay',[json_encode($param,JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT)]); + $client->send(); + } } \ No newline at end of file diff --git a/rootfs/link/web/mix.php b/rootfs/link/web/mix.php index 3e38527..f895f49 100644 --- a/rootfs/link/web/mix.php +++ b/rootfs/link/web/mix.php @@ -174,6 +174,23 @@ include("head.php"); + + +
+ +
+ +
+
+ +
+ +
+ +
+ +
+
+