跳转至

小工具使用指南

使用说明

本手册将引导您快速掌握本工具的操作界面及其功能,包括:通过系统设置网络管理进行基础参数调整;使用U盘脚本功能替换开机程序或执行自定义脚本;以及恢复出厂默认工程的具体方法。

1.小工具主界面

小工具主界面为三个菜单选项,分别是"网络管理""系统设置",右上角有"U盘"、"网口"、"WIFI"和"4G移动网络"的状态显示图标,系统主界面及状态栏。

2.通用系统设置

2.1 基本设置

基本设置界面可以对设备名称、屏幕背光和蜂鸣器进行设置。

2.2 语言设置

语言设置可以切换文字的中英文显示。

2.3 时间设置

时间设置可以设置当前的日期和时间,同时也可切换对应的时区用于联网自动校时。

2.4 屏幕校准

屏幕校准用于校准触摸位置,点击"开始"进入校准程序,根据界面提示完成校准。

2.5 版本信息查看

版本信息界面,可以查看FW固件版本号。

3.网络管理

3.1 以太网

以太网配置界面,可以配置动态或静态IP以及一些静态IP地址相关的参数。

3.2 网络诊断界面

网络诊断界面包含了以太网、WIFI和4G的网络诊断,可通过Ping外网地址或网站测试网络连通性。

3.3 4G配置界面

4G配置界面包含了IMEI和ICCID信息,可手动配置APN来实现实现业务隔离、服务质量控制、安全策略部署。

3.4 WLAN配置界面

WLAN配置界面包含了WLAN功能的开关和扫描到的WLAN列表信息,可根据实际需要连接指定的WIFI。

4.U盘脚本执行

①:编写脚本并放置文件

编写对应脚本并放置于U盘文件,并将要拷贝的文件放在U盘中。

  • 示例脚本:
#!/bin/bash

echo "Remounting root filesystem as read-write..."
mount -o remount rw / || {
    echo "Error: Failed to remount root filesystem as read-write"
    exit 1
}

NEW_BIN_TARGET="/usr/local/bin/"
NEW_LIB_TARGET="/usr/local/lib/"
OLD_BIN_TARGET="/opt/wecon/app/usr/bin/"
OLD_LIB_TARGET="/opt/wecon/app/usr/lib/"
APP_NAME="HMIApp"
APP_NEW_PATH="${NEW_BIN_TARGET}${APP_NAME}"
APP_OLD_PATH="${OLD_BIN_TARGET}${APP_NAME}"

is_new_partition=0
if [ -d "$NEW_BIN_TARGET" ]; then
    is_new_partition=1
fi

mount_points=$(mount | grep /dev/sd | awk '{print $3}')
if [ -z "$mount_points" ]; then
    echo "Warning: No /dev/sd mount points found"
    exit 1
fi

found=0
target_bin=""
target_lib=""
app_path=""

for mount_point in $mount_points; do
    usb_hmiapp_bin="$mount_point/HMIApp/bin"
    usb_hmiapp_lib="$mount_point/HMIApp/lib"
    if [ -d "$usb_hmiapp_bin" ] && [ -d "$usb_hmiapp_lib" ]; then
        found=1
        if [ $is_new_partition -eq 1 ]; then
            target_bin="$NEW_BIN_TARGET"
            target_lib="$NEW_LIB_TARGET"
            app_path="$APP_NEW_PATH"
        else
            target_bin="$OLD_BIN_TARGET"
            target_lib="$OLD_LIB_TARGET"
            app_path="$APP_OLD_PATH"
        fi
      echo "Terminating HMIApp and SysSet processes before copy..."
        killall -9 HMIApp 2>/dev/null
        killall -9 SysSet 2>/dev/null
        sleep 1
        mkdir -p "$target_bin" "$target_lib"
        cp -rf "$usb_hmiapp_bin/"* "$target_bin"
        cp -rf "$usb_hmiapp_lib/"* "$target_lib"
        echo "Files copied successfully"
        break
    fi
done

if [ $found -eq 1 ] && [ -f "$app_path" ]; then
    chmod +x "$app_path"
else
    if [ $found -eq 0 ]; then
        echo "Error: No valid HMIApp directories found"
    else
        echo "Error: Application not found at $app_path"
    fi
fi

sync
reboot
  • 示例脚本对应HMIApp文件夹的目录结构:
HMIApp/                  # 主目录(必须存在)
    ├── bin/                 # 可执行文件目录
    │   ├── HMIApp           # 主应用程序(必须)
    │   ├── SysSet           # 系统设置程序(会被终止)
    │   └── ...              # 其他可执行文件
    └── lib/                 # 库文件目录
        ├── libmodule1.so    # 库文件1
        ├── libmodule2.so    # 库文件2
        └── ...              # 其他库文件

②:使用小工具上的U盘升级工具

③:执行脚本文件

对脚本文件进行执行。

④:运行成功验证

运行成功,test文件被拷贝到相应目录,可使用SSH工具登入触摸屏后台查看拷贝文件,确认是否拷贝成功。

5.恢复出厂默认工程

该功能实现的时用户需要进行二次写入时,可通过长按屏幕右上角区域可实现出厂默认工程的切换,使用默认工程的U盘升级功能来进行程序的替换。